PB3 won't go past loading screen, now stuck in wifi setup

I’ve gotten my PB v3 all set up and spent about a week learning to program it. Finally started to get some sound reactive programs last night that I was happy with, and this morning when I go to power everything up, I can’t connect to the wifi, so I hold the button to enter wifi setup mode.
After connecting to the Pixelblaze network that auto generates, regardless of PC, Mac, phone, browser, anything, it just is stuck in the loading cube forever. Does’t reset or turn off.

Ive tried LEDs plugged in, LEDs disconnected, USB powered (battery block, wall outlet, computer) , powered via 5v backfed from the lines.

If you probe the pads on the bottom, it’s getting consistent power and ground is solid.

All solder points have been checked and nothing changed in position between working last night and dead today.

1 Like

I should also note that it does light a pattern of my LED helix in yellow for a second or two when it powers up.

Hi @popcapps,
Sorry to hear it died on you.

Weird. This is the part where it would be sending the web page over and waiting for the websocket connection. It can take a few seconds to load sometimes, but it sounds like you’ve tried everything. Does the orange LED flash or change at all once you are connected?

Would you be up for a bit of troubleshooting, and attempt to fix it, or go for a replacement? If replacement, please email your order and address info to me at: wizard@electromage.com

We can try posting wifi info to it manually and update the firmware. If there’s a corrupted file, that should bring it back.

BTW in setup mode, it will flash a checker pattern on the LEDs briefly, thats normal. The orange status LED will also flash, then flash 3 times quickly before going to a solid dim level.

I’m so down to attempt to fix it! I’ll shoot you an email.

UPDATE: V3.18 addresses many of these issues

Read on for the old way of recovering from a corrupt web app


OK cool! I’ll post here in case others wander over with a similar issue, or folks are just curious.

In WiFi setup mode, the page will post to a an html form that sets things up. We can poke this manually with something like curl. If you have a Mac handy this should already be installed and you can run this in Terminal. I’m less well versed in Windows, but I know there’s a curl.exe for windows that should work similarly.

You’ll still need to be connected to the setup network, and you can close or move the capture popup out of the way. Open Terminal and run this, replacing out the MYWIFINETWORK and MYPASSPHRASE stuff for your wifi network info:

curl -i -d "mode=CLIENT&ssid=MYWIFINETWORK&passphrase=MYPASSPHRASE&discover=true" -X POST http://192.168.4.1/wifisave

That should connect, and if successful after a handful of seconds the configure network will disappear. You should now be back in client mode, but chances are whatever was preventing your wifi config screen from showing up is still happening but it should show up in the discovery service.

We can try pushing a firmware update to it, which should replace the main index page if that was causing problems.

Download the firmware for your variant:

Then visit the Pixelblaze’s IP address with /update added to the URL. There you can upload this file, and click update. It can take a few minutes to process.

Let me know if this works, or if you get stuck somewhere!

1 Like

So is it possible to push it to AP mode? That’s how I’d been connecting to it so far.

It does not like my fios router.

I believe it did respond to the curl command, as the setup wifi network disappeared, but it’s not a new thing that it wouldn’t connect in client mode to my existing network. For the sake of testing, if it can’t push AP, I will just go dig an old router out of a tote and set it up for the sake of science.

This is probably a noob question and if I had to guess, It’d be just changing client to AP in that command and inputting the username and password that you want the network to use, but it also might be way harder than that. This thing is my first real adventure into hardware like this, and certainly programming much of anything at all!

Oh, holy crap. The AP mode thing is that easy.

Unfortunately, it didn’t help. I got it to create its own network, with the name and password on it that I wanted, I was able to connect to that on my computer, and I was able to push a firmware update to it (it’s the standard one with a sensor board attachment), but it just does the same thing every time. It is able to communicate but just doesn’t load the page.

UPDATE: V3.18 addresses many of these issues

Read on for the old way …


Yep that easy!

Hmm. One more thing to try. Some updates have been having trouble with free space, and since your page is hosed anyway, we can try deleting it.

Try this (it will nuke the main web app file)

curl 'http://192.168.4.1/delete?path=/index.html.gz'

Then if you load the page you shouldn’t get the cube spinner at all. Then try applying the update again.

Hi @wizard - I spent an hour on a screen share with popcapps just now, and wanted to relay some of what I saw.

Since client mode has never worked for him (even back when his v3 was loading the patterns page just fine), he had the clever idea to just change CLIENT to AP in this:

curl -i -d "mode=AP&ssid=MYWIFINETWORK&passphrase=MYPASSPHRASE&discover=true" -X POST http://192.168.4.1/wifisave

What we were able to observe was that it would create the AP, allow the Windows computer “we” were on to connect, but would not assign an IP. No gateway was shown in ipconfig; the interface self-assigned an IP. Contrast this with when he held the button for 3 seconds. In that mode, the Pixelblaze_XXXXXXXX SSID was connecting and assigning him an IP fine.

From that working Pixelblaze_XXXXXX SSID, /update was redirecting to /?wifi. I also helped him compose a curl form-data POST to /update with the @v3.16.pb32.stfu, but that also returns the HTML with embedded window.location redirect.

Hopefully this delete trick will work out. I think you said future firmware will allow POST to /update from WiFi setup mode, right?

And @popcapps - I know you were concerned about recovering a pattern you put some effort into. The delete of index suggested in the latest shouldn’t affect your patterns.

Jeff, thanks for the comment about pattern safety! Made me feel a little better about sending a command like that. Also thanks for the zoom call. That was unexpected and super cool to try and work through the issue (and even weird that we managed to reproduce it on one of your devices)

OKAY! So we’re back in business. Deleting the index and pushing a firmware update seems to have brought it back.

I want to mention that the delete command wouldn’t work in the pre-installed version of curl in windows. I had to move back to a mac to run it. It was not happy with the http in it. I’ll upload a screenshot when I go back to that computer.

AND THANK YOU BOTH SO MUCH! This support has been amazing.

1 Like

Not that it matters to my experience, but I’m sharing because it seems strange, but it must have pushed the firmware update and installed correctly, but is still displaying v 3.11 on the top bar while I’m connected to it.

Yeah, “AP” is the right value. It’s CLIENT, AP, or SETUP.

Wow, that does sound pretty hosed. This sounds weird and close enough to the 2 “WiFi not saving” reports that makes me wonder if not only the html file was corrupted, but perhaps the nonvolatile memory stuff the ESP32’s use to store network settings. I might take the approach of nuking that whole part of flash when it’s put into setup mode.

— Just saw your post —

Glad it’s working! Wow, thanks @jeff, thats super cool.

I think perhaps it just reinstalled the web page, if the status bar shows 3.11, then the firmware part didn’t complete (it updates in 2 parts, the page then firmware), which is a bit odd! I know you tried all the different kinds of power to get it working, but I wonder if power issues could explain the initial corruption, what power were you using during update?

I’d export all of your patterns (less to worry about!) then I’d try disconnecting the LEDs, power via USB, and try running the update again. You wont cause any serious problems using the newer web app with an older firmware, but the new firmware has quite a few stability fixes that I’d recommend.

2 Likes

So status for the next day. Last night I ended up deleting every pattern from the device and trying the firmware update again. I successfully got it to accept 3.16 as it’s lord and firmware. At this point, I’ve added about 15 patterns back onto it, and one time it’s freaked out and forgotten that it had LEDs attached, what type and how many. The map was unaffected (and has been this whole time I just felt the need to include that). This PB3 has forgotten its pixels in this manner many many times.

Additionally, I’ve tried to set up a different router for it to connect to, in attempts to get it to function in client mode and test that out. Still not having any success in that route, either through curl or the wifi settings page. I’m not positive if it’s not connecting or what, and haven’t exhausted trying different settings on the router and whatnot. Is there a specific type of security or anything I should set it up as?
All my phones and computers can connect to the ‘CarlHost’ network I’m creating with no issue. Eventually I’ll have enough data and have tried it on enough networks to know if it’s just my stupidity or something weird in the device itself.

All in all, client mode isn’t going to be all that important to me, especially not in the short term. The pineapple that this contraption lives in is very mobile and It was a huge selling point to me that it can operate in AP mode.

I’m just psyched that this thing works again!

Also, as far as memory on the device goes, it seems that I’m very good at finding the limitation on that. How do I manage that better? Is it expandable? How much memory is it? Do I delete the comments from the patterns to save space? Is there a way to know how much space I’ve used at any given point? I see the memory readout in the top bar but that never really seems to change much for me.

I come from a world of video footage where terabytes are thrown around like hockey pucks and this world feels very strange to me. There’s probably close to 100tb of external hard drives on my desk as I write this.

I realize there’s a lot of rambling questions in there. I turn 33 in a couple days and there hasn’t been something in my life that I’ve understood so little about in a very long time and it’s exciting.

1 Like

@popcapps ,
I’m almost certain that your Pixelblaze is browning out due to low voltage, and is tripping one or more of the fail-safes. At 2 reboots it will skip loading a pattern, and at 3 reboots it will forget pixel settings (even in settings page) - but those are temporary unless you change a setting. Giving it a cold boot should bring everything back.

If it gets to 4, only then would it forget the map temporarily, and loading the tab would bring it back (unlike the settings tab).

At 5 it will go back in to setup mode.

When this happens next, would you poke into a hidden variable for me? The reset code is sent up to the browser in 3.16 but not displayed or used yet. I hope to add a brownout warning message in the future.

Open the page in a desktop browser, then open your browser developer console and enter this in the console:

lastStatus.rr0

Let me know what it is!

For storage, there’s enough for about 100 average patterns and the web app page, but only just so. I plan to rework updates in future versions so that it doesn’t need additional reserve space for a second temporary copy of the web app. Another factor is that I’ve discovered is that the filesystem has performance issues as it nears full, and can cause some things to time out.

How much are we talking? Almost as much storage as the save icon could store :floppy_disk:. The chips used in V3 Standard and Pico use 4MB flash, with 1.4MB of that carved out for patterns and the web app. The rest is needed by the firmware to allow updates (needs 2 copies of that too). While there are larger flash models available for the Standard’s form factor ESP32 module, thats the limit for the ESP32 Pico (without adding external memories). Definitely something I’m looking at for V4.

The next update will have a simple free storage space indicator in the UI on the saved patterns list. Also with the ability to update firmware in setup mode, I’m confident there would be a way to recover a botched upgrade, and will remove the old web app before writing the new one, which should mean requiring a lot less free space to update.

BTW, this is what it looks like when configuring client mode successfully:

wifi_setup

Where does it get stuck? What do you have your Wifi setup up like? It needs a 2.4GHz network, they still don’t make a 5GHz ESP32. WPA2 is the most common.

Also Happy Birthday!!!

I realize there’s a lot of rambling questions in there. I turn 33 in a couple days and there hasn’t been something in my life that I’ve understood so little about in a very long time and it’s exciting.

Welcome to the world of microcontrollers! Where every byte counts, and you are so close to the hardware you can count the electrons as they go past…

2 Likes

Does anybody else hear the LEDs?

Thanks! It was a really great one. Drank beers in a park and then went to a late night driving range and tried to hit an old car with golf balls. One for the books!

The process of events described there is 100% as it is happening to me. I’ve used this LED array (240 or so pixels in a helix) and Anker 20,000 mah battery pack (well, three of them in total (only one at a time, over the course of a weekend) with some other random smaller ones as backup) for coming up on four years now, off and on with either one or two usb power leads hard wired to a Pro Micro controller with no apparent power issues.

I’ve let it run for a few hours at a time since your request to check that variable, and every time my result has simply been ‘1’. I’m going to let it run overnight and see if I can get a different result!

I guess I hope I do to provide some sort of concrete evidence one way or another about power. Any time I’ve probed it, no matter how I’ve had it hooked up, I’ve gotten what I have to guess are good readings. Is there a specific voltage that is considered low? I’m kind of new to testing electronics, so I’m not sure if 4.85 and 4.98 volts is much of a difference. Or is it supposed to be exactly 5 and nothing but the truth?

As far as memory is concerned, this is just a whisper of a thought, but is it expandable at all? Not that I’m really in danger of writing a piece of code complex enough to really need it, but just a genuine curiosity. I’d guess that it was a sort of failure point removal choice to utilize the same memory space for standard or pico?

And on the front of the client mode setup, for either of the networks that I try to connect to in client mode, it will complete all of those steps, but I’m never able to connect to 192.168.4.1 on the network I’ve pointed it to after it completes this step and the setup wifi network disconnects/disappears. It’s likely not going to be an issue for me until I get further down this rabbit hole and get into syncing multiple of these up. I’d be willing to screen share an attempt at what’s happening there, or demonstrate my power setup to see if there’s anything that I’m doing wrong, but I won’t live under the expectation that every time I have a question, someone will just drop everything to look at it.

I’m here to try and actually learn not only just how to code, of which my last experience was making basic websites about BMXing in the early 2000’s, but also math, of which I’m learning I have essentially no understanding of (I somehow managed to mange it through high school and college never having taken anything more advanced than algebra). I can kind of dissect and play around with pieces of other people’s code, and I’ve learned countless tips and tricks from everybody’s almost excessive commenting (thank you all), but I feel completely overwhelmed with where to begin. I’ve had a friend come over a few times and we’ve managed to figure some basic ideas out, but it’s as close to button mashing as is possible in code form. Perhaps some of the coolest inventions have come from just simply asking, “…but what if we multiplied v times v…again?”

Seriously though, where do I begin? I know it’s mainly javascript, but even in that world there seems to be a lot of factions. And don’t even get me started with math! I had to call an electrical engineer to help me modify newscrewdriver’s glowflow helix map to fit mine, and when I asked another friend who’s a software developer at uber, he looked over a couple patterns I shared and told me that if I manage to learn and really understand the math involved, that I should go apply to work at google, and then explain it to him. I take that with kind of a grain of salt, understanding the coding universe is seemingly very collaborative and share much of their workings with others. The video editing world does not work this way and I really wish it did.

Hi @popcapps ,
Glad you had a good birthday, 1/3rd centenarian!

For Client Mode, where you connect PB to an existing WiFi network, you won’t access it with the 192.168.4.1 address. That’s only for AP Mode. In Client Mode your router gives it an IP address, and you can find it on the discovery service page.

Hmm, how about lastStatus.uptime/3600000 ? it should show the uptime in hours. When you notice things missing, is the uptime low like it had just restarted?

For power, this is very tricky because the period of time that can cause these resets can be very short. When Pixelblaze uses WiFi it can burst up to 600ma for a handful of milliseconds. If the power supply can’t keep up for that short window, it could cause a reset. It might read 5V on a multimeter, but a dip to 2V for a handful of milliseconds wouldn’t show up, you’d need an oscilloscope to see a dip that fast.

Power banks can go to sleep when power draw is low, or internal temperatures too high, which can also cause a reset.

I would add a large capacitor (several hundred uF at least) and see if that helps. Sometimes switched power supplies like those in USB battery packs can’t react to rapid changes in power draw fast enough, and a large capacitor can help with the small burst power needs.

Memory is not currently expandable with what exists today. It could be done, and something I’m looking at for future versions. It’s technically possible to do on an expander board, but the time and complexity to make that work probably isn’t worth it.

By the way, button mashing in code form is exactly what PB was made for, and a completely valid approach. Just look at the real time feedback, both in the editor as syntax errors, and the LEDs to see what your changes are doing. Keep the code in a valid state as much as possible, and make small changes iteratively so you won’t end up too far down a dead-end. Discovery and invention through quick trial and error is what it’s all about! Do that for a bit and you start to intuit what things will do and build up a set of “tools” you can use. Also reading code is harder than writing it. I’d play with the artistic side of LED coding once you have a basic setup working, plus it’s more rewarding.

1 Like

Ha! Well that seems pretty obvious now. I’ll check that out after work and confirm my ignorance to basic network administration…

I will also try this later!

I let it run overnight, and the battery is almost depleted now, and my result to that query was 16 and some very long decimal. So when left to it’s own devices, it seems to be okay, it’s probably just when I’m telling it to do something that makes no sense to someone with any idea of how to code.

I suppose as far as the learning aspect of it goes, I keep seeing Javascript light mentioned, and wondering if that’s just referring to the subset of javascript that you’ve allowed into the PB universe or if that’s a specific subset of javascript that I can look up and familiarize myself with syntax. I’m supposing that’s what you’ve defined below the pattern editor, but it’s mostly greek to me. A lot of it is written as “assuming you already know the entire universe of javascript, here are your limiting bounds” which is likely the case with the vast majority of people who pick one of these up with plans to create their own visualizations. I’m guessing the best answer in the long run, outside of the scope of this specific device, is to just buck up and put some time into learning the world of javascript.

I do keep running into something that I can’t seem to figure out, which is getting my 3D helix arrangement to work with any 2d patterns. It would be neat to get text scrolling working, just as a plane wrapped around a circle.

Here’s a screen shot of my map. It’s the glow flow map, which was where I initially found the PB, modified to show correctly on my smaller diameter helix (I think it’s 3.5")

Yeah, it’s a subset of JavaScript (or JS simplified perhaps). That is to say, syntactically it is ES6 / JavaScript, but functionally is missing many things that make JavaScript what it is.

It is not an official / common subset, this language was created for Pixelblaze. I would have used another language, but the real-time coding requirements meant that there wasn’t any existing compiler I could use. So I built one based on a JavaScript parser. As a language specification, it is easier to say it’s JavaScript light and list the limitations.

If you go learn JavaScript, you’ll learn about objects, prototype chains, and APIs (functions/objects) that don’t exist in Pixelblaze. Your “hello world” program will probably use text strings and console.log, both of which are absent from PB. Pixelblaze’s “hello world” is a rainbow. So it may not be immediately applicable, but once you start solving problems in JavaScript, that same thought process and at least some of the tools can be used in Pixelblaze.

If you forget “JavaScript” for a moment, there are some things that are common to several languages, and those are key for writing pattern code. Stuff like variables, expressions, functions, loops, and that sort of thing are common across many languages. In C-like languages like C, Java, JavaScript, etc., you have for and while loops, if for conditional code, curly braces for code blocks, array access with [] and that sort of thing in common.

The pixel mapper tool is different - that is real JavaScript and it runs only in the browser.

Without changing anything about your pixel map, you can get a wrapped 2D surface by converting the x,y coordinates into an angle. That does require some trig, but we’ve already done the work :slight_smile:

A while back I uploaded a pattern called “angle and radius from coordinates” to the pattern site. Here’s the relevant bit (updated for atan2)

//return the angle as a value between 0 and 1.0
//most of Pixelblaze's animation language uses this range
//it also happens to rotate the angle so that 0 is north
function getUnitAngle(x, y) {
  return (PI + atan2(x - .5, y - .5))/PI2 
}

This assumes your center point is at (0.5, 0.5), which it would be for your 3D helix. Pass in the X and Y from your render3D, and you get back a value from 0.0 to 1.0 based on the angle from that center. In other words, it’s a value that walks the circumference of your circle. Combine that with Z as the up-down dimension, and you have a 2D surface wrapped around your cylinder!