V3.21 preview

Firework nova:
Jan-29-2022 22-56-31
Cubefire:
Jan-29-2022 22-59-18
xorcery:
Jan-29-2022 23-01-55

12 Likes

So excited for this. Thanks a lot for figuring out some of the challenges around it.

2 Likes

This is going to be beautiful!

2 Likes

Here’s a beta, still some things to finish and tune! There’s no docs, read this post for a quick rundown.
v3.21.pb32.stfu (1.3 MB)
v3.21.pico32.stfu (1.3 MB)

  • Hostname based on name (might show up in your dhcp or router logs)
  • The spinning cube loading screen provides more detail on the status / progress.
  • Update the color picker widget, should fix some small bugs.
  • Fix bug that wouldn’t let you clear out a pixel map
  • Preview pixels up to 1000, up from 100. If you have more it samples across the pixel set, skipping some in between instead of all at the end.
  • Generated previews can be much larger, compression increases to attempt to keep these from getting too big, but can only do so much.
  • Fixed a websocket reconnect issue, improved this overall.
  • Patterns sorted case insensitively, numerically, and should be localized based on browser.
  • Added peer discovery API (not yet used in UI). {"getPeers": true}
  • Added tons of more UI controls! Toggle, trigger (button, one shot), and inputNumber (text number input).
  • New output UI controls: showNumber and gauge. Return a value in a function, can see these without having to use exported vars in the editor. Gauge shows a number 0-1.0, showNumber can be anything.
  • More related implicit globals, no longer causing issues with functions.
  • File list API “/list” shows all files (some might not be discoverable otherwise)
  • Reworked how patterns get saved, should only overwrite/save if it gets there completely and passes some sanity checks. Save progress and success/failure shown in the UI. No more lost/corrupt patterns.
  • The mapper preview can now be manually controlled/rotated in 3D mode. Double click to return to auto rotate.
  • Added live 2d and 3d previews - very beta at this point. The preview pane is visible on the Editor tab. The display style can be adjusted live for very neat effects! Play around with the values in the previewSettings global using the browser console. I plan to add controls or presets for this.
  • Wifi signal strength is show in the scan as a number too.
  • Better dark mode support.
  • Webserver reliability fix. Should see much less connection reset issues.
  • Backup and Restore from backup tools. These are currently under the Advanced Settings tab, which is only accessible when the page is loaded with ?setup in the URL.
6 Likes

First impressions:

  • Wifi config was ignored after the update-initiated reboot and the IP address went back to 192.168.4.1. It re-associated with the originally-configured access point after a power cycle.

  • Pattern save doesn’t work consistently – failure rate seems to increase with the size of the pattern, to the point that some won’t save at all (eg. large patterns like ‘DAFTPUNK’). The yellow progress bar goes all the way across, but sometimes it times out and says ‘error’, and other times the render engine says ‘stalled’ and the button gets stuck on “Saving…”.
    I dug out my trusty Arduino programming shield and the console log says:

Start saving program source file SMbzGa8s4j6XbaYqW
Write stalled. wrote: 0 time: 1814ms errno: 28
Write stalled. wrote: 0 time: 3493ms errno: 28
Write stalled. wrote: 0 time: 4980ms errno: 28
Write stalled. wrote: 0 time: 6624ms errno: 28
Write stalled. wrote: 0 time: 8111ms errno: 28
Write stalled. wrote: 0 time: 9801ms errno: 28
Write stalled. wrote: 0 time: 11707ms errno: 28
ERROR Couldn't write data for saving program source file. wrote: 0, length: 8175
Program source file was closed/not opened!
Program source file was closed/not opened!
  • Another failed save:
Start saving program source file QKZ7LpKZmbAXZAtyJ
Wrote chunk of 8175 bytes to program source file in 482ms
Wrote chunk of 8192 bytes to program source file in 790ms
Wrote chunk of 8192 bytes to program source file in 414ms
Write stalled. wrote: 17 time: 4859ms errno: 28
Write stalled. wrote: 17 time: 6561ms errno: 28
Wrote chunk of 8192 bytes to program source file in 8051ms
Write stalled. wrote: 17 time: 3587ms errno: 28
Write stalled. wrote: 17 time: 5274ms errno: 28
Write stalled. wrote: 17 time: 7003ms errno: 28
Write stalled. wrote: 17 time: 8682ms errno: 28
Write stalled. wrote: 17 time: 10319ms errno: 28
ERROR Couldn't write data for saving program source file. wrote: 17, length: 8192
Program source file was closed/not opened!
Program source file was closed/not opened!
Program source file was closed/not opened!
Program source file was closed/not opened!
Program source file was closed/not opened!
Program source file was closed/not opened!
Program source file was closed/not opened!
  • Also saw lots of this in the console output:
[E][WiFiClient.cpp:383] write(): select timed out on fd 57 waiting for writes. attempt 1
[E][WiFiClient.cpp:383] write(): select timed out on fd 57 waiting for writes. attempt 2
[E][WiFiClient.cpp:383] write(): select timed out on fd 57 waiting for writes. attempt 3
[E][WiFiClient.cpp:383] write(): select timed out on fd 57 waiting for writes. attempt 4
[E][WiFiClient.cpp:383] write(): select timed out on fd 57 waiting for writes. attempt 5
[E][WiFiClient.cpp:383] write(): select timed out on fd 57 waiting for writes. attempt 1
[E][WiFiClient.cpp:383] write(): select timed out on fd 57 waiting for writes. attempt 2
[E][WiFiClient.cpp:383] write(): select timed out on fd 57 waiting for writes. attempt 3
[E][WiFiClient.cpp:383] write(): select timed out on fd 57 waiting for writes. attempt 4
[E][WiFiClient.cpp:383] write(): select timed out on fd 57 waiting for writes. attempt 5
[E][WiFiClient.cpp:383] write(): select timed out on fd 57 waiting for writes. attempt 1
[E][WiFiClient.cpp:383] write(): select timed out on fd 57 waiting for writes. attempt 2
[E][WiFiClient.cpp:383] write(): select timed out on fd 57 waiting for writes. attempt 3
[E][WiFiClient.cpp:383] write(): select timed out on fd 57 waiting for writes. attempt 4
[E][WiFiClient.cpp:383] write(): select timed out on fd 57 waiting for writes. attempt 5
broadcastPreviewFrame webSocket.sendBIN failed
broadcast preview had issues, dropping connections. took 5020 success 0
0 Disconnected!

Can’t tell from the wording whether this message is related to the save operation, or if it is referring to preview frames or peer discovery traffic. This particular PB is in a noisy wifi environment with lots of other electronics nearby, but I hadn’t seen this message with previous firmware versions.

  • Pattern previews in editor are great, but way too dim – they’re dimmer than the actual LEDs! Looks like they’re scaled down based on both the “max brightness” config setting and the ‘brightness’ UI slider. Are you still thinking of changing how this works?

  • I’ll try to play around with generating animated PNGs from the expanded preview JPGs, but all the interesting patterns I want to use won’t save as mentioned above.

  • Shadow around the UI sliders after they’ve been clicked is interesting, but misleading unless there really is an ‘input focus’ such that successive keystrokes go to that widget. Do you intend to handle up/down/left/right arrows for incrementing/decrementing the slider value?

  • New UI inputs are a good idea, but the “inputNumber” prefix doesn’t match the others which are all single words in lower case. How about calling it a spinner? Also, is there any way to enforce upper and lower bounds? I remember there was some discussion back in November or December about two-way binding; if the “inputNumber” and “showNumber” widgets were combined, then the input value to the function could be validated/clamped by the function body and the return value would be what gets displayed.

  • New UI outputs: gauge shows full-scale but loses its ‘%’ label if values are greater than 1; if value is negative, the gauge continues to show the previous valid value.

  • When I edited an existing pattern, the editor complained that “time” was an invalid function call; I eventually figured out that it’s because “time” was being used as a variable name elsewhere in the pattern :man_facepalming:. If that’s what “more related implicit globals, no longer causing issues with functions” means, I can see why it’s a good idea.

  • Color picker range bug is fixed; values now go full-scale from 0…1. :+1:

  • LOVE :two_hearts: the case-insensitive pattern list!

1 Like

Thank you for the super detailed feedback!

Do you mean it went back to setup mode?

Your filesystem is having none of that. It looks very full and is unable to write much of anything. How much free space is reported? It seems to be trying very hard to GC and reclaim free space but having no luck. I would free up some space, running this low can cause issues saving the config! It might also be corrupted.

If you are feeling lucky, a possibly dangerous way to reset many of the pages/sectors would be to use the new backup and restore feature. It won’t reformat the FS, but it will delete pretty much everything except the app pages and let the free space GC clean things up.

The risk is that if your FS is corrupted the restore might have the same kind of write trouble and not get everything back in place.

Your WiFi can’t keep up sending live preview pixels. The log message is new, and the new preview pixel size is going to use more bandwidth, but this would happen in older versions as well.

Hmm… Maybe the number of preview pixels should be a setting, so you can drop it down to save bandwidth and reduce preview storage… The 2d/3d previews don’t look too good when there’s a lot of missing pixels.

Yes, thats still the same. I still plan on changing that at some point. It might be the softness of the LED glow. Try experimenting with some of the preview rendering settings. For example in a browser console (for 2D):

previewSettings.dotMidStep2D=[1,1] //completely remove any gradient
previewSettings.dotScale2D=256 //adjust dot size so they don't overlap so much

With those I get an image like this for white that is rgb (255,255,255)
Screen Shot 2022-01-31 at 7.24.21 AM

There’s also a gamma correction happening to reproduce the linear LED output. Define this function and use it to adjust, defaults to 1/2.2.

function setPreviewPixelGamma(g) {
  pixelGamma = g;
  for (var i = 0; i < 256; i++) {
    var v = Math.round(255 * Math.pow(i / 255, pixelGamma))
    gammaTable[i] = v;
  }
}

I rolled this one around for a while. Counterpoint, hsvPicker, rgbPicker. In the end I went with that for understandability / readability.

Two way controls (that is code changing the control value) isn’t in there yet.

I intend to clamp it to 0-1 values, on my list.

Hmm. A while back I made is so that if you define a variable/function (any identifier) that has the same name as a built-in it will prefer your definition of it. Maybe implicit globals could leak through. This fix specifically is so you can do this:

foo = 42; 
function test() {return foo};

Which would cause an error unless you added the var keyword to declare ‘foo’.

I didn’t try to reconfigure the access point; I just saw it disappear from my wifi network, searched for and found it responding to 192.168.4.1, and then power-cycled before doing any further debugging. When it rebooted, it reassociated with the previous wifi network.

With a minimal pattern loaded at the moment, the web UI header says “Mem:10239” and the debug console says “valid=1 vmerr=0 fps=113.47 apip=192.168.4.1 ip=192.168.8.28 free=197532 bUs=73 aUs=8485 exp=0 wsSWM=7100 webSWM=9308 hrSWM=6076 mainSWM=6104”.

With a pattern that refuses to save, the web UI header says “Mem: 8474” and the debug console says “valid=1 vmerr=0 fps=113.47 apip=192.168.4.1 ip=192.168.8.28 free=109764 bUs=89 aUs=25943 exp=0 wsSWM=6420 webSWM=9300 hrSWM=6064 mainSWM=6136”.

1 Like

If it was responding at address 192.168.4.1 then you must have been connected to the Pixelblaze access point / network in either AP or setup mode.

I wonder if the fail-safe tripped somehow, that could put it back in setup mode.

By free space, I mean the flash storage used to save patterns. This can be seen on the pattern list page here:

The mem in the UI header is the array element RAM available and doesn’t impact saving or previews.

Ah. That says:
FreeSpace

But it fails on patterns that are much smaller than that, like ‘DAFT PUNK’ (19KB of text, 25KB as an EPE). The largest pattern I’ve managed to save was 18KB as an EPE.

1 Like

I hadn’t even thought of that! I tested it, and technically you can do that now but I have such a fine step in place that it would take forever to move from end to end. I think a step of 1/200th still gives fine control and can be moved with the keyboard.

1 Like

Wow :partying_face: love all this thank you soo much. I am especially excited about the UI/IO updates and Preview fixes.

1 Like

Fixed a few minor things, and added some low power modes! This can get tricky, I’d love some UX feedback on how that works.

  • Clamp the gauge inputs to 0-1.
  • Fix gauge display on Safari.
  • Restructured the settings page with new layout / labels.
  • Fixed step on sliders, so you can adjust with the keyboard in 0.5% steps.
  • Moved preview gamma calc to a function setPreviewPixelGamma(newGamma), you can call this in the browser console to play around with different gamma settings.
  • The CPU frequency is configurable for 80/160/240. Takes effect on next startup. This can save 30mA or so between 240MHz and 80MHz.
  • You can disable WiFi on startup. The status LED is also further dimmed. This drops power significantly! Hold the button as if you were going to setup mode, and it will resume the last WiFi mode.

With wifi off and the CPU at 80MHz, both the Pico and Standard draw about 32-34mA. Once you enable WiFi it stays, though I’m looking at a way to turn it back off based on a button or idle timer or something.

v3.22.pb32.stfu (1.3 MB)
v3.22.pico32.stfu (1.3 MB)

I still have some work to fix Safari. Let me know if you see anything odd!

1 Like

I’ll try and check it out early this week.

1 Like

Installed fine. I’ll mess with it and report back.

I’m loving the live preview! To make my 8x32 matrix preview with the correct aspect ratio, I did this:

  map[256] = [0,32]

(and I was gonna ask for an ‘aspect ratio’ knob but clearly this solution is fine :slight_smile: )

Looks good here, but you might want to have a look at the backend website for http://discover.hencke.net/update. With 3.22 installed, it’s offering an upgrade which turns out to be 3.20.

Ha! I accidentally reverted one of mine that way!

1 Like

Hi @wizard - I’d be happy to give the beta a try (I have been a seasoned tester for a UK brand of internet connected audio devices) but I am unclear on a couple of points. How does one install the beta? What are the possibilities of bricking and what are the recovery options in such a case? I want to help, but I also don’t want to mess up. Thanks.

Hi @GodmanchesterGoblin ,
Update files can be applied manually by using the /recovery.html tool on a Pixelblaze, or if that is missing it can be uploaded via the /update built-in page.

That is, if your pixelblaze was usually accessible at http://192.168.1.123, then you would add one of the above paths, e.g. http://192.168.1.123/recovery.html

The recovery tool is nicer because you can see your update progress even for manual files. For the /update page you just have to wait a few minutes without knowing whats going on.

Risks

There may be bugs in this version, probably relatively minor ones, but they might cause some patterns or features to not work.

You can revert to the released version by using the built-in firmware update tool on the settings tab, or by using the ‘/recovery.html’ tool.

It is unlikely to completely brick your PB.

The most common issue happens if there is a problem updating the main web app file, usually when the system is low on storage. 500-600K seems like a safe bet. Less than 300k seems to frequently cause issues. If this happens, the recovery tool can still be used to attempt to repair or revert to the release version.

There is a different update file for each kind of PB v3. One for Standard with the pb32 in it’s name, and one for the Pico with pico32 in the name. Uploading the wrong file won’t cause anything bad to happen, it just won’t update.

@wizard - that’s really helpful info. Many thanks for taking the time to explain. I shall certainly give this a go. I have a standard PB v3 wired up to a test panel that I can use for this (350 LEDs mapped in 35 rows to look like a 2D Christmas tree).

1 Like

Bump. If you’ve given this a spin, I’d love to hear feedback, even if it’s just “yeah, no problems.”

And thank you to the folks that have commented already! Appreciate it!

1 Like