Skip to content
  • MySensors
  • OpenHardware.io
  • Categories
  • Recent
  • Tags
  • Popular
Skins
  • Light
  • Brite
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Brand Logo
  1. Home
  2. Troubleshooting
  3. [solved] RS485 nodes stop sending data after some hours or days

[solved] RS485 nodes stop sending data after some hours or days

Scheduled Pinned Locked Moved Troubleshooting
74 Posts 11 Posters 19.1k Views 18 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • nofoxN nofox

    @sineverba I have some problems with my RS485 sensors too. They working for few days like a charm and than one of them stops sending and receiving data. Most of the time it happend when I click button and relay switch the light. My wiring is ok, i have pull-ups and pulldowns in the middle on master and termination on both ends. I have watchdog enabled

    void before()
    {    
    
    wdt_disable(); // maybe redundant
    wdt_enable(WDTO_8S);
    // sensors.begin();
    
    }
    

    But even with that the node won't reboot so i think it may not hangs and only lost communication. Maybe its something wrong with AltSoftSerial lib ??

    I should mention that I'm using OneButton lib to extend functionality of my pushbuttons for long press and double click. Maybe that library have some issues with AltSoftSerial or MySensors ?

    gohanG Offline
    gohanG Offline
    gohan
    Mod
    wrote on last edited by gohan
    #26

    @nofox try to remove code as much as you can. Does it still work if you operate it with the button? Is relay opto isolated?

    nofoxN 1 Reply Last reply
    0
    • gohanG gohan

      @nofox try to remove code as much as you can. Does it still work if you operate it with the button? Is relay opto isolated?

      nofoxN Offline
      nofoxN Offline
      nofox
      wrote on last edited by nofox
      #27

      @gohan No I can't operate it with button. Relays are not optoisolated, i don't isolate them because my node board are powered by 5V and i can't provide external power only for relays.

      1 Reply Last reply
      0
      • gohanG Offline
        gohanG Offline
        gohan
        Mod
        wrote on last edited by
        #28

        I know that turning on and off loads can generate emi that arduino doesn't like. Maybe you could try with an optocoupler between arduino and the relay

        1 Reply Last reply
        0
        • K Offline
          K Offline
          kimot
          wrote on last edited by
          #29

          Check position of nodes on the bus to in failure conditions.
          With RS485 bus drivers is easy possible for one node to block communication on entire bus sending dominant state.
          In this situation, nodes near the gateway can "push" their messages to the gateway, other nodes not.

          1 Reply Last reply
          0
          • gohanG Offline
            gohanG Offline
            gohan
            Mod
            wrote on last edited by
            #30

            How do you determine the bus failure?

            1 Reply Last reply
            0
            • nofoxN Offline
              nofoxN Offline
              nofox
              wrote on last edited by
              #31

              Hi! Everything working pretty well, but sometimes some random node stops to communicate and react for pressing buttons. I have watchdogs in every nodes so I think that only communication is hanging.. Is it possible that only altsoftserial library hanging inside arduino code ??

              1 Reply Last reply
              0
              • rejoe2R Offline
                rejoe2R Offline
                rejoe2
                wrote on last edited by
                #32

                As I could nail down some more parts (but still do not have a reliably network), also a short update from my side:

                • Node_1 (Multi DS18B20 (*12@three pins) + other things) is the biggest troublemaker. It just pulled the Voltage between a+b to +2.8V after some time. There is some hours of delay between the last messages and the node stopping also the pir functionality (no wdt code implemented).
                • Node_2 (also Multi DS18B20 (*5@three pins) and other stuff) also stopps communication after some time (it originally worked, this may be related to whatever change happened in between). But this one doesn't kill the entire bus communication and seems to work internally (switches relay on in case a rise of temperature is detected). This also holds my pullpup+pulldown-resistors for RS485.

                Yesterday I switched over Node_1 to use HW_SERIAL, as I also suspected altsoftserial to be part of the root causes. At first sight this seems to improve things a lot.
                Next, I will review Node_2 for the use of HW_SERIAL.

                What I have in mind (may not be correct):

                • HW_SERIAL uses less memory. So this may prevent the node to have some kind of overflow
                • there may be an conflict in internal timers, as 1wire may also need a timer (I use amongst others also PIN10 for 1wire).

                Controller: FHEM; MySensors: 2.3.1, RS485,nRF24,RFM69, serial Gateways

                1 Reply Last reply
                1
                • nofoxN Offline
                  nofoxN Offline
                  nofox
                  wrote on last edited by
                  #33

                  There is one thing that we all need to try. When you using RS485 than you have power supply somewhere far far away from nodes. Longer power lines means higher inductance and far more noise on power lines. I think we need to try to put some 10 - 100uF electrolitic cap on all nodes (i have 10uF on each node) and few ceramic 100nF near the microprocessor on every node. If you use atmega328p you need at least 3 of 100nF caps ( i forget to put them on my nodes). I’we read that this 100nF caps are very big improvement in power supplying the atmega.

                  1 Reply Last reply
                  0
                  • S Offline
                    S Offline
                    Stefan_NE
                    wrote on last edited by
                    #34

                    Hi to all,

                    i have the same problem since i changes some node to RS485. Setup
                    Fhem 5.8
                    Mysensors 2.2rc1
                    Gateway Arduino Nano USB to Fhem.
                    Nodes 5PC all Ardunino MiniPro; Energymeter, Relay,Temp DS18B20

                    What I found out is, the nodes are not hanging. There is no communication to the gateway. Reboot the node does not help. After a reboot of the node pairing does not work.
                    Reconnect the gateway to Fhen does not help.
                    AFhem restart works ( shudown restart). After the restart all nodes are appearing them self.

                    Today I will build a new gateway, using ESP8266 and RS485.
                    I have used USB gateway before, with several problems. After i changes the gateway for NFR24 and RFM69 from USB to ESP8266 most of the problems are gone.

                    I hope this will work. If not RS485 ist history and for this case Myssensors will be exchanges to 1-Wire.

                    It takes one or two days to get the first results.

                    Have a good day

                    Stefan

                    rejoe2R 1 Reply Last reply
                    0
                    • S Stefan_NE

                      Hi to all,

                      i have the same problem since i changes some node to RS485. Setup
                      Fhem 5.8
                      Mysensors 2.2rc1
                      Gateway Arduino Nano USB to Fhem.
                      Nodes 5PC all Ardunino MiniPro; Energymeter, Relay,Temp DS18B20

                      What I found out is, the nodes are not hanging. There is no communication to the gateway. Reboot the node does not help. After a reboot of the node pairing does not work.
                      Reconnect the gateway to Fhen does not help.
                      AFhem restart works ( shudown restart). After the restart all nodes are appearing them self.

                      Today I will build a new gateway, using ESP8266 and RS485.
                      I have used USB gateway before, with several problems. After i changes the gateway for NFR24 and RFM69 from USB to ESP8266 most of the problems are gone.

                      I hope this will work. If not RS485 ist history and for this case Myssensors will be exchanges to 1-Wire.

                      It takes one or two days to get the first results.

                      Have a good day

                      Stefan

                      rejoe2R Offline
                      rejoe2R Offline
                      rejoe2
                      wrote on last edited by
                      #35

                      @Stefan_NE
                      Strange, imo using a serial GW is the most reliable option. (May be different in case the nano is a bad fake and problems with CH340G-nanos are also reported in VM environments.

                      Are all nodes reffering to the korrect IO and how is the RS485-WG defined?
                      Explanation: I also use a second GW and in some cases nodes are assigned to the wrong GW. If you use several /dev/ttyUSBx-defines, the IO may not be functional. See output of "ls -l /dev/serial/by-id".

                      Most likely there is a electrical problem on your bus. Did you measure voltages, esp. between A+B? What type of modules or pcb's do you use?

                      Controller: FHEM; MySensors: 2.3.1, RS485,nRF24,RFM69, serial Gateways

                      1 Reply Last reply
                      0
                      • S Offline
                        S Offline
                        Stefan_NE
                        wrote on last edited by
                        #36

                        @rejoe2
                        good idea, that's what is thought meanwile, and i setup a serial gateway with an original Arduino Mega using hardware serial for the rs485. This is running now for 90 min. Let's see what happens. The serial gateway is the only one i use. All other nodes gateway are using wireless gateways.

                        1 Reply Last reply
                        0
                        • rejoe2R Offline
                          rejoe2R Offline
                          rejoe2
                          wrote on last edited by
                          #37

                          If you have more than one MySensors-GW's defined, imo it doesn't matter what type they are. Under some circumstances, nodes may be routed through the "wrong" GW. I would recommend to check that first (may be irritating, but even with the wrong GW assinged as IO, some readings are nevertheless updated when node is reset (presentation info)).
                          Hardware serial is a good idea, but at least according to my personal experience (and opposite to my estimations in the beginning) my (FTDI-Nano-) GW is one of the most reliable parts in my MySensors-RS485-environment.
                          Node_2 - my "troublemaker Nr. 1" - also performs reliably now (running without issues since 5+ days) since switched to HW-serial. But also a altsoftserial-Node with BME280 works at the same level of reliability for several weeks now (with less free memory left!) .
                          Powering issues and capacitors may also be helpful as @nofox suggested. I may do some tests wrt this after switching to HW-serial for Node_2 in case it's still not performing as expected.

                          Last: What modules do you use? In case of the LC-Tech ones, I would recommend to desolder at least the 120Ohm resistor on the "middle" nodes.

                          Controller: FHEM; MySensors: 2.3.1, RS485,nRF24,RFM69, serial Gateways

                          1 Reply Last reply
                          0
                          • S Offline
                            S Offline
                            Stefan_NE
                            wrote on last edited by
                            #38

                            New status:
                            the serial gateway based on the Arduino Mega with HW Serial failed after 27 hours. Same way to fix. I needed to restart FHEM and all nodes started working without any reboot e.g.
                            I don't think about any bus problem.
                            Next try is the gateway with an esp8266. Setup is done and all nodes are online. The major difference is the serial buffer of 256 bytes.
                            Since i have changed my wireless nodes to the ESP8266 the failure of these nodes decreases a lot.

                            rejoe2R 1 Reply Last reply
                            0
                            • gohanG Offline
                              gohanG Offline
                              gohan
                              Mod
                              wrote on last edited by
                              #39

                              Do you have an ethernet shield? If so try to make an ethernet gateway with the mega and when it hangs try to connect to it with myscontroller and see if you get a response.

                              1 Reply Last reply
                              0
                              • S Stefan_NE

                                New status:
                                the serial gateway based on the Arduino Mega with HW Serial failed after 27 hours. Same way to fix. I needed to restart FHEM and all nodes started working without any reboot e.g.
                                I don't think about any bus problem.
                                Next try is the gateway with an esp8266. Setup is done and all nodes are online. The major difference is the serial buffer of 256 bytes.
                                Since i have changed my wireless nodes to the ESP8266 the failure of these nodes decreases a lot.

                                rejoe2R Offline
                                rejoe2R Offline
                                rejoe2
                                wrote on last edited by
                                #40

                                @Stefan_NE Did you measure voltage A-B before restarting FHEM/the attached Arduino?
                                I also had very strange effects and was convinced not to have any electrical problem on the bus - I was completely wrong (see reports above).

                                Controller: FHEM; MySensors: 2.3.1, RS485,nRF24,RFM69, serial Gateways

                                1 Reply Last reply
                                0
                                • rejoe2R Offline
                                  rejoe2R Offline
                                  rejoe2
                                  wrote on last edited by
                                  #41

                                  One more update: This night my BME280-Node (Node_3 using altsoftserial) stopped transmitting - after around 8 days of operation... Strange!
                                  As Node_2 didn't crash completely in the past, I just desoldered my pullup- and pulldown-resistors that had been placed on that node (1k each). As I use the LC-Tech-Modules, now there are remaining only the full set of resistors on the GW (also the 2*20k) and at the last module in line.
                                  Communication seems to be stable from all nodes. As this is just one more snapshot wrt just around one hour of operation, I'm pretty interested what will happen next - or if that's just another small step in whatever direction.

                                  Controller: FHEM; MySensors: 2.3.1, RS485,nRF24,RFM69, serial Gateways

                                  1 Reply Last reply
                                  0
                                  • nofoxN Offline
                                    nofoxN Offline
                                    nofox
                                    wrote on last edited by
                                    #42

                                    Hi! My nodes stops working random once a week, once a month etc. I now upgrade my nodes sketch with watchdog timers. But not with avr/wdt library but with some code i’ve found in the internet. I dont upload the code to nodes but I’ve checked that the watchdog function working as I set some delay() into sketch. Its not a problem that the node hanging, the problem is They don’t restarting it self.

                                    1 Reply Last reply
                                    0
                                    • S Offline
                                      S Offline
                                      Stefan_NE
                                      wrote on last edited by
                                      #43

                                      New update, no good news
                                      It was working for 10 hours, and after restart for another 4 hours. I will stop now the use of the RS485. It is to weak for my use case. I have spend to much time for this.
                                      A couple of weeks ago, i switched from NFR24 to RFM 69, this is very stable. I will go for a secound RFM69 Network for this use case.

                                      1 Reply Last reply
                                      0
                                      • rejoe2R Offline
                                        rejoe2R Offline
                                        rejoe2
                                        wrote on last edited by
                                        #44

                                        One more: Node_2 has stopped transmission, so I resoldered for the use of HW-serial...
                                        I really suspect AltSoftSerial to be incompatible with 1wire (at least using PIN10).

                                        Controller: FHEM; MySensors: 2.3.1, RS485,nRF24,RFM69, serial Gateways

                                        1 Reply Last reply
                                        0
                                        • S Offline
                                          S Offline
                                          Stefan_NE
                                          wrote on last edited by
                                          #45

                                          Hi to all,

                                          after the change to RFM69 last sunday all 7 nodes are running without any connection lost. I added an alive message every 2min to the sketch. No messages have been lost.

                                          1 Reply Last reply
                                          0
                                          Reply
                                          • Reply as topic
                                          Log in to reply
                                          • Oldest to Newest
                                          • Newest to Oldest
                                          • Most Votes


                                          15

                                          Online

                                          11.7k

                                          Users

                                          11.2k

                                          Topics

                                          113.1k

                                          Posts


                                          Copyright 2025 TBD   |   Forum Guidelines   |   Privacy Policy   |   Terms of Service
                                          • Login

                                          • Don't have an account? Register

                                          • Login or register to search.
                                          • First post
                                            Last post
                                          0
                                          • MySensors
                                          • OpenHardware.io
                                          • Categories
                                          • Recent
                                          • Tags
                                          • Popular