I am observing strange PB behavior.
As I mentioned in my previous post (I don’t know how to point to it correctly),
I am playing with the same PB but different LED configurations.
Couple days ago I finally created working mapping for the 8x32 matrix with vertical zigzagging.
While doing this I observed very strange PB behavior and could not understand why my
mapping code was not working as expected. Finally it did work.
What was very strange and unexplained - it was exactly the same code as day before.
I saved this code in a text file on my PC.
Then I reconfigured PB for the 300 LEDs strip.
The PB behavior was expected.
Today I tried to return back to matrix configuration.
PB was reconfigured for the matrix (loaded mapping and changed LED number) but previously
working text scrolling pattern did not work. It was producing randomly dancing pixels.
I did recycled power few times an carefully rechecked all my codes and PB configuration.
Everything looked OK but was not working.
Suddenly after about 20 min things fixed itself without me touching anything.
(I was sitting and scratching my head thinking about what it could be.)
This happens twice. So, something is going on.
Is it a reasonable explanation for this PB V3 behavior?
There might be an order of operations thing happening.
Set your LEDs up in settings.
Edit your pixel map. It is regenerated every time it changes, and depends on pixel count. If unsure, change 1 character (and back again) then save. If you change pixel count in settings, you need to regenerate your map.
Load a pattern. The pattern depends on pixel count and the map.
To point to a post, copy the URL on that page, or click on the leftmost icon under a post that is of a chain:
Actually I was using yours suggested sequence because it is logical.
And I even tried to recycle power multiple times.
BTW, Is it any better way to reboot/restart PB without recycling power?
Nothing worked no matter what I tried.
But magic happened just by itself after about 20 min of run time
and without me touching anything.
I guess, it simply happened because PB was designed by Wizard!
The same exact behavior was observed twice.
First time when I tried to adjust mapping from example from
horizontal zigzagging to vertical. I even verified all math
by using online Java interpreter. All indexing look correct
but thing did not work. And finally next day everything
magically became normal.
Sometime magic happens but being experienced EE
I really hate when things get fixed by itself without
clear understanding what is/was going on.
This is a primary reason why I created this post.
You shouldn’t need to do this normally. If something happens and you can’t load the page and/or connect (get past spinning loading cube), then power cycling it can help. Otherwise it’s more likely to cause issues (like cutting power mid-write, or just causing chaos with the browser app).
Hahah, I try to make the magic work for you, not mysteriously against you!
If you can reproduce it, a screen recording would be helpful. I could hop on a video chat and you can screen share if that is easier. Mainly I would be looking for what exactly it’s doing when it’s broken, and any clues (error messages, status messages, and if needed we can poke around in the browser console and look at variables).
Yes, I agree, cutting power is not a good idea.
But how to reboot/restart a PB without recycling power?
Is it a user accessible RESET pin/pad on a board?
Or maybe a command?
Unfortunately I did not find any better way how to
restart a PB without a recycling power.
Two more PBs are on the way and should be in shortly.
But I am not sure how screen recording may help to debug this case.
To begin with - there was not any unusual errors.
The editor immediately reacts on any typed character.
Yes, there are some errors while code is edited but after that I did
not seen anything unusual.
When I started to modify mapping I got an up-side-down scrolling
almost instantly. But no matter what I tried I could not get it running
right. Finally I created JSON mapping. This worked right instantly.
Next day I was planning to try again mapping function.
To my VERY BIG SURPRIZE it also worked right instantly.
But this was exactly the same code I saved before switching to
JSON mapping. So, I had no idea why PB started to work as expected.
Than I reconfigured PB for 300 LEDs strip.
This did not create any problem and worked right away as expected.
Today I returned back to matrix configuration by changing number of
LEDs back to 256 and loaded my saved mapping code and saved
text scrolling pattern.
Ops. The PB behavior became very sporadic. Scrolling actually
somewhat worked but characters became corrupted and pixels
within character randomly flashing. So, I carefully repeated all
configuration steps few times (including recycling power).
BTW, during this steps I did not modify any mapping and/or pattern
codes. But just siting and thinking what the hell is going on
suddenly (after about 20 min) everything became normal.
And it is still normal as we speak. I am not touching mapping
code anymore but only modifying scrolling pattern. The pattern
code needs some adjustments in order to work with my home
automation controller. This is almost finished.
I am actively playing with “Text Scrolling Marquee” pattern originally designed by @jeff
In the initial configuration I had PB with 8x32 LED Matrix (256 LEDs).
Finally I got it working just fine but decide to double LED Matrix to 8x64 (512 LEDs)
After adding second 8x32 matrix powered on PB.
Everything still looked good but only first matrix was active (expected).
First step was to change number of LEDs from 256 to 512.
I do not remember what PB was doing after this step but nothing unusual happened.
Went to Mapper and simply clicked on “Save” button.
I did this just in case because Mapper is using pixelCount global variable
The PB simply crashed - Pattern stopped and GUI Web Page became inaccessible.
Well, I recycled power (what else I could do?).
On a first try all what I got - is a spinning cube.
So, recycled power one more time. This time PB was alive.
The pattern stretched to both matrix but each character became twice fatter (expected).
I reconfigured matrix parameters in pattern itself. Everything became normal but the
pattern was running very slow.
I measured a timing with Digital Oscilloscope on a Data pin and to my big surprise
bit period was 1.9mkS instead of expected 1.25mkS.
LEDs actually tolerated the increased bit period very well (I did not check the spec
for LED and do not remember what it was).
OK, I reconfigured PB and pattern back to 8x32 (256 LEDs) but did not physically
disconnect second matrix.
Reconfiguration went OK. Pattern was running fine and pixel timing returned to 1.25mkS
So, I reconfigured PB and pattern again to double matrix.
This time everything went well including pixel timing (still the expected 1.25mkS).
Everything looks good except the pattern runs significantly slower.
And this is clear why - the entire rendering buffer is processed inside beforeRender
Now I have a question:
How is two cores are utilized?
I think, timing could be significantly improved if beforeRender and render will
run on a different cores.