Announcement

Collapse
No announcement yet.

NodeMCU API - Loosing connection, plugin restart required?

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    NodeMCU API - Loosing connection, plugin restart required?

    Hi all, I have a few NodeMCU's (API mode) reporting back sensor data and they have been rock solid for months now, I have one board that I'm using as a listening device, using the LoRa RadioHead library here : https://www.airspayce.com/mikem/ardu...ead/index.html

    The sending client which is running on a Moteino M0 has not missed a beat, but after a few hours ish running well, the NodeMCU keeps restarting every 3 minutes and that loop doesn't stop until i restart the HS Arduino plugin, i have removed all delays in the code so the only delay could be introduced by the RF library, any ideas what is causing the reboot ?

    Board 4 with IP 10.0.0.153 is the board i'm having issues with.

    I have attached the debug log, also here is a few loops of the board reconnecting.

    Click image for larger version

Name:	board4.PNG
Views:	176
Size:	44.1 KB
ID:	1388959

    Many thanks,
    Mike

    #2
    I've had some nodeMCUs get flakey also. Replacing the chip usually fixes it. Also, if you are at the edge of your wifi network, it can exhibit same symptoms. I have events that test for board status and does a reset if need be. I've also added a heartbeat from each board so I can tell if they are not communicating. The heartbeat is also tested in the events. Between all these, I never have to do anything to keep them running.

    Comment


      #3
      Originally posted by logbuilder View Post
      I've had some nodeMCUs get flakey also. Replacing the chip usually fixes it. Also, if you are at the edge of your wifi network, it can exhibit same symptoms. I have events that test for board status and does a reset if need be. I've also added a heartbeat from each board so I can tell if they are not communicating. The heartbeat is also tested in the events. Between all these, I never have to do anything to keep them running.
      Thanks, I will certainly try another chip, the board is right next to an access point, network connectivity doesn't seem to be an issue. Looking at the debug logs, looks like there is already a type of heartbeat built into the plugin, so I've not done too much with adding additional events/scripts, I did have events to restart the NodeMCU's when some of their sensors didn't update for a few hours but this didn't seem to fix the issue, the whole plugin needed to be restarted for the sensors to start updating the pins again.

      Comment


        #4
        Just changed the board out, and as soon as it reset the same thing is happening, every 3 minutes, I have just restarted the Arduino plugin to see if that sticks.

        UPDATE: Unfortunately I am still seeing dropouts every 3 minutes from this one board.

        Comment


          #5
          looking at the debug I see no data from board 4. Can you post your sketch you uploaded to the board?
          Zwave = Z-Stick, 3xHSM100� 7xACT ZDM230, 1xEverspring SM103, 2xACT HomePro ZRP210.
          X10 = CM12U, 2xAM12, 1xAW10, 1 x TM13U, 1xMS13, 2xHR10, 2xSS13
          Other Hardware = ADI Ocelot + secu16, Global Cache GC100, RFXtrx433, 3 x Foscams.
          Plugings = RFXcom, ActiveBackup, Applied Digital Ocelot, BLDeviceMatrix, BLGarbage, BLLAN, Current Cost, Global Cache GC100,HSTouch Android, HSTouch Server, HSTouch Server Unlimited, NetCAM, PowerTrigger, SageWebcamXP, SqueezeBox, X10 CM11A/CM12U.
          Scripts =
          Various

          Comment


            #6
            Just a datapoint - in running this plugin for a very long time with wifi connected nodeMCUs, restarting the plugin has not been needed to resolve problems.

            Comment


              #7
              Originally posted by enigmatheatre View Post
              looking at the debug I see no data from board 4. Can you post your sketch you uploaded to the board?
              I have made a few adjustments in the LoRa RF communications, to reduce potential delays in the loop. so far i've not seen any issues, i will certainly report back if issues begin occurring again. is there anything in your code that would cause a reboot every 3 minutes, or is that just the 90 seconds i've seen mentioned on previous threads ?

              Comment


                #8
                Originally posted by mikesnook View Post

                I have made a few adjustments in the LoRa RF communications, to reduce potential delays in the loop. so far i've not seen any issues, i will certainly report back if issues begin occurring again. is there anything in your code that would cause a reboot every 3 minutes, or is that just the 90 seconds i've seen mentioned on previous threads ?
                Yes there is code to try and reset the board from the plugin every 3min if there is a problem. If you flood the plugin with info it can sometimes cause this.

                Greig.
                Zwave = Z-Stick, 3xHSM100� 7xACT ZDM230, 1xEverspring SM103, 2xACT HomePro ZRP210.
                X10 = CM12U, 2xAM12, 1xAW10, 1 x TM13U, 1xMS13, 2xHR10, 2xSS13
                Other Hardware = ADI Ocelot + secu16, Global Cache GC100, RFXtrx433, 3 x Foscams.
                Plugings = RFXcom, ActiveBackup, Applied Digital Ocelot, BLDeviceMatrix, BLGarbage, BLLAN, Current Cost, Global Cache GC100,HSTouch Android, HSTouch Server, HSTouch Server Unlimited, NetCAM, PowerTrigger, SageWebcamXP, SqueezeBox, X10 CM11A/CM12U.
                Scripts =
                Various

                Comment


                  #9
                  Originally posted by enigmatheatre View Post

                  Yes there is code to try and reset the board from the plugin every 3min if there is a problem. If you flood the plugin with info it can sometimes cause this.

                  Greig.
                  Thanks Greig, so the board started rebooting again, I added a Serial.println("rebooting..") into the resetFunc and sure enough its being called every time it restarts, i commented out the esp.restart() and it seems to continue without issue, that i can see

                  When you say 'flood the plugin' would the following be too much, should I be adding longer delays between the sendToHS lines ? If i don't have any delays at all, it actually misses updating the last few devices in HS, in this example it would probably not update 28,29 and 30.

                  Code:
                  SendToHS(21,myData.Value1); // Sensor Client 3 - client addr
                  SendToHS(22,driver.lastRssi());// Sensor Client 3 - last rssi
                  SendToHS(23,myData.Value5); // Sensor Client 3 - batt
                  delay(10);
                  SendToHS(24,driver.lastSNR()); // Sensor Client 3 - lastSNR
                  SendToHS(25,myData.Value7); // Sensor Client 3 - counter attempted
                  delay(10);
                  SendToHS(26,myData.Value8); // Sensor Client 3 - counter successsendack
                  SendToHS(27,myData.Value9); // Sensor Client 3 - counter failedsend
                  delay(10);
                  SendToHS(28,myData.Value10); // Sensor Client 3 - counter failedsendnoack
                  SendToHS(29,myData.Value13); // Sensor Client 3 - Soil Temp
                  SendToHS(30,myData.Value12); // Sensor Client 3 - Soil Moisture
                  Thanks for your responses and the great plugin!

                  Cheers,
                  Mike

                  Comment


                    #10
                    The problem might be that the delays but I can not be sure. The plugin sends an alive check and the delay could be causing it to miss them.
                    By flood the plugin if you send data to the plugin on each loop then that is a lot if data. What I do is store the last sent data on the board then only send it if it has changed value. How often is the data sent to the plugin?
                    Zwave = Z-Stick, 3xHSM100� 7xACT ZDM230, 1xEverspring SM103, 2xACT HomePro ZRP210.
                    X10 = CM12U, 2xAM12, 1xAW10, 1 x TM13U, 1xMS13, 2xHR10, 2xSS13
                    Other Hardware = ADI Ocelot + secu16, Global Cache GC100, RFXtrx433, 3 x Foscams.
                    Plugings = RFXcom, ActiveBackup, Applied Digital Ocelot, BLDeviceMatrix, BLGarbage, BLLAN, Current Cost, Global Cache GC100,HSTouch Android, HSTouch Server, HSTouch Server Unlimited, NetCAM, PowerTrigger, SageWebcamXP, SqueezeBox, X10 CM11A/CM12U.
                    Scripts =
                    Various

                    Comment


                      #11
                      Originally posted by enigmatheatre View Post
                      The problem might be that the delays but I can not be sure. The plugin sends an alive check and the delay could be causing it to miss them.
                      By flood the plugin if you send data to the plugin on each loop then that is a lot if data. What I do is store the last sent data on the board then only send it if it has changed value. How often is the data sent to the plugin?
                      Its only sent once every 10 minutes or 1 every hour depending on battery level of the RF sensor client, so I guess i cant be flooding the plugin with that.

                      Comment


                        #12
                        Greig, still having these restarts, even with a blank default sketch generated from the plugin for this board, it looks like the board is receiving decimal 114 on Byte2 which is 'r' reset, any ideas on why the plugin is always telling this board to reset ?

                        Update: I have now createdd a new nodemcu api board in the plugin and no restarts since, regarding the mac address section in the plugin what is this used for, does it need to be unique and or match the nodemcu boards actual mac on it's nic ?

                        Comment

                        Working...
                        X