Announcement

Collapse
No announcement yet.

NodeMCU Connection Issues

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

    NodeMCU Connection Issues

    I have two boards, an Uno and a new esp8266 nodemcu, both set up as API. Ever since installing the beta version of the plugin (1.1.148) and setting up the new nodemcu board, I've been experiencing connection issues. The nodemcu board randomly disconnects and/or reconnects (even if it's not disconnected), approximately every hour or so. I'm also now losing connection to the Uno board, but much less frequently, whereas, prior to updating the plugin, the Uno had been pretty solid.

    When connected, both boards are working very well. The Uno monitors several door sensors and motion sensors, and the esp8266 monitors aquarium water temperature and room temperature and humidity (DS18B20 and DHT11). I've set up both sketches to only report when values change, so as not to flood the plugin with data. Additionally, the nodemcu sketch will only send data to the HS plugin at most, every 2 seconds. As per the plugin instructions, this is accomplished with a timer, not a delay. There are no delays in my sketch.

    The connection issues are a bit curious. With the esp8266, I have an OLED display attached, which displays the same info that I am sending to HS, updated at the same 2 second interval. I also have a line that displays connection status, based on the state of the 'isConnected' variable in the sketch. However, the OLED display and the HS displayed status do not always agree. Sometimes, both will display 'Connected', but data will not update. Other times, one might show 'Disconnected' while the other remains 'Connected'. In some cases (and I don't recall exactly which cases), one may display 'Disconnected' but data is still updated. Sometimes the plugin will reconnect after a minute or two, other times not, requiring a manual resetting of the board.

    I've read other threads suggesting there are some connection issues with the plugin that are being worked on. I post my issues here to see if my issues are already known or are different. Also, is there any prediction on when an update will be released that might address these issues?

    Thanks,
    Mike

    HS3 Pro Edition 3.0.0.435 (Windows)
    Arduino Plugin 1.0.0.148
    Arduino IDE 1.8.1
    APIBoard1 - Uno
    APIBoard2 - esp8266




    #2
    I had connection issues with my NodeMCU's for years. I have around 12-14 8266 boards in my system. My solution was to migrate them all to MQTT. There is a pretty steep learning curve involved, but I have NO connection issues after migration. There are 2 MQTT plugins. I use the one from McSharry which has very good documentation. One downside, you might have to give up the arduino and replace it with a NodeMCU or other 8266 board. I am not sure that the mqtt library(pubsub) supports the arduino. And lastly, if you have plans to add any on-off smart switches to your system, you can use the Sonoff boards($6 at Amazon) along with Tasmota client sketch. No coding at all for the client. It is set up though it's web interface once installed.

    Comment


      #3
      Originally posted by jimbell View Post
      I had connection issues with my NodeMCU's for years. I have around 12-14 8266 boards in my system.
      With the enigmatheatre plugin?

      Mike


      Comment


        #4
        No, the McSharry MQTT plugin.

        https://forums.homeseer.com/forum/li...chael-mcsharry

        Comment


          #5
          Originally posted by jimbell View Post
          No, I meant did your problems occur with the enigmatheatre arduino plugin?

          Mike

          Comment


            #6
            Yes, my problems were all with the arduino plugin. Over the years, I felt that the plugin was never "bullet proof" and had unexplained "dropouts" which seemed to be completely random. I lived with these problems for years. After discovering and implementing MQTT, as far as I know, there have been no dropouts. MQTT works completely differently from the arduino plugin. There is no "connection". The plugin listens for MQTT messages and then reacts to them. Or it sends MQTT messages and the device reacts to them. I purchased the arduino plugin years ago and started using it around 3 years ago. I have been using the MQTT plugin for about a year now and I could not be happier. In response to the above question, I was under the impression that the only arduino plugin was the one from enigmatheatre.

            Comment


              #7
              I got impatient fighting the connection issues and moved my nodemcu board over to MQTT. Definitely a bit of a learning curve getting in, but very stable now. Thanks, Jim.

              Mike

              Comment


                #8
                I just have two NodeMCUs one does motion detection and the other runs an LCD and a switch input to toggle a lamp. I took care of my connection issues by looping an output to an input then setting the output to blink with an interval of five seconds. Only once in the last three or four weeks i had to disable/enable the plugin to reconnect the boards after my router randomly rebooted itself.

                Comment


                  #9
                  What's the theory behind the looping for connection issues?

                  Mike

                  Comment


                    #10
                    I had the first one with the motion detector set up that way to see how things were working and just left it that way, I had good luck with it staying connected. When I added the second board with only the LCD it was super flakey so I added the input-output loop and it hasn't missed a beat. When I first connected the LCD I figured it was causing a bunch of interference and it is still maybe but it is working good now. My theory was that it keeps the connection alive with traffic or it maybe just a coincidence, I'm no expert I am using the built in sketches but I'm going to try a temp sensor with the API soon.
                    Mike

                    Comment

                    Working...
                    X