Announcement

Collapse
No announcement yet.

Heartbeat

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

    Heartbeat

    I have deployed an Arduino Mega and everything seems fine. However I have had some instances of the Mega being disconnected and I can't reconnect without rebooting the Mega. This is a problem because the Mega is in a remote location.

    I have been reading about using the Alive pin and also using a 555 timer that was pulsed from an event. My Mega is ethernet connected and running off a dedicated 5v supply. I can also control that power supply through Homeseer to reset the Mega.

    I am seeking a foolproof and automatic way of keeping the Mega going. I was thinking about toggling an output pin, feeding the output to an input pin, and periodically examining the input for the changes. This is a closed loop process. If anything happens to disrupt the Mega then Homeseer won't see the input changing.

    What have you all done and what are your experiences?

    -Rick

    #2
    i was going to do something similar but after the first month or so whatever bug was causing the issue was fixed and over the past few years i have never had one quit working so never bothered (i think i still have an event i made that with disconnect and reconnect it if the status isn't connected but i think that was also included in an update so i think it will automatically do that now)
    if you are having trouble you may want to try the builtin arduino watchdog reset (if it's the arduino that is freezing up) it is simple to add to the code and will reset it any time the processor freezes the down side is any time you change the sketch you will have to re-enter the code
    the keep alive pin may a easy option as well but you would need a bit of additional hardware '

    Comment


      #3
      Thanks for your comments. I will look into the Arduino reset. Right now I can ping the IP of the remote Arduino but I can't make the plugin connect. I would imagine the Arduino is alive if it is responding to pings. I don't think the ethernet shield is smart enough to respond to pings if the Arduino is hung. If it's not hung, why can't the plugin connect? All I did to cause the problem was reboot the computer after a Windows update. Locally I also have a NodeMCU with an LCD display networked to the remote Homseer site. I also had to power-cycle that after the reboot to get HS to connect again. Very strange.

      Comment


        #4
        Rick

        I too had connectivity issues and then things settled down. I am going to flash the MEGAs with later firmware and I suspect the issues will arise again. I plan to use an arduino nano as the reboot device, possibly something like a 5 minute timer on the nano and if it doesnt get reset it will power cycle the MEGA..

        I've found the software watchdog not to work reliably as you need to power cycle the network board for things to work.,

        What I think also helped is the Homeseer network sits on its own separate switch from the rest of my home network.

        Cheers..pete
        HS 2.2.0.11

        Comment


          #5
          I also had the same issue. Firstly, I would make sure you're using 1.0.0.142 of the plugin. Second, be sure you have a good power supply which can source the power required.

          Robert
          HS3PRO 3.0.0.500 as a Fire Daemon service, Windows 2016 Server Std Intel Core i5 PC HTPC Slim SFF 4GB, 120GB SSD drive, WLG800, RFXCom, TI103,NetCam, UltraNetcam3, BLBackup, CurrentCost 3P Rain8Net, MCsSprinker, HSTouch, Ademco Security plugin/AD2USB, JowiHue, various Oregon Scientific temp/humidity sensors, Z-Net, Zsmoke, Aeron Labs micro switches, Amazon Echo Dots, WS+, WD+ ... on and on.

          Comment


            #6
            Thanks Pete and Robert. All good thoughts. Yes my power supply is a reliable 5.0v supply at 2A and I am using 1.0.0.142. I was thinking exactly about the ethernet shield possibly requiring a power reset and not simply a board reset signal. I may revert to a USB connection to test reliability. I can still ping the IP of the remote Mega but I can't get HS to reconnect. Sometimes restarting HS can cause a reconnect but even that doesn't work this time. I'll have to wait until Christmas week to get back there. Ugh. Fortunately it's only monitoring non-critical statuses.

            I have another Mega on the bench now at home connected to the remote HS and blinking an LED. I plan to spend the next few weeks seeking how long it runs and how it reacts when it stops responding.

            Comment


              #7
              One more obvious thing - just checking of course, you've got auto connect set right?

              For myself I use a 12 v power supply @2 A. The on board regulator sets the proper voltage to the board.

              Edit: If on USB 5V works fine. However, if from a external power supply VIN pin of the board (7-12V). I remember having this same issue now...

              Robert
              Last edited by langenet; November 30, 2017, 10:30 PM.
              HS3PRO 3.0.0.500 as a Fire Daemon service, Windows 2016 Server Std Intel Core i5 PC HTPC Slim SFF 4GB, 120GB SSD drive, WLG800, RFXCom, TI103,NetCam, UltraNetcam3, BLBackup, CurrentCost 3P Rain8Net, MCsSprinker, HSTouch, Ademco Security plugin/AD2USB, JowiHue, various Oregon Scientific temp/humidity sensors, Z-Net, Zsmoke, Aeron Labs micro switches, Amazon Echo Dots, WS+, WD+ ... on and on.

              Comment


                #8
                Rick

                I tried the USB for a while and found it missed events if there were too many at the same time. I used to flip 16 relays in succession when I was testing via USB, it wasnt reliable. Move back to ethernet, solid as.

                I reckon you will need to power cycle the arduino, that was the only way I got it to work. I do reckon a Nano with a relay can easily be used to drop the power for a few seconds and let it restart.

                I'm using v131 of the plugin. I went through some rough patches as I was logging the disconnects in the log, I would see them randomly, rebooting HS made no difference what so ever.....then it all settled down. I did have a few times when the board stayed off line and I had to go power cycle the remote cabinet.

                AS I said my HS network is on its own switch and the whole thing has distributed UPSs on it. Last board reconnect was 17/09/2017
                8:37:32 PM. Its been solid since then.

                I know sometimes its challenging. Honestly it could be the quality of the clone ethernet board, I've tried various and touch wood, mine has all settled down and I'm loathe to change anything even though I want the functionality of the latter version.

                Cheers..pete
                HS 2.2.0.11

                Comment


                  #9
                  Use two timers on a separate board. Timer one runs for 2 minutes but is reset on every change of the alive pin. If timer one reaches two minutes (the alive pin is no longer changing indicating some kind of problem) timer two kicks in and disconnects power for 10 seconds. (Do not want to do a quick flash)

                  Additionally use an event that triggers on disconnect or failed boards and initiates a reset/reconnect.

                  Comment


                    #10
                    Thanks Guys. Interesting stuff. I set up a test Mega on the bench and ran into the problem of running it with a 5v supply, It ran fine when plugged into the computer's USB for programming but was acting strange on the power supply. Then I remembered about the onboard regulator and the ability to feed >5v to the Mega and that you really should. I have some 9v power packs that work great now and I can't remember if I used one at the remote site.

                    I am confused about the alive pin. I put an LED on this pin and watched it. When I unplug the ethernet the light comes on after a minute or so and it goes off after I reconnect. It does not seem to toggle like a heartbeat. So I am thinking if the Arduino crashes for some reason the alive pin will not change state. It seems to only tell you if the Arduino is connected and responding to the host and not if the Arduino is dead. If it's dead, how can it change state?

                    I think I would like to do two things. One is to use an event to toggle an Arduino output every 3 minutes or so and connect that pin to a 555 timer set to 5 mins. If the Arduino stops responding to the event for 5 minutes the 555 will push the reset button. Next I want to do something like a power control module on the Arduino power supply with another event looking at the Connected status of the Arduino with the plugin. This can also be used manually if ever needed. This should provide me with at least a 100% ability to get the board running remotely if not automatically.

                    Comment


                      #11
                      I use the API sketch so I have the flexibility to build my own logic. In my base app, I've built a heartbeat. Every 3 minutes each node will update a HS3 device corresponding to that node. That changes the timestamp. I have an event that runs for each node that looks at the timestamp of the heartbeat and if it is longer than 15 minutes, the event resets the node. I see this event run every once in a while mostly on my nodes that do not have the best wifi connectivity. I seldom have to do anything myself.

                      Comment


                        #12
                        yes i think you would want at least 7v power supply if you are using the built in regulator (barrel connector) you could use 5v if you use the usb port or the 5v pin but the regulator will drop the voltage a volt or two so if you only start with 5 you may be running a bit low

                        you are correct about the alive pin it is only there to let you know if the connection drops so won't help if it freezes

                        I think you are on track with a 555 timer and a output that blinks every few min but i think once you get it working you won't need it as i run Ethernet and usb arduino and they are one of the most reliable things on the system

                        Comment


                          #13
                          Thanks everyone for the feedback. Looks like I have a lot of good suggestions. I am bummed that I won't be at the remote location for two more weeks. Thanks for sharing your valuable experiences. -Rick

                          Comment


                            #14
                            I have had a test Mega on the bench connected to HS at a remote location for about three weeks with no disconnects or need to reboot. The Mega is powered through the power plug with a 6V 1A wall wart. The input voltage to the Mega under load is 7.6V which is great. The other voltages on the board are 5.01V and 3.3V. This is a good step as a best practice for reliability. Either feed the power plug with more than 5V or feed the 5V input directly with a good 5V regulated supply. -Rick

                            Comment


                              #15
                              Yeah.. been there myself. Again the spec for input power is 7-12v. Looks like you 6v in works.

                              https://www.arduino.cc/en/Products/Compare

                              Robert
                              HS3PRO 3.0.0.500 as a Fire Daemon service, Windows 2016 Server Std Intel Core i5 PC HTPC Slim SFF 4GB, 120GB SSD drive, WLG800, RFXCom, TI103,NetCam, UltraNetcam3, BLBackup, CurrentCost 3P Rain8Net, MCsSprinker, HSTouch, Ademco Security plugin/AD2USB, JowiHue, various Oregon Scientific temp/humidity sensors, Z-Net, Zsmoke, Aeron Labs micro switches, Amazon Echo Dots, WS+, WD+ ... on and on.

                              Comment

                              Working...
                              X