[Solved] MySensors 2.0 Ethernet gateway (ENC28J60) restart / IP issue
-
@intellium As far as I can tell. It looks like your Arduino is continuously resetting itself. It should not repeat the first log you've posted.
This can be caused by some reasons:
- A write operation to a memory location where it shouldn't be writing. I've experienced this last weekend why I used an strcpy wrongly. But since you're using tested software this is not likely.
- The circuit isn't getting enough power. And the Arduino resets itself.
how does your circuit looks like?
@TheoL The circuit not getting enough power was something I ran into way before my current issues :)
Currently, the nano is feeding the RF24 module on the 3.3v line and the ENC28J60 module is fed from a separate 5v line.It's connected as depicted in the ethernet gateway setup Ethernet gateway - Wiring things up. This same setup works fine with a simple test sketch for the ENC module.
I'm using the Arduino IDE 1.6.11 and the UIPEthernet library (v1.09) from here : Github - UIPEthernet
Does this info help ?
-
@TheoL The circuit not getting enough power was something I ran into way before my current issues :)
Currently, the nano is feeding the RF24 module on the 3.3v line and the ENC28J60 module is fed from a separate 5v line.It's connected as depicted in the ethernet gateway setup Ethernet gateway - Wiring things up. This same setup works fine with a simple test sketch for the ENC module.
I'm using the Arduino IDE 1.6.11 and the UIPEthernet library (v1.09) from here : Github - UIPEthernet
Does this info help ?
@intellium I'm no expert. But does the simple example work when everything is connected (radio and LED's)?
-
@intellium I'm no expert. But does the simple example work when everything is connected (radio and LED's)?
-
@TheoL Yeah, it's exactly the same setup (hardware wise). Has to be something in the software part (MySensors / UIPEthernet) thats not working correctly.
Does anybody have a working setup using MySensors 2.0 Gateway with an ENC28J60 module ?
@intellium Maybe @mfalkvidd ?
-
@TheoL Yeah, it's exactly the same setup (hardware wise). Has to be something in the software part (MySensors / UIPEthernet) thats not working correctly.
Does anybody have a working setup using MySensors 2.0 Gateway with an ENC28J60 module ?
@intellium with w5100 we currently face an issue, causing the arduino to reset, caused by a bug in the avr gcc tool chain.
Until fixed in the tool chain and adopted by arduino there is not much more than trial and error to see if it runs stable. Reverting arduino ide won't help either, because this bug has been in for a long time.
I'm not saying this is what is happening to you, but it just might. -
@intellium with w5100 we currently face an issue, causing the arduino to reset, caused by a bug in the avr gcc tool chain.
Until fixed in the tool chain and adopted by arduino there is not much more than trial and error to see if it runs stable. Reverting arduino ide won't help either, because this bug has been in for a long time.
I'm not saying this is what is happening to you, but it just might. -
@TheoL Yeah, it's exactly the same setup (hardware wise). Has to be something in the software part (MySensors / UIPEthernet) thats not working correctly.
Does anybody have a working setup using MySensors 2.0 Gateway with an ENC28J60 module ?
-
@intellium The avr toolchain bug is related to variadic arguments used for debug prints. If you comment MY_DEBUG, do you still have the issue?
-
@tekka You sir, are my new best friend :)
Sure enough, disabling the debug and uploading the code seems to make everything work. The gateway outputs the correct IP and is now pingable !
-
@tekka You sir, are my new best friend :)
Sure enough, disabling the debug and uploading the code seems to make everything work. The gateway outputs the correct IP and is now pingable !
@intellium @Tekka is actually the best friend for most of us ;-)
-
@intellium @Tekka is actually the best friend for most of us ;-)
-
May have spoken to soon....
Although the gateway now runs, after a few mins it seems to die. LAN leds keep blinking everything seems in order, but it's not pingable anymore and Domoticz starts logging messages that the gateway is unreachable. Is this somehow related? Or is this a whole different issue?
@tekka probably knows what to do, right? :D
-
May have spoken to soon....
Although the gateway now runs, after a few mins it seems to die. LAN leds keep blinking everything seems in order, but it's not pingable anymore and Domoticz starts logging messages that the gateway is unreachable. Is this somehow related? Or is this a whole different issue?
@tekka probably knows what to do, right? :D
-
@intellium can you add a serial print in loop() to see if the GW or the lan module freezes?
@tekka Sorry it took a while.
I gave it a try, but ever since adding print statements to the gateway loop(), the sensor nodes stopped communicating with it given FPAR failures. Even when I remove the print statements and return to the previous state, it keeps on giving FPAR failures on all sensor nodes... What would cause this ?
-
@tekka Sorry it took a while.
I gave it a try, but ever since adding print statements to the gateway loop(), the sensor nodes stopped communicating with it given FPAR failures. Even when I remove the print statements and return to the previous state, it keeps on giving FPAR failures on all sensor nodes... What would cause this ?
-
@intellium hmm, hard to diagnose without additional information - could be power-related. Can you add a better/stronger power-supply?
@tekka Before I go the route of messing with the power supply, I did some fiddling...
I added the following statements to both the gateway and the sensor sketches:
//LOW POWER MODE RADIO #define MY_RF24_PA_LEVEL RF24_PA_LOW //DEBUG FOR RADIO #define MY_DEBUG_VERBOSE_RF24 //RADIO THROUGHPUT #define MY_RF24_DATARATE RF24_1MBPSNext I put them a little bit closer together (around 80cm apart). The FPAR:FAIL message are gone now. I see in the output on the Sensor node that it communicates with the gateway. Currently, the gateway is running with this setup and the controller (Domoticz) gets values. So this seems to be working OK.
However, on the sensor node, the log sometimes indicates an error. Something like this :
RF24:write register, reg=0, value=14 RF24:open writing pipe, recipient=0 RF24:write register, reg=10, value=0 RF24:write register, reg=16, value=0 RF24:send message to 0, len=12 RF24:flushTX RF24:write register, reg=7, value=48 RF24:MAX_RT RF24:flushTX RF24:start listening RF24:write register, reg=0, value=15 RF24:write register, reg=10, value=1 !TSP:MSG:SEND 1-1-0-0 s=1,c=1,t=0,pt=7,l=5,sg=0,ft=4,st=fail:29.0 T: 29.00 RF24:write register, reg=0, value=12 RF24:power down RF24:write register, reg=0, value=12 RF24:power down RF24:stop listening RF24:write register, reg=0, value=14 RF24:open writing pipe, recipient=0 RF24:write register, reg=10, value=0 RF24:write register, reg=16, value=0 RF24:send message to 0, len=12 RF24:flushTX RF24:write register, reg=7, value=48 RF24:start listening RF24:write register, reg=0, value=15 RF24:write register, reg=10, value=1 TSP:MSG:SEND 1-1-0-0 s=0,c=1,t=1,pt=7,l=5,sg=0,ft=5,st=ok:36.0 H: 36.00 RF24:write register, reg=0, value=12 RF24:power downFrom what I've read, the st:fail means there was an error transmitting the value. Could this still be power related ? It seems so intermittent to me that my gut tells me power isn't the issue.
-
@tekka Next I tried is adding a capacitor to both the gateway and node RF module. I added a 10uF capacitor to both of them. This seems to have stabilized RF communication. I'm not seeing any failures anymore and data is flowing...
Back to the original issue... The gateway that seems to die...
I've added some debug statements to the loop() to see if this would keep on running when the gateway seemingly dies.
After 2 hours of operation, the gateway stopped responding to pings, and the controller also noticed the gateway was not alive anymore. When this happens, the output of the serial console is :New loop iteration: 21734 New loop iteration: 21735 New loop iteration: 21736 New loop iteration: 21737 New loop iteration: 21738 New loop iteration: 21739 New loop iteration: 21740 New loop iteration: 21741 New loop iteration: 21742 New loop iteration: 21743 New loop iteration: 21744As you can see, my loop code keeps on running at this point, suggesting it's just the ENC interface thats no longer reachable or has an issue. When I close and re-open the serial port monitor from the Arduino IDE, the gateway springs back to life and everything starts working again.
-
@intellium Issues with ENC: https://forum.arduino.cc/index.php?topic=398258.0
sounds pretty much the same...
-
@intellium Issues with ENC: https://forum.arduino.cc/index.php?topic=398258.0
sounds pretty much the same...