Announcement

Collapse
No announcement yet.

Arduino Disconnects + Reconnects

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

    #16
    It could be the refreshing of LCD data. I use an input and output on every board for testing purposes. I connect an output pin to an input pin. Then I turn the output on with an Event. A second Event looks for the input to change. If the input doesn’t go high with the output other events will send a message or perform a reset depending on a counter that is incremented each time the test fails. This cycle is repeated every 3 minutes for each board. I do not use any other inputs or outputs on the NodeMCU.

    Just for data, I’ll setup a test NodeMCU with only inputs and outputs and see what happens. The three NodeMCU boards I removed from the system were using outputs controlling three relays each, in addition to the test input and output.
    HS4 Pro, 4.2.19.16 Windows 10 pro, Supermicro LP Xeon

    Comment


      #17
      Originally posted by rprade View Post
      It could be the refreshing of LCD data. I use an input and output on every board for testing purposes. I connect an output pin to an input pin. Then I turn the output on with an Event. A second Event looks for the input to change. If the input doesn’t go high with the output other events will send a message or perform a reset depending on a counter that is incremented each time the test fails. This cycle is repeated every 3 minutes for each board. I do not use any other inputs or outputs on the NodeMCU.

      Just for data, I’ll setup a test NodeMCU with only inputs and outputs and see what happens. The three NodeMCU boards I removed from the system were using outputs controlling three relays each, in addition to the test input and output.
      Ah ok that makes sense....it may be that the reset monitoring that you run resolves the problem when only needing the LCD. The trouble I had was that the outputs would go high every time it reset for around 20 seconds so anything I was switching would go live every 90 seconds when the plugin did it's auto reset.

      It would be great to see what your test produced if you do get a chance.

      Thanks ever so much for offering to test .

      Best wishes,

      Jay

      Comment


        #18
        Well, I did find something interesting, but I have not yet figured out what is going on.
        • I added a new NodeMCU board. It connected and stayed connected
        • I noticed the blue LED on the board was not lit. This LED should light when pin 4 is off (low)
        • Then I configured pin 4 as an output, toggled it on then back off and the blue Led was lit
          • It is possible that pin 4 floats until it is specifically directed to be on or off, I don't know. Looking at my other two boards, they do not have it lit eaiter. This could indicate a problem since HomeSeer sees the output as low, but the onboard LED does not. I measured pin 4 at 3.3V. This would prove it is logic high, despite the HS device showing it as off.
          • I added a pin 4 to one of my LCD production boards and it also only lights the LED after it has been connected for 2-4 minutes, though the LCD is updated immediately
        • Then I added test pins - D6 as an output and D7 as an output and shorted them together. They are also at 3.3V while showing pin 6 as off in the device manager. I can toggle the pin 6 output in the Device manager and nothing happens. The pin voltage stays at 3.3V and (of course) the input pin stays high
        • Then I found that the blue LED on the board does come on after attempting to control the D4 output. It does seem to light on its own after 2-5 minutes
        • The output on pin 6 goes low as soon as the LED is lit and after it is lit, the input in the device manager tracks with the output
        • It takes about 30-60 seconds for the board to show a connection problem after it is disconnected from power
        • It takes about 5-10 seconds to show as connected when power is restored
        • Then I added pin 5 as an input and neither input would reflect its correct status in the device manager.
        • I disconnected the board from power for long enough to show a connection error, then reconnected it until it was connected. I toggled pin 4 to get the LED lit
        • Controlling either output was not reflected in their inputs and resulted in a Connection Failed on the test board
        • I deleted pin 3 and the board immediately reconnected.and the pin 7 input started responding
        • I added pin 3 as an input again, but it does not reflect any voltage change in the HS device. I connected it to pin 4 and it did not reflect the state of pin 4 until about 2 minutes later
        • Now I can toggle either output and see it reflected in the connected input and the board is staying connected
        I am heading out for dinner now and will continue testing when I get home. It did seem that connection errors start happening as soon as I added the 4th pin. It did not happen again when adding the 4th pin for a second time.

        There is definitely a delay in the board pins synchronizing with the HS devices when it is first connected.


        HS4 Pro, 4.2.19.16 Windows 10 pro, Supermicro LP Xeon

        Comment


          #19
          After we got home from dinner, the NodeMCU had remained connected, now for 3 hours. Both of the inputs are not working, but the outputs are. This is interesting, because the board was completely inactive while we were gone. As I was writing this post, the inputs started working again. I will leave them on a slow blink and see if they keep working.

          There are no errors in the log since I left for dinner, but looking back earlier today when I started experimenting with the test board, there are 41 errors, mostly to do with the test board #5. However it is interesting to see that it brought down other boards when it acted up at 12:50PM.
          Code:
          Aug-25 2:42:27 PM         Arduino Plugin    Error = Board: 5 Connection FAILED.
          Aug-25 2:41:55 PM         Arduino Plugin    Warning = Board: 5 has a connection ERROR. Trying Reset.
          Aug-25 2:41:13 PM         Arduino Plugin    Warning = Board: 5 has a connection ERROR. Retrying.
          Aug-25 2:25:22 PM         Arduino Plugin    Error = Board: 5 Connection FAILED.
          Aug-25 2:25:07 PM         Arduino Plugin    Warning = Board: 5 has a connection ERROR. Trying Reset.
          Aug-25 2:24:52 PM         Arduino Plugin    Warning = Board: 5 has a connection ERROR. Retrying.
          Aug-25 2:20:54 PM         Arduino Plugin    Error = Board: 5 Connection FAILED.
          Aug-25 2:20:38 PM         Arduino Plugin    Warning = Board: 5 has a connection ERROR. Trying Reset.
          Aug-25 2:20:23 PM         Arduino Plugin    Warning = Board: 5 has a connection ERROR. Retrying.
          Aug-25 2:15:56 PM         Arduino Plugin    Error = Board: 5 Connection FAILED.
          Aug-25 2:15:41 PM         Arduino Plugin    Warning = Board: 5 has a connection ERROR. Trying Reset.
          Aug-25 2:15:25 PM         Arduino Plugin    Warning = Board: 5 has a connection ERROR. Retrying.
          Aug-25 1:44:54 PM         Arduino Plugin    Error = Board: 5 Connection FAILED.
          Aug-25 1:44:39 PM         Arduino Plugin    Warning = Board: 5 has a connection ERROR. Trying Reset.
          Aug-25 1:44:24 PM         Arduino Plugin    Warning = Board: 5 has a connection ERROR. Retrying.
          Aug-25 1:20:03 PM         Arduino Plugin    Error = Board: 5 Connection FAILED.
          Aug-25 1:19:48 PM         Arduino Plugin    Warning = Board: 5 has a connection ERROR. Trying Reset.
          Aug-25 1:19:33 PM         Arduino Plugin    Warning = Board: 5 has a connection ERROR. Retrying.
          Aug-25 1:15:13 PM         Arduino Plugin    Error = Exception in SendToPort : Index was outside the bounds of the array.
          Aug-25 12:50:27 PM         Arduino Plugin    Error = Board: 2 Connection FAILED.
          Aug-25 12:50:23 PM         Arduino Plugin    Error = Board: 1 Connection FAILED.
          Aug-25 12:50:23 PM         Arduino Plugin    Error = Board: 3 Connection FAILED.
          Aug-25 12:50:12 PM         Arduino Plugin    Warning = Board: 2 has a connection ERROR. Trying Reset.
          Aug-25 12:50:10 PM         Arduino Plugin    Error = Board: 4 Connection FAILED.
          Aug-25 12:50:08 PM         Arduino Plugin    Warning = Board: 3 has a connection ERROR. Trying Reset.
          Aug-25 12:50:08 PM         Arduino Plugin    Warning = Board: 1 has a connection ERROR. Trying Reset.
          Aug-25 12:49:57 PM         Arduino Plugin    Warning = Board: 2 has a connection ERROR. Retrying.
          Aug-25 12:49:55 PM         Arduino Plugin    Warning = Board: 4 has a connection ERROR. Trying Reset.
          Aug-25 12:49:53 PM         Arduino Plugin    Warning = Board: 3 has a connection ERROR. Retrying.
          Aug-25 12:49:53 PM         Arduino Plugin    Warning = Board: 1 has a connection ERROR. Retrying.
          Aug-25 12:49:44 PM         Arduino Plugin    Error = Board: 5 Connection FAILED.
          Aug-25 12:49:40 PM         Arduino Plugin    Warning = Board: 4 has a connection ERROR. Retrying.
          Aug-25 12:49:29 PM         Arduino Plugin    Warning = Board: 5 has a connection ERROR. Trying Reset.
          Aug-25 12:49:14 PM         Arduino Plugin    Warning = Board: 5 has a connection ERROR. Retrying.
          Aug-25 12:18:57 PM         Arduino Plugin    Error = Board: 5 Connection FAILED.
          Aug-25 12:18:17 PM         Arduino Plugin    Warning = Board: 5 has a connection ERROR. Trying Reset.
          Aug-25 12:18:02 PM         Arduino Plugin    Warning = Board: 5 has a connection ERROR. Retrying.
          Aug-25 12:16:43 PM         Arduino Plugin    Error = Exception in SendToPort : Index was outside the bounds of the array.
          Aug-25 12:14:23 PM         Arduino Plugin    Warning = Board: 5 has a connection ERROR. Trying Reset.
          Aug-25 12:14:08 PM         Arduino Plugin    Warning = Board: 5 has a connection ERROR. Retrying.
          Aug-25 12:09:21 PM         Arduino Plugin    Error = Exception in AddInput : Index was outside the bounds of the array.
          It also causes socket errors with the Envisalink module for my security system
          Code:
          Aug-25 12:50:36 PM         EnvisaLink    ERROR Receiver::Run() A socket error has occured: Unable to read data from the transport connection: An existing connection was forcibly closed by the remote host.
          Aug-25 12:50:25 PM         EnvisaLink    ERROR Receiver::Run() A socket error has occured: Unable to read data from the transport connection: An existing connection was forcibly closed by the remote host.
          Aug-25 12:50:14 PM         EnvisaLink    ERROR Receiver::Run() A socket error has occured: Unable to read data from the transport connection: An existing connection was forcibly closed by the remote host.
          Aug-25 12:50:03 PM         EnvisaLink    ERROR Receiver::Run() A socket error has occured: Unable to read data from the transport connection: An existing connection was forcibly closed by the remote host.
          Aug-25 12:49:52 PM         EnvisaLink    ERROR Receiver::Run() A socket error has occured: Unable to read data from the transport connection: An existing connection was forcibly closed by the remote host.
          Aug-25 12:49:41 PM         EnvisaLink    ERROR Receiver::Run() A socket error has occured: Unable to read data from the transport connection: An existing connection was forcibly closed by the remote host.
          Aug-25 12:49:30 PM         EnvisaLink    ERROR Receiver::Run() A socket error has occured: Unable to read data from the transport connection: An existing connection was forcibly closed by the remote host.
          Aug-25 12:49:19 PM         EnvisaLink    ERROR Receiver::Run() A socket error has occured: Unable to read data from the transport connection: An existing connection was forcibly closed by the remote host.
          Aug-25 12:49:11 PM         EnvisaLink    ERROR A socket operation was attempted to an unreachable network 192.168.2.19:4025
          Aug-25 12:49:07 PM         EnvisaLink    ERROR A socket operation was attempted to an unreachable network 192.168.2.19:4025
          Aug-25 12:49:05 PM         EnvisaLink    ERROR A socket operation was attempted to an unreachable network 192.168.2.19:4025
          Aug-25 12:48:54 PM         EnvisaLink    ERROR Receiver::Run() A socket error has occured: Unable to read data from the transport connection: An existing connection was forcibly closed by the remote host.
          Aug-25 12:48:43 PM         EnvisaLink    ERROR Receiver::Run() A socket error has occured: Unable to read data from the transport connection: An existing connection was forcibly closed by the remote host.
          Aug-25 12:48:32 PM         EnvisaLink    ERROR Receiver::Run() A socket error has occured: Unable to read data from the transport connection: An existing connection was forcibly closed by the remote host.
          Aug-25 12:48:21 PM         EnvisaLink    ERROR Receiver::Run() A socket error has occured: Unable to read data from the transport connection: An established connection was aborted by the software in your host machine.
          This is especially interesting because the Envisalink is the first device to complain whenever the network is in distress. This would indicate that the NodeMCU is doing some bad stuff with the network. Other than the errors today while I was experimenting, there are no other Envisalink errors in the 14 days of log I retain. I searched back in UltraLog and found the last Envisalink error to be on May 1.

          I will continue testing tomorrow and see if I can find any way to narrow the problems down.
          HS4 Pro, 4.2.19.16 Windows 10 pro, Supermicro LP Xeon

          Comment


            #20
            Top man !! Thanks !! It’s nice to at least know it’s not something that I’ve done !

            Cheers,

            Jay

            Comment


              #21
              I have not been able to get the board to act up again. It has remained connected since 2:44 PM yesterday with no logged errors. I have now added a second board and it is working without a hitch. It connects within about 5 seconds of being powered and so far has remained connected.

              The only issue that is repeatable is while it only takes a few seconds to connect, it is 2-3 minutes before output pins settle to match the HS value of Off - they start out high. If they are controlled by HS they will sync up. The inputs also seem to have the same delay before they will respond.

              There is another thing that is not repeatable - it only happens some of the time. For my testing, I am using pin 4 as an output and pin 3 as an input. I use a jumper between the pins so that I can see the state of the output reflected in the input. Several times I got a Connection Failed right at the point where the output starts working about 2-3 minutes in. If I disconnect/reconnect the power, the board will connect and work. Once I had a board connect, stay connected, but the inputs were never reporting. I disconnected/reconnected and they began working. Unfortunately I have not been able to get it to happen again to test if it will cure itself.

              I have been testing both boards for a couple of hours today without any other significant issues other than the slowness to start working after connection. I will let both of them run today and see if I can find anything else.
              HS4 Pro, 4.2.19.16 Windows 10 pro, Supermicro LP Xeon

              Comment


                #22
                Originally posted by rprade View Post
                I have not been able to get the board to act up again. It has remained connected since 2:44 PM yesterday with no logged errors. I have now added a second board and it is working without a hitch. It connects within about 5 seconds of being powered and so far has remained connected.

                The only issue that is repeatable is while it only takes a few seconds to connect, it is 2-3 minutes before output pins settle to match the HS value of Off - they start out high. If they are controlled by HS they will sync up. The inputs also seem to have the same delay before they will respond.

                There is another thing that is not repeatable - it only happens some of the time. For my testing, I am using pin 4 as an output and pin 3 as an input. I use a jumper between the pins so that I can see the state of the output reflected in the input. Several times I got a Connection Failed right at the point where the output starts working about 2-3 minutes in. If I disconnect/reconnect the power, the board will connect and work. Once I had a board connect, stay connected, but the inputs were never reporting. I disconnected/reconnected and they began working. Unfortunately I have not been able to get it to happen again to test if it will cure itself.

                I have been testing both boards for a couple of hours today without any other significant issues other than the slowness to start working after connection. I will let both of them run today and see if I can find anything else.
                that is how my lcd on a nodemcu behaved also. since the first day when it was connecting and reconnecting it has not even once misbehaved. been solid since it got over whatever it's problem was the first day. since then I added another lcd/nodemcu without even one problem... I appreciate greatly all your testing, Thanks Randy!

                Comment


                  #23
                  The two test boards (board 5 and 6) have been running without issue since yesterday. No disconnects or errors. You can see that all 8 boards are fine since I rebooted yesterday at 3:18. I installed a new beta HS so I had to restart.

                  Click image for larger version  Name:	Capture.PNG Views:	1 Size:	80.1 KB ID:	1243955

                  I left both of the outputs on board 5 to Off and on Board 6 to Blink, one at a 2 second rate and the other at a 3 second rate. As I wrote above on both boards each Output is tied to an Input. That way I can see that everything is working while testing. Board 6 was still working this morning. This morning I set both of the outputs to Blink: on board 5. The input tied to output 6 was working, the one tied to output 4 was not. I also noted that the blue LED on board 5 was blinking, indicating the output was working. I further confirmed that input 3 (tied to output 4) was bad by touching it to 3v and to ground - it never changed state. You can see in this screenshot the times I set the outputs to blink and that input 3 has not changed since yesterday

                  Click image for larger version  Name:	Capture1.PNG Views:	1 Size:	45.9 KB ID:	1243956

                  While I still have not found anything conclusive, I can confirm that the inputs are not reliable. I am also still seeing a 2.3 minute delay in reflecting input state on both boards after connecting. A reset seems to cause the same issue - the board immediately reconnects, but the inputs and outputs do not start working for 2-3 minutes. Here is a screenshot where I reset the board with the input on pin 7 high. I reset the board and immediately removed the connection from pin 7. As you can see the board connected at 12:31:48, but the state of the input was not correct until 12:34:25.

                  Click image for larger version  Name:	Capture2.PNG Views:	1 Size:	17.0 KB ID:	1243957

                  I will continue testing and try to find something repeatable.
                  HS4 Pro, 4.2.19.16 Windows 10 pro, Supermicro LP Xeon

                  Comment


                    #24
                    Randy

                    I've seen issues similar on my Mega board. I have one specific input that I use to open our front gate.....grounding an input turns on an output....again this morning pressing the button saw no output change though it "queued the event". It seemed to queue 2 button presses and then turned on the output twice.....no board disconnects on this board.

                    I'll turn on the debugging to see whats going on....
                    HS 2.2.0.11

                    Comment


                      #25
                      Two more days of poking and prodding, changing inputs and outputs, turning outputs on and off and testing inputs and not one disconnect or error. Boards 5, 6, 8, and 9 are NodeMCU.

                      Click image for larger version  Name:	Capture.PNG Views:	1 Size:	82.0 KB ID:	1244385
                      HS4 Pro, 4.2.19.16 Windows 10 pro, Supermicro LP Xeon

                      Comment


                        #26
                        I use Arduino mega 2560 and shield ethernet and considering that in the past everything went well I stayed at version 1.0.0.85 but for some time and unfortunately I can not say precisely how long I have noticed that the arduous board disconnects continuously and only with a programmed event I impose him to reconnect but this sometimes causes a problem of reading the windows opening state and if it rains this could be a problem. Do you believe that the problem is solved by updating the plugin to the latest version 1.0.0.131? I enclose a screenshot derived from the monitoring of the connections of the arduino board through the plugin "device history". Thanks

                        Massimo-RenderCAD
                        _______________
                        HomeSeer Version: HS3 Pro Edition 3.0.0.442 Operating System: Microsoft Windows 7 Professional - Work Station
                        Enabled Plug-Ins
                        3.0.0.29: ADIO-100
                        1.0.0.85: Arduino Plugin
                        2.0.59.0: BLBackup
                        2.0.3.0: BLDatabase
                        2.0.5.0: BLVolume
                        0.0.0.43: Current Cost 3P
                        0.0.0.3: Device Comparison 3P
                        1.3.4.0: Device History
                        3.0.0.48: EasyTrigger
                        5.0.0.58: Global Cache Pro
                        3.0.0.14: NetCAM
                        3.0.1.109: PHLocation
                        1.0.0.7: Restart
                        3.0.0.21: VWS
                        3.0.1.190: Z-Wave
                        Attached Files

                        Comment


                          #27
                          I am running 1.0.0.148 and mine have not shown a disconnect in weeks. As you can see in the screenshot above that all of the devices have been online since the last reboot 3 days earlier on 8/26. The screenshot was taken on 8/29.

                          The rhythm on yours is very steady most of the time it seems to be 1 minute in your graph. I would try the beta (1.0.0.148) first, because there were a bunch of connection fixes since .85. There were some fixes from .130 to .148
                          HS4 Pro, 4.2.19.16 Windows 10 pro, Supermicro LP Xeon

                          Comment


                            #28
                            I have update the plugin to 1.0.0.148 (boards still on 1.0.0.145) and the stability for the NodeMCU has improved significantly. Over the last 5 days I have not seen any spontaneous restarts.

                            One thing I did notice (not sure if it is related to the new PI version, need to do some more troubleshooting), writing text to the LCD from an event seems to be giving trouble. I have 1 event that updates the 4 lines of the LCD if a device change (temp sensor) happens and I created a second event that writes text to all lines of the display and is triggered by another device change (doorbell).

                            I noticed the second event does work as it should, sometime I need to fire it 2-3 times to get all the text on all 4 lines.
                            - I disabled the first event --> same behavior
                            - I inserted a clear all lines before writing --> ended up with a empty lcd.

                            It might be timing, not sure.

                            One additional thing to mention. The first event uses static text and only a few characters change when the event is triggered. This evenet could be showing the same behavior but it goes by unnoticed.

                            Anybody seen this before?

                            Comment

                            Working...
                            X