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 47.0k 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.
  • hekH Offline
    hekH Offline
    hek
    Admin
    wrote on last edited by
    #1

    This thread contains comments for the article "Building a wired RS485 sensor network" posted on MySensors.org.

    1 Reply Last reply
    0
    • bjacobseB Offline
      bjacobseB Offline
      bjacobse
      wrote on last edited by
      #2

      Is it possible to have 1pcs NRF24L01 as serial gateway + 1 pcs RS485 as serial gateway (both with it's own Arduino Nano) connected at the same time to a controller? Will I just have to add 2 USB/serial gateways to my Domoticz?

      1 Reply Last reply
      0
      • hekH Offline
        hekH Offline
        hek
        Admin
        wrote on last edited by
        #3

        Yes. I'm almost certain Domoticz can handle multiple gateways..

        1 Reply Last reply
        1
        • mfalkviddM Offline
          mfalkviddM Offline
          mfalkvidd
          Mod
          wrote on last edited by
          #4

          Yes it does

          1 Reply Last reply
          1
          • BartB Offline
            BartB Offline
            Bart
            wrote on last edited by
            #5

            Could you provide details about the MySensor release version this was made on? I was not able to get it running on version 2.0.0. The development branch however worked fine.

            mfalkviddM 1 Reply Last reply
            0
            • BartB Bart

              Could you provide details about the MySensor release version this was made on? I was not able to get it running on version 2.0.0. The development branch however worked fine.

              mfalkviddM Offline
              mfalkviddM Offline
              mfalkvidd
              Mod
              wrote on last edited by
              #6

              @Bart could you clarify what you mean by "this"?

              BartB 1 Reply Last reply
              0
              • Q Offline
                Q Offline
                Qu3Uk
                wrote on last edited by
                #7

                On the Demonstration video what is each device? There are three devices but only two code examples.

                Am I right in saying the left device is the motion sensor, the middle device is getting the sensor data over RS-485 from the left device and sending it over the air to the right device which is an Ethernet gateway by the looks of it? Or has the video got nothing to do with the code examples?

                1 Reply Last reply
                0
                • hekH Offline
                  hekH Offline
                  hek
                  Admin
                  wrote on last edited by
                  #8

                  @Qu3Uk

                  The video was created by @LeoDesigner and was posted here, my guess it was just test:

                  https://forum.mysensors.org/topic/1947/rs485-rs232-serial-transport-class-for-mysensors-org/11

                  1 Reply Last reply
                  0
                  • mfalkviddM mfalkvidd

                    @Bart could you clarify what you mean by "this"?

                    BartB Offline
                    BartB Offline
                    Bart
                    wrote on last edited by
                    #9

                    @mfalkvidd I am referring to the code samples from the article :) I think it would be good to have a well documented working example. Maybe that's just me but I am getting a feeling there's a lot of scattered info about RS485 configuration.

                    1 Reply Last reply
                    0
                    • hekH Offline
                      hekH Offline
                      hek
                      Admin
                      wrote on last edited by
                      #10

                      @Bart
                      The article was written only a day ago. I'm open to add more information you see fit. Asked the community for help creating a wiring diagram in Fritzing but no one took up the request ;)

                      The examples in the article are from directly from the 2.0 repository and should contain the configuration needed.

                      BartB 1 Reply Last reply
                      0
                      • hekH hek

                        @Bart
                        The article was written only a day ago. I'm open to add more information you see fit. Asked the community for help creating a wiring diagram in Fritzing but no one took up the request ;)

                        The examples in the article are from directly from the 2.0 repository and should contain the configuration needed.

                        BartB Offline
                        BartB Offline
                        Bart
                        wrote on last edited by
                        #11

                        @hek OK, thanks for the hint - thought the article is older. Anyway as I am already on it, I will try to prepare something.

                        BTW, Apart from the SerialGateway (where Serial is obviously not available for the debug), should the Serial work for the debug? Assuming I am using AltSoftSerial or Serial1 for the RS485 I guess it should be possible. However with DEBUG on I was not able to get it to work.

                        1 Reply Last reply
                        0
                        • hekH Offline
                          hekH Offline
                          hek
                          Admin
                          wrote on last edited by
                          #12

                          Yes, for a regular node you should be able to print debug info.

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

                            Please, how many sensors on the bus you tested? I think, that this multimaster rs485 protocol is not very usefull for large number of nodes and heavy traffic..
                            I am working on protocol for CAN bus nodes connected to to the serial gateway, but documentation for mysensors code is very bad.
                            Its easier for me make it from scratch and use mysensors serial protocol between gateway and controller. only.

                            1 Reply Last reply
                            0
                            • P Offline
                              P Offline
                              pjr
                              wrote on last edited by pjr
                              #14

                              Would this help?
                              https://ci.mysensors.org/job/Verifiers/job/MySensorsArduino/job/development/Doxygen_HTML/

                              1 Reply Last reply
                              1
                              • R Offline
                                R Offline
                                rayven
                                wrote on last edited by
                                #15

                                I would like to create a rs485 network that is 'local' to a specific device, (one that uses many arduinos to manage a process currently using a mega hardware serial ports as the intermediary and local interface ) and one mysensors note to relay sensor data from the rs485(local network) to the wireless mysensors network. Mostly I am wondering if I can use the wired network gateway and wireless network repeter features at the same time? any help is appreciated.

                                https://github.com/rayvenwalker/mysensors-distillation/

                                1 Reply Last reply
                                0
                                • wimdW Offline
                                  wimdW Offline
                                  wimd
                                  wrote on last edited by
                                  #16

                                  Hi, I build up the set up with serial gateway and the motion sensor but nothing happens (only nonsence is is seen in the serial monitor)
                                  However if I run this small program using the AltSoftSerial library I can communicatie without any issue in both directions.
                                  Have others the same issue, or what do I overlook?

                                  #include <AltSoftSerial.h>

                                  AltSoftSerial altSerial;
                                  #define SSerialTxControl 2 //RS485 Direction control

                                  #define RS485Transmit HIGH
                                  #define RS485Receive LOW
                                  bool ReceiveOrSend = RS485Transmit;

                                  void setup() {

                                  Serial.begin(9600);
                                  Serial.println("AltSoftSerial Test Begin");
                                  pinMode(SSerialTxControl, OUTPUT);
                                  digitalWrite(SSerialTxControl, RS485Transmit); // Enable RS485 Transmit
                                  altSerial.begin(9600);
                                  if (ReceiveOrSend ){
                                  Serial.println("send mode");
                                  digitalWrite(SSerialTxControl, RS485Transmit); // Enable RS485 Transmit
                                  } else
                                  {
                                  digitalWrite(SSerialTxControl, RS485Receive); // Enable RS485 Transmit
                                  Serial.println("receive mode");
                                  }
                                  }

                                  void loop() {
                                  char receivedOnRS485;

                                  if (ReceiveOrSend ){
                                  altSerial.println(" Hello world");
                                  delay(2000);
                                  } else
                                  {

                                  if (altSerial.available()) {
                                  receivedOnRS485 = altSerial.read();
                                  Serial.print("ontvagen=");
                                  Serial.println(receivedOnRS485);
                                  }
                                  }
                                  }

                                  1 Reply Last reply
                                  0
                                  • P Offline
                                    P Offline
                                    pjr
                                    wrote on last edited by pjr
                                    #17

                                    2.1.0-beta tested and works between two nanos over altsoftserial
                                    COM6:GW, COM9:Bus monitor and COM5:Node
                                    0_1482020748958_rs485_working.png

                                    1 Reply Last reply
                                    0
                                    • wimdW Offline
                                      wimdW Offline
                                      wimd
                                      wrote on last edited by
                                      #18

                                      Tried this but I get an errormessage when I complile sketch for the gateway.
                                      The node presents itself but the messsage is not recognised/ answered by the gateway.

                                      1 Reply Last reply
                                      0
                                      • mickM Offline
                                        mickM Offline
                                        mick
                                        wrote on last edited by
                                        #19

                                        Has anyone else got this working alright ? I've connected 5v, GND, pins 8 to RD. 9 to DI. DE + RE to 2 and connected the rs485 modules via A B. Not getting any replys. Does the rs485 link need a resistor across it? Cheers.

                                        1 Reply Last reply
                                        0
                                        • wimdW Offline
                                          wimdW Offline
                                          wimd
                                          wrote on last edited by
                                          #20

                                          @MICK HI, please check this topic : https://forum.mysensors.org/topic/5495/rs485-on-nano

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


                                          23

                                          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