-
Would like to make my pc hardware in a plexiglass case with rgb fans. So am tinkering with a m5stick c plus with the fanset. Now i uploaded it with the webinstaller. That's going well until I connect to wifi. Once the m5stick gets an ip address the m5stick reboots. Could it be that dave devised this sketch so that no wifi is needed. And that is why the m5stick gets stressed out? Of course, I also uploaded the m5stick with platformio. Same story. If I turn off wifi, it goes fine. And it boots up and I can scroll through the effects with the remote or the button on the m5stick. Would be nice if wifi did work, and you could use the web server to scroll through the effects. But don't know if this is also possible with the fanset sketch? Another question to dave, the m5stick is (if I understand by some notes in the global sketch for the microphone) built into the pc cabinet. So how do you turn off the m5stick? Normally it turns off after holding down the power button for so many seconds. Am also tinkering with an esp32 devkit with a separate lcd screen. I already have this one running with the fanset sketch. I can just power this with the voltage from the pc power supply. And then as soon as I turn the pc off, the esp turns off as well. But am curious how dave powers off the m5stick. Because when I take mine off the power, it stays on until i press the button for a couple of secconds. Harrie Just tried to dissable the webserver and enable the wifi, now it does not reboot. So if i enable webserver, the m5stick keeps rebooting. |
Beta Was this translation helpful? Give feedback.
Replies: 8 comments 25 replies
-
@heidepiek The only way to get any meaningful indication of why the M5StickC Plus reboots is by looking at the debug logging; you could even do this in the Web Installer. My unconfirmed "educated guess" would be that the web server takes up too much memory while it tries to start, and causes a panic in the process. We recently disabled some stuff in the M5StickC Plus Spectrum project because it ran out of memory while trying to start the web server also. (That didn't actually reboot the device, but still.) But again, looking at the debug messages is the only way to be sure. |
Beta Was this translation helpful? Give feedback.
-
Try setting MAX_BUFFERS to 5 and see if that helps. Lower NUM_LEDS to a smaller number for testing if possible. If this fixes it, it's most certainly running low on memory. FWIW I'm using the M5 today on a project and had to turn off the webserver to get enough memory (but I'm trying for 28 buffers, which is a lot of memory). Robert was going to debug this after Christmas, I think, to see what's up. For now, mine seems pretty stable when it has 60K free when running. |
Beta Was this translation helpful? Give feedback.
-
BTW, I don't know what the NUM_LEDS is for FANSET, but I presume it'll be much shorter than the 144*8 max that might be the default. So if you've only got 300 LEDs to work with, make sure you adjust it down to that. |
Beta Was this translation helpful? Give feedback.
-
Is it possible to convert the fanset configuration from a m5stick to for example an esp s3 with more ram? So that it wil run with webserver enabled. |
Beta Was this translation helpful? Give feedback.
-
So I forgot one very obvious thing: reducing MAX_BUFFERS to the low-memory "default" value of 5. With that done, I am able to start Fanset with the web server enabled. I'll leave it running during the night to be sure it's stable, but already opened #573 to update the FANSET project configuration. |
Beta Was this translation helpful? Give feedback.
-
They stuck to their pattern of chewing up more memory than in the previous
releases.
They're not unique in this regard. On any given week, we add more code than
we remove ourselves.
again make the M5StickC Plus start crashing due to out-of-memory
Is m5stick unique in some way, or is this really "anything without PSRAM
that has a non-trivial effects configuration"?
I'm going to check now what happens with the Spectrum project - I can only
assume that's also unstable with current dependency versions. I'll update
the PR accordingly and merge it when ready.
The spectrum effects aren't skimpy on memory and mapping 768px isn't cheap.
On the same board, I'd expect a violent death. On a board with PSRAM, it's
likely happy; I ran rainbox with 2kpx on one data line not long ago. (Yes,
I understand but refresh limits. I didn't care for the task at hand.)
@heidepiek <https://github.com/heidepiek> You can try flashing your
M5SStickC Plus with Fanset in about an hour (noon our time) using the web
installer at
I just confirmed. StickCPlus has no PSRAM.
If we're unable to use the screen and/or the buttons anyway, what if you
just treat it like a base dev_esp32 device? I see it builds and links magic
libraries:
build_flags = -DUSE_SCREEN=1
-DM5STICKC=1
${base.build_flags}
lib_deps = ${base.lib_deps}
m5stack/M5StickC @ ^0.2.3
Try testing with
build_flags = -DM5STICKC=1
${base.build_flags}
lib_deps = ${base.lib_deps}
Maybe we have something like screen requesting buffers for the SPI (i2c?)
that we aren't even using.
I know, this makes your fancy $20 board into a dumb $5 board, but maybe we
can at least get a few more quarters out of it for you.
I'm not one to hold onto platforms after they're expired (i have no pity on
the guys trying to do 2,000 WS2812's on an 8266 and wondering why it flips
out during network I/O) but this still passes the approximate "seems like
it SHOULD work" test. 512MB and two 240Mhz 32-bit cores should be enough to
blink some lights.
I think we DO need to have some kind of a defined floor of "you NEED PSRAM
(I think that comes no smaller than 2MB on these)" that gives us some
breathing room so that every monthly PIO update isn't a death watch but it
also IS on my list to dig deeply into this. Maybe we have something dumb
fragmenting memory, or something that's not allowing adjacent block
reclamation (https://www.freertos.org/a00111.html) for example.
So I'm playing both sides of the fence:
1) We need a plan for some configurations to just not work.
2) Once we've reached our steady state, 50K of free RAM should be "enough".
(Boards where we don't have 50K? See #1)
My instinct says we have something weird and I plan to dig deeply into in
and take some steps to quantify our uses and needs. We may not be able to
do anything tangible about it, but at least we'll have charts and reasons.
Message ID:
… <PlummersSoftwareLLC/NightDriverStrip/repo-discussions/562/comments/7937257
@github.com>
|
Beta Was this translation helpful? Give feedback.
-
I just checked memory usage on a locally built Spectrum project. With MIN_BUFFERS and MAX_BUFFERS both set to 1 and WiFi, IR remote and the webserver enabled the M5StickC Plus seems to be running stable with free RAM hovering around 67K. I'll push my changes and test again with a Spectrum image flashed using the staging web installer. |
Beta Was this translation helpful? Give feedback.
-
After looking into the low memory situations we were seeing in various configurations - credits for the actual work relating to that go to @davepl - it seems we have a new situation when all dependencies are updated to their current versions using I have pushed a commit to my staging branch to update the staging Web Installer with the webserver-enabled Fanset configuration. @heidepiek Could you maybe try flashing Fanset using the staging Web Installer to confirm things work again for you as well? It's available here: https://rbergen.github.io/NightDriverStrip. |
Beta Was this translation helpful? Give feedback.
We actually didn't do anything wizardy yet - we just updated the project dependencies to their latest versions. We lost several tens of kilobytes of RAM to dependency updates in the past few months, and it seems we got a lot of that back with updates that took place in the past couple of days.
I did say no wizardry was done "yet" because @davepl managed to clear up another ~25K of RAM (on Mesmerizer at least) during an investigation of memory use that was triggered by the low-memory conditions we were seeing. Those changes should reach the main tree within the next few days and should give us a little more memory breathing room still.