Anybody else seeing - unstable nodes - Need restart every ~24-48 hours?
-
Hi,
I built a small home automation setup based on ago controller on a Raspberry pi with a serial gateway.
I have 3 nodes and they all work fine after being plugged in and continue for a while but after 24-48 they stop working.
If I unplug and plug back in they come back to life. I haven't been able to debug as the restart that comes with trying makes them work fine.
At first I though the issue was with the build quality (I solder like a butcher) but I added a temp/humidity sensor on a bread board with good Arduino and am seeing the same issues.
Anybody seeing something like this?
Any ideas how to debug?
Thanks
Joey
-
I had a node with similar behavior. In my case I found that the radio got to high voltage so the radio caused the hole node to freeze.
Most problems are usually related to power supply so I would start the investigation there.
-
Running out of memory - that's the problem for most of programs/nodes.
I have this problem in one too, so I made a code to restart node every x hours.
-
I have this on a number of nodes using different power supplies. I have measured the voltage in to the radio arduino. I also have have a decoupling capacitor of 4.7uF across the radio's 3.3V and GND.
While it could be a mem leak if that is the case it in the mysensor lib as my sketch is pretty basic and should be using constant memory .
-
The library does not use any dynamic allocation. So I doubt it it a memory leak situation.
-
@Joey-Edelstein said:
I have this on a number of nodes using different power supplies. I have measured the voltage in to the radio arduino. I also have have a decoupling capacitor of 4.7uF across the radio's 3.3V and GND.
While it could be a mem leak if that is the case it in the mysensor lib as my sketch is pretty basic and should be using constant memory .Try a large cap, try 47uf
-
@Joey-Edelstein try posting a code here so we can look better, maybe it's one of libraries?
or interrupt? or something...
-
This is the simplest sketch I'm using that is demonstrating the behavior I described:
https://codebender.cc/sketch:103465
-
Have a look here. Remove all Serial.print(...) and Serial.println(...) and try again. Or use Serial.print(F(....)).
-
@HarryDutch said:
Serial.println(...) and try again. Or use Serial.print(F(....)).
interesting. I will give it a try. Thanks!
-
Just a thought here but if Serial.print("This string that gets allocated every time this is called") and basically is a memory leak shouldn't samples be updated to use Serial.print(F(....)) so the unwashed masses (like me) don't make stupid mistakes?
In the meantime I have updated my most accessible node and will see if this solves my issues.
-
The normal Serial.println() using char-array does not leak memory. The F()-version just uses less of the precious RAM by keeping the strings in flash.
So the F() is really good to use, especially if you're sketch is big.
-
Maybe you can setup a RF sniffer as seen here http://forum.mysensors.org/topic/242/wireless-nrf24l01-sniffer-for-mysensors and observe what traffic you see when the system or node fails to give you some clues as to what is going on ?