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. MySensor Network on RS485 - only single node visible

MySensor Network on RS485 - only single node visible

Scheduled Pinned Locked Moved Troubleshooting
mysensors
13 Posts 4 Posters 155 Views 4 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.
  • rejoe2R rejoe2

    @Rysiek As you are using a Pro Micro as a GW, imo the RS485 modules should be connected to Serial1 instead of Serial (which goes to USB).

    R Offline
    R Offline
    Rysiek
    wrote on last edited by
    #3

    @rejoe2 said in MySensor Network on RS485 - only single node visible:

    @Rysiek As you are using a Pro Micro as a GW, imo the RS485 modules should be connected to Serial1 instead of Serial (which goes to USB).

    Hi, well actually it is Serial1, Serial will not compile on pro Micro, I was trying to use nano as gateway, but it took no effect. the code I pasted is from that. in Pro Micro Gateway it is of course Serial1.

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

      OK, so thanks for info.

      Some additional remarks:

      • using a GW also as a sensor node might cause trouble, too. I'd recommend to avoid that (though it's possible, no question). This recommendation is even stronger here, because reading DS18B20 might be blocking for short periods of time (see "conversion time").
      • That conversion time may be an additional point to look at at the GW node. Didn't do investiagations on that, but your measurement might not deliever reliable results due to lack of delay.
      • In general, I'd also recommend to use non-blocking-loops for all central powered nodes. Putting the nodes 1 and 2 to sleep or let them "delay" for longer periods might also cause trouble. Better start with "dumb" messages (e.g. send a "tripped" message every 30 seconds) to test if your problems are more on the physical communication layer or on the software/firmware side.

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

      1 Reply Last reply
      0
      • R Offline
        R Offline
        Rysiek
        wrote on last edited by
        #5

        Hi,
        Thank you for your comments. it gave me a little thinking and I guess I will remove temp sensor from gateway.
        Also I will not put them into sleep... I will try to check what effect will I get when I put some nodes to sleep for that 30 minutes. (BTW what kind of trouble you have in mind?). From my perspective putting nodes to sleep will save some power. I can of course "wake" them every 30 seconds for loop or two :P.

        Anyway, I tried to do as you suggested, and find out that effect will be the same... node 2 is somehow blocking node 1 communication and when node 2 is connected node 1 is not visible.
        BUT... while testing is I have a thought of possible reason. Node 2 and the gateway are using HW serial for communication while node 1 is using software library. I've made another node on prototype board and connected it to the bus... and both node 2 and new node 3 were visible (no 1 was not). I will made PCB and try to replace node1 with HW serial communication.
        Let you know if it works.

        Regards

        rejoe2R 1 Reply Last reply
        0
        • R Rysiek

          Hi,
          Thank you for your comments. it gave me a little thinking and I guess I will remove temp sensor from gateway.
          Also I will not put them into sleep... I will try to check what effect will I get when I put some nodes to sleep for that 30 minutes. (BTW what kind of trouble you have in mind?). From my perspective putting nodes to sleep will save some power. I can of course "wake" them every 30 seconds for loop or two :P.

          Anyway, I tried to do as you suggested, and find out that effect will be the same... node 2 is somehow blocking node 1 communication and when node 2 is connected node 1 is not visible.
          BUT... while testing is I have a thought of possible reason. Node 2 and the gateway are using HW serial for communication while node 1 is using software library. I've made another node on prototype board and connected it to the bus... and both node 2 and new node 3 were visible (no 1 was not). I will made PCB and try to replace node1 with HW serial communication.
          Let you know if it works.

          Regards

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

          @Rysiek In general, I don't see any problem in mixing softwareserial and hardwareserial (I did that in the past, too).
          Wrt. to sleep: My entire RS485-MySensors-setup consumes ~3W (dependent on relay states), so powering down the arduinos most likely will save some power, yes; but imo that's negilable.
          What might happen when powering down: the bus might get blocked, if one of the nodes keeps bus on "high" level. I had some nasty problems wrt to that, so I make sure, there is nothing (slightly) suspective of such behaviour (additionally, I changed the RS485 Modules with CAN ones (MCP2551) - they don't need no DE/RE/interrupt, too and can be used as a drop-in-replacement. The only disadvantage: they are not PIN-compatible when using SOIC-8 variants, so you can't use most of the board designs from openhardware.io).

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

          1 Reply Last reply
          0
          • R Offline
            R Offline
            Rysiek
            wrote on last edited by
            #7

            @rejoe2 Hi, Thank for description. I'm a little confused with this HW/SW serial, because I've also mixed them while building prototypes and it worked. Today I'm going to test it once again. I've already build node using HW serial and later today going to replace old one. We'll see how it will work.

            As for CAN.. well I have to read more about it, lacking compatibility with existing PCBs is not a problem, I used to build my own PCBs.

            1 Reply Last reply
            0
            • J Offline
              J Offline
              Jarosław Narbut
              wrote on last edited by
              #8

              You should use terminating resistors on both ends. But also try to add or change resistor(10k) between A to VCC and B to GND. It's R5 and R6 on schematic.

              1 Reply Last reply
              0
              • R Offline
                R Offline
                Rysiek
                wrote on last edited by
                #9

                @Jarosław-Narbut What do you mean by "changing resistors" as they already exists... what values do you propose??

                Anyway, when I've replace node that used SW for serial communication with HW one, the problem is gone.

                Regards
                Ryszard

                J 1 Reply Last reply
                0
                • R Rysiek

                  @Jarosław-Narbut What do you mean by "changing resistors" as they already exists... what values do you propose??

                  Anyway, when I've replace node that used SW for serial communication with HW one, the problem is gone.

                  Regards
                  Ryszard

                  J Offline
                  J Offline
                  Jarosław Narbut
                  wrote on last edited by
                  #10

                  @Rysiek said in MySensor Network on RS485 - only single node visible:

                  @Jarosław-Narbut What do you mean by "changing resistors" as they already exists... what values do you propose??

                  Anyway, when I've replace node that used SW for serial communication with HW one, the problem is gone.

                  Regards
                  Ryszard

                  MAX485-Module-Sch1.jpg
                  R5 and R6 change or add to 10k.

                  I have 11 nodes with SW serial, 1 with HW, and GW mqtt with HW. RS485 speed set to 57600kbps.

                  1 Reply Last reply
                  1
                  • R Offline
                    R Offline
                    Rysiek
                    wrote on last edited by
                    #11

                    @Jarosław-Narbut , thanks I will try that.

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

                      Having a deeper look at resistor values is always a good idea.
                      Indeed, optimal values depend on a lot of parameters. You might find a helpful tool for getting the best values for your setup here: http://www.alciro.org/tools/RS-485/RS485-resistor-termination-calculator.jsp

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

                      1 Reply Last reply
                      0
                      • R Offline
                        R Offline
                        RobertoWard
                        wrote on last edited by
                        #13

                        Very useful topic for me, thanks. Even though it's been a long time, the information was useful to me. And especially the information on the link you sent.

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


                        21

                        Online

                        11.7k

                        Users

                        11.2k

                        Topics

                        113.0k

                        Posts


                        Copyright 2019 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