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. Announcements
  3. 💬 Building a wired RS485 sensor network

💬 Building a wired RS485 sensor network

Scheduled Pinned Locked Moved Announcements
164 Posts 33 Posters 46.7k Views 35 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.
  • dzjrD dzjr

    hello MySensors friends,

    I am currently making a node based on an arduino Mega 2560 with transport via RS-485, the build page says that we should use the MEGA pin 46 & 48, I was wondering if I would like a reference for this. in the sketch.
    Second question; can I use pin 47 for the DE pin with:

    #define MY_RS485_DE_PIN 47
    

    I haven't tested anything yet, so actually I just ask a lazy question ;)

    dzjrD Offline
    dzjrD Offline
    dzjr
    wrote on last edited by
    #144

    @dzjr said in 💬 Building a wired RS485 sensor network:

    hello MySensors friends,

    I am currently making a node based on an arduino Mega 2560 with transport via RS-485, the build page says that we should use the MEGA pin 46 & 48, I was wondering if I would like a reference for this. in the sketch.
    Second question; can I use pin 47 for the DE pin with:

    #define MY_RS485_DE_PIN 47
    

    I haven't tested anything yet, so actually I just ask a lazy question ;)

    I have it working, so you don't have to adjust anything for a Mega, and pin 47 for DE also works!

    1 Reply Last reply
    1
    • zrom69Z Offline
      zrom69Z Offline
      zrom69
      wrote on last edited by
      #145

      Hi,
      in a node how many children can put rs-485
      thanks good work

      dzjrD 1 Reply Last reply
      0
      • zrom69Z Offline
        zrom69Z Offline
        zrom69
        wrote on last edited by
        #146

        and it can have blockages if there are sensors that function or even time
        thanks

        1 Reply Last reply
        0
        • zrom69Z zrom69

          Hi,
          in a node how many children can put rs-485
          thanks good work

          dzjrD Offline
          dzjrD Offline
          dzjr
          wrote on last edited by
          #147

          @zrom69

          I have a node with 52 child id's on a Arduino mega,

          Arnout 22 of Them receiving data (relay & dimmers) and the rest are sending data, binary, temp/hum, soil moisture and analog data.

          Not all the nodes are in use, but i see the data in domoticz.

          I dont know how manny childs you want to use, for me 52 on one node are very mutch.

          zrom69Z 1 Reply Last reply
          0
          • zrom69Z Offline
            zrom69Z Offline
            zrom69
            wrote on last edited by
            #148

            thank you for your reply
            at least 10 children in node and 30 nodes

            1 Reply Last reply
            0
            • dzjrD dzjr

              @zrom69

              I have a node with 52 child id's on a Arduino mega,

              Arnout 22 of Them receiving data (relay & dimmers) and the rest are sending data, binary, temp/hum, soil moisture and analog data.

              Not all the nodes are in use, but i see the data in domoticz.

              I dont know how manny childs you want to use, for me 52 on one node are very mutch.

              zrom69Z Offline
              zrom69Z Offline
              zrom69
              wrote on last edited by
              #149

              @dzjr
              thank you for your reply
              at least 10 children in node and 30 nodes
              @dzjr

              1 Reply Last reply
              0
              • R Offline
                R Offline
                rafal9318
                wrote on last edited by
                #150

                Hi all,
                I have a question about, How to use hardware serial on Arduino Uno (as a sensor) to communicate with gateway via RS485? I added #define MY_RS485_HWSERIAL Serial and it is only working when i turn on debugging (#define MY_DEBUG), how to use hardware serial without debugger ?

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

                  @zrom69
                  No real Problem in turning off debug output, at least in 2.3.1 this worked:

                  // Enable debug prints to serial monitor
                  //#define MY_DEBUG
                  //#define MY_DEBUG_LOCAL
                  
                  #define SN "Zwischenkeller"
                  #define SV "0.2"
                  
                  // Enable RS485 transport layer
                  #define MY_RS485
                  
                  // Define this to enables DE-pin management on defined pin
                  #define MY_RS485_DE_PIN 2
                  
                  // Set RS485 baud rate to use
                  #define MY_RS485_BAUD_RATE 19200 //57600 //38400 //9600
                  #define MY_RS485_SOH_COUNT 1
                  #define MY_RS485_HWSERIAL Serial
                  #define MY_SPLASH_SCREEN_DISABLED
                  

                  You may even swap around debugging output from hardware serial to software serial, see basic structure from this post in FHEM forum (german, but most is code).

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

                  1 Reply Last reply
                  0
                  • R Offline
                    R Offline
                    rafal9318
                    wrote on last edited by
                    #152

                    @rejoe2 Thank you. #define MY_SPLASH_SCREEN_DISABLED that was the missing line.
                    Okey i understand now. Thank you again.

                    1 Reply Last reply
                    0
                    • F Offline
                      F Offline
                      Flyer
                      wrote on last edited by
                      #153

                      I am trying to build up a Mysensors with Wired ethernet to the gateway with W5100 and RS485 bewteen nodes, is there something that can help me with this configuration?
                      Everything looks weel from the monitor serial but domoticz is not able to connect to the gateway!

                      C 1 Reply Last reply
                      0
                      • A Offline
                        A Offline
                        ArduiSens
                        wrote on last edited by
                        #154

                        @Flyer said in 💬 Building a wired RS485 sensor network:

                        ng to build

                        Hi Flyer, As far as I know this is not possible.

                        MySensors 2.3.2; contr:Domoticz; layer: RS485, nRF24; gw: Ethernet, Serial

                        1 Reply Last reply
                        0
                        • F Flyer

                          I am trying to build up a Mysensors with Wired ethernet to the gateway with W5100 and RS485 bewteen nodes, is there something that can help me with this configuration?
                          Everything looks weel from the monitor serial but domoticz is not able to connect to the gateway!

                          C Offline
                          C Offline
                          cabat
                          wrote on last edited by
                          #155

                          @Flyer Do you can ping the gateway on it IP?

                          1 Reply Last reply
                          0
                          • A Offline
                            A Offline
                            ArduiSens
                            wrote on last edited by
                            #156

                            I see there is a possibility the combine Ethernet with RS485.
                            Maybe you can check the setup as they did here:

                            https://www.openhardware.io/view/649/RS485-Ethernet-Gateway#tabs-comments

                            https://github.com/feanor-anglin/GetWired-Project/blob/master/GetWired Ethernet Gateway/Gateway.ino

                            MySensors 2.3.2; contr:Domoticz; layer: RS485, nRF24; gw: Ethernet, Serial

                            1 Reply Last reply
                            0
                            • G Offline
                              G Offline
                              gryzli133
                              wrote on last edited by
                              #157

                              You can also try using PJON - it has solved all the issues that I was facing with RS485 and other wired solutions (like all sensors on the Gateway). It will be released officially in MySensors 2.4.0, but you can test is already now (alpha):
                              https://github.com/tekka007/MySensors

                              You can read more here:
                              https://github.com/mysensors/MySensors/pull/1278

                              C 1 Reply Last reply
                              0
                              • G gryzli133

                                You can also try using PJON - it has solved all the issues that I was facing with RS485 and other wired solutions (like all sensors on the Gateway). It will be released officially in MySensors 2.4.0, but you can test is already now (alpha):
                                https://github.com/tekka007/MySensors

                                You can read more here:
                                https://github.com/mysensors/MySensors/pull/1278

                                C Offline
                                C Offline
                                cabat
                                wrote on last edited by
                                #158

                                @gryzli133 I have a number of MySensors devices using RS485, it would be interesting to try to run PJON protocol over RS485, it seems like there is such an opportunity, but I could not figure out how to use it in the MySensors library.

                                1 Reply Last reply
                                1
                                • H Offline
                                  H Offline
                                  hypnosiss
                                  wrote on last edited by
                                  #159

                                  yes, I am interested too as mysensors sometimes lost messages over rs485.

                                  C 1 Reply Last reply
                                  0
                                  • H hypnosiss

                                    yes, I am interested too as mysensors sometimes lost messages over rs485.

                                    C Offline
                                    C Offline
                                    cabat
                                    wrote on last edited by
                                    #160

                                    @hypnosiss you may be interested in this https://forum.mysensors.org/topic/11814/rs485-transport-ack-support/6

                                    H 1 Reply Last reply
                                    1
                                    • C cabat

                                      @hypnosiss you may be interested in this https://forum.mysensors.org/topic/11814/rs485-transport-ack-support/6

                                      H Offline
                                      H Offline
                                      hypnosiss
                                      wrote on last edited by
                                      #161

                                      @cabat thank you. I have losts when number of messages are sent from HA to nodes(throught mqtt ethernet gateway) and in the same time nodes are sending messages to controller as well. I described issue on Home Assistant forum but without any response - https://community.home-assistant.io/t/lost-messages-sent-simultaneously/363904

                                      1 Reply Last reply
                                      0
                                      • J Offline
                                        J Offline
                                        JeeLet
                                        wrote on last edited by
                                        #162

                                        yes it's not easy, the loss of package is a difficult thing to
                                        to counter, but not entirely.
                                        and the multiple layers of a computer system do not help :)

                                        some philosophy on collision avoidance
                                        https://arduino.stackexchange.com/questions/24523/rs485-multimaster-communication-with-collision-avoidance

                                        don't mix the Protocol (data encapsulation)
                                        and the physical support (voltage frequency impendance / star or serial bus)

                                        the ModBus protocol on a RS485 support
                                        https://www.electroniclinic.com/arduino-modbus-rs485-arduino-rs485-master-and-slave/

                                        a different explanation https://www.codrey.com/learn/rs-485-arduino-quick-primer/

                                        for information
                                        https://github.com/sonyarouje/Arduino_HardwareSerial_RS485

                                        But the best solution (reliability and especially lightness of the sketch) is the CAN bus :)

                                        I may have said some stupid things ;)

                                        Translated with www.DeepL.com/Translator (free version)

                                        1 Reply Last reply
                                        0
                                        • J Offline
                                          J Offline
                                          JeeLet
                                          wrote on last edited by JeeLet
                                          #163

                                          a line of the examples given in the sketches for the use of RS485 can be a source of problem
                                          (it's my case, I use Pin2 or3 for a long time :( )

                                          ...
                                          // Define this to enables DE-pin management on defined pin
                                          #define MY_RS485_DE_PIN 2
                                          (2 or 3 is an interrupt pin for a Uno)
                                          ...

                                          avoided interrupt pins.

                                          the pin 10 is a good thing :)

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


                                          16

                                          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