-
Notifications
You must be signed in to change notification settings - Fork 101
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
root user and all network connections to the Raspberry "freeze" after POSTing a file to express server while ws281x-animation is running. #87
Comments
Hey there, you absolutely deserve a 🥇🏆for the most detailed bug reported here yet! The error-message ( Some more things you can try:
Would you mind joining me in our slack (https://livejs-slackin.herokuapp.com/) so we can chat about this? I'm happy to help debugging this issue, but I'm a bit out of Ideas right now. Having a real-time conversation would probably help.. |
Hi, Sure! I'll try both of your suggestions and will also join your channel to report back :-) |
Hi, First of all I have to say I appreciate all the work that is being put into this module. I can only join the choir here - much appreciated indeed! As for the issue, I have been experiencing similar symptoms to the ones described by the OP, but haven't been able to track down the issue yet either (btw, updating to Node.js 8.12 doesn't seem to improve things). May I ask though, how fast is your animation running? (i.e. interval in msecs between frames, or frames per second). @usefulthink, any recommendations here? (nb. this said, I tried decreasing one of my animations from 20 to 100 msec between updates, but that didn't seem to help; the Zero becomes unresponsive but the animation continues. EDIT: If you wait longer, the animation eventually freezes as well.). Work-in-progress in case you want to check it out yourselves: https://github.com/xoblite/HAP-NodeJS-accessories (see Unicorn_pHAT_accessory.js) Thanks again, BR//Karl-Henrik |
After some more testing (including running the same code via Pimoroni's python library and managing heavy load at the same time) I can pretty much confirm the issue is somewhere in the library; possibly in the default (i.e. unspecified / passed on) init settings. What's interesting is that a few, low pps of network traffic is OK, but more than that and it freezes. Could it be a DMA conflict again perhaps? For reference, Pimoroni uses the following init options in their Python library for Unicorn HAT/pHAT; note e.g. the use of DMA channel 10:
Will dig around a bit more and see if I can pin down the issue, though the (old branched upstream?) selection of DMA channel looks like a candidate at this point (cf. other reports on DMA vs RPi3B+?). Still on the master branch btw, tested on both Node.js 8.11.x and 8.12.0, Raspberry Pi Zero W (i.e. BCM2835 based) with Pimoroni Unicorn pHAT. Any thoughts? By the way, how could/should other init params be passed to the library? (haven't had time to digest the upstream yet ;) ) Any related aspects of possibly switching to the 1.0 branch? BR//Karl-Henrik |
Update: Tried changing the default DMA channel (i.e. DEFAULT_DMANUM) in rpi-ws281x.cc to 10 and recompiling, and everything seems to be working like a charm now (running Node.js, Prometheus, Redis server+benchmark, sudo apt-get update and frequently hitting my own HTTP server code at the same time, seemingly no issues, so far at least ;D ). @HerrZatacke, would it be possible for you to confirm on your side as well? (nb. you need to install node-gyp to recompile the rpi_ws281x.node binding) Update Oct 6th: After quite extensive testing and really pushing the limits (hehe), I can confirm that the system is still rock solid following the change of DMA channel as per above. @usefulthink, given that this can be considered quite a serious issue on both the RPi 3B+ and 0W - which is also the current model of each product - I propose a change to DMA channel 10 also on master (i.e. rpi-ws281x.cc row 19), do you agree? I can of course pull a one-liner myself, but figured you may want to put something in e.g. the readme as well; let me know otherwise. Thanks! |
Hello, I am having the exact same problem. Could you please give a detailed description on how to change the DMA channel, how to recompile and all the steps needed to get this working? |
@Profe66er:
I'll try... (I had never done it before either, but I think this is the correct workflow)
Clear as mud? ;) ...let me know otherwise. BR//Karl-Henrik |
Thank a lot. Very helpful. Im on RPI 3B+ and I was trying to run a Spotify api program while running the neopixle server but the neopixle server kept on crashing. I was using a Ws2812B too. It all seems to work now but Ill do some more testing. |
@HerrZatacke @Profe66er Any updates? |
Duh I wish I found this issue last week when I ran into the same problem. My scenario was that I was using my Pi as a WiFi AP (using the built in WiFi chip on wlan0), connecting my phone to it to control the LED strip. It froze every time I tried to serve a static HTML file from the Express. However, I solved the issue by reversing the connection logic - my phone was set to an AP mode and Pi was connected to it (although I have to point out that it was connected using a USB WiFi dongle on wlan1) - then everything worked just fine. |
Added the possibility to configure driver initialization parameters, as the default DMA channel (5) used by upstream will cause serious networking issues on (at least) RPi Zero W, 3B+ and 3A+, see e.g. beyondscreen/node-rpi-ws281x-native#87 .
After putting the same type of pHAT on my Raspberry Pi 3A+ I can confirm that the DMA 5 issue applies to this model as well, and that it's solved by changing the DMA channel to 10 as per above. FYI, another way (read: perhaps useful beyond waiting for the DMA change specifically to happen upstream) to address this, that I now use myself in my code, is to pass the modified input parameters to the driver as part of the init call:
@usefulthink Any update on the subject? Will you pull this one yourself, or do you want me to do it? (nb. the change to DMA channel 10 was committed to upstream by jgarff exactly a year ago today) |
Im experiencing similar 'freezing' issues. Im using my RPI as a network bridge. Running an animation for an extended period of time kills hostapd and seems to freeze up the system. EDIT: Chaning dmaNum to 10 seems to have solved this issue for me 😄 |
I think we should at least update the |
@usefulthink Any update on the subject? Will you pull this one yourself, or do you want me to do it? (nb. the change to DMA channel 10 was committed to upstream by jgarff a very long time ago) |
Hi there,
First of all I have to say I appreciate all the work that is being put into this module.
I have a strange issue with this library in combination with express (the node http server) where it seems the root-user kind of "gets locked" or "freezes" and all network connections seem to die until the next restart after POSTing a file to an express-server running on the Raspberry.
I'll try to give a very detailed description even if some of the following information might be irrelevant.
If there's anything I can do to dig further into this issue, let me know (I think i have high knowledge of the node.js universe, but bindings totally scare me ;-)
My Setup
v8.11.3
installed like this https://www.w3schools.com/nodejs/nodejs_raspberrypi.asp6.1.0
The error
sudo
commands (used via a local console) do not work.ping: sendmsg: Kein Hauptspeicher für den Puffer verfügbar
(see more console output below)ps -A
returns: (run aspi
assudo ps -A
does not work - see the console output below)pi
-user (Mouse moves, Keyboard works - that's how i couldping
andps -A
) except for "reboot" or similar "root"-tasks (which forces me to kill the Raspberry by cutting the power)Detailed output for "ping 8.8.8.8"
Detailed output for "ps -A"
How to reproduce the error
npm i
sudo npm run ws281x
starts the animationnpm run express
starts the very simple webserverhttp://[IP]:3000
!
-button (this starts the upload)What else I have tried:
v1.x
-branch and incorporated the changes noted here - Same error ocurrednpm run express
- No Freezes here.npm run ws281x
- No Freezes (and no animation, duh ;))What I have not tried:
If you think any of this might help, I'll be happy to try these.
The text was updated successfully, but these errors were encountered: