Skip to content
  • 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
  • Getting Started
  • Controller
  • Build
  • Hardware
  • Download/API
  • Forum
  • Store

💬 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.
  • R Offline
    R Offline
    Reza
    wrote on last edited by
    #61

    for wiring , is this true ?
    rs485...............arduino
    vcc......................5v
    gnd....................gnd
    DI.........................9
    DE........................2
    RE.......................10
    R0........................8

    K 2 Replies Last reply
    0
    • R Reza

      for wiring , is this true ?
      rs485...............arduino
      vcc......................5v
      gnd....................gnd
      DI.........................9
      DE........................2
      RE.......................10
      R0........................8

      K Offline
      K Offline
      kimot
      wrote on last edited by
      #62

      @Reza

      DI and DO depends on your board type.
      Look at AltSoftSerial_Boards.h
      DE and RE should be connected together and connected to pin,
      which is defined in your program:
      #define MY_RS485_DE_PIN 2

      R 1 Reply Last reply
      0
      • R Reza

        for wiring , is this true ?
        rs485...............arduino
        vcc......................5v
        gnd....................gnd
        DI.........................9
        DE........................2
        RE.......................10
        R0........................8

        K Offline
        K Offline
        kimot
        wrote on last edited by
        #63

        @Reza
        http://cmss.pl/arduino/MySensor_RS485_test02_b.JPG

        R 1 Reply Last reply
        0
        • K kimot

          @Reza

          DI and DO depends on your board type.
          Look at AltSoftSerial_Boards.h
          DE and RE should be connected together and connected to pin,
          which is defined in your program:
          #define MY_RS485_DE_PIN 2

          R Offline
          R Offline
          Reza
          wrote on last edited by
          #64

          @kimot thank you friend :rose:

          1 Reply Last reply
          0
          • K kimot

            @Reza
            http://cmss.pl/arduino/MySensor_RS485_test02_b.JPG

            R Offline
            R Offline
            Reza
            wrote on last edited by
            #65

            @kimot
            for a raspberry pi gateway this wiring is true ?
            0_1485417941637_RS485_Serial_Module_Wiring.png

            wimdW 1 Reply Last reply
            0
            • R Reza

              @kimot
              for a raspberry pi gateway this wiring is true ?
              0_1485417941637_RS485_Serial_Module_Wiring.png

              wimdW Offline
              wimdW Offline
              wimd
              wrote on last edited by
              #66

              @Reza No. You need to have your gateway inbetween. Your controller can't "talk" directly with you MySensors network. Wee the picture from kimot.

              gohanG R 2 Replies Last reply
              0
              • wimdW wimd

                @Reza No. You need to have your gateway inbetween. Your controller can't "talk" directly with you MySensors network. Wee the picture from kimot.

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

                @wimd
                actually RPI can act as gateway https://www.mysensors.org/build/raspberry , but I agree that's much easier to have an Arduino as a gateway

                1 Reply Last reply
                0
                • wimdW wimd

                  @Reza No. You need to have your gateway inbetween. Your controller can't "talk" directly with you MySensors network. Wee the picture from kimot.

                  R Offline
                  R Offline
                  Reza
                  wrote on last edited by
                  #68

                  @wimd we can build a gateway with raspberrypi without arduino . @gohan saying true . but i have to use gpio for serial gateway because when i use a usb serial port after turn on/off or reboot raspberry can not detect my gateway... but with gpio i test and this is true, so i have to use gpio for gateway

                  K gohanG 2 Replies Last reply
                  0
                  • R Offline
                    R Offline
                    Reza
                    wrote on last edited by
                    #69

                    if i use rs485 for my network , can solve problems about signaling and distance and wall? and solve problem about NACK ?

                    1 Reply Last reply
                    0
                    • R Reza

                      @wimd we can build a gateway with raspberrypi without arduino . @gohan saying true . but i have to use gpio for serial gateway because when i use a usb serial port after turn on/off or reboot raspberry can not detect my gateway... but with gpio i test and this is true, so i have to use gpio for gateway

                      K Offline
                      K Offline
                      kimot
                      wrote on last edited by kimot
                      #70

                      @Reza
                      Maybe your problem and its solution with "serial-through USB" connection on Raspberry is described here:

                      https://g0kao.wordpress.com/2013/08/08/usb-port-assignment-on-a-raspberry-pi/

                      K 1 Reply Last reply
                      1
                      • K kimot

                        @Reza
                        Maybe your problem and its solution with "serial-through USB" connection on Raspberry is described here:

                        https://g0kao.wordpress.com/2013/08/08/usb-port-assignment-on-a-raspberry-pi/

                        K Offline
                        K Offline
                        kimot
                        wrote on last edited by
                        #71

                        @kimot
                        I am not sure, that Raspberry can work like RS485 gateway for MySensors RS485 network.
                        On a "quick" look through code, I do not find anything for RS485.

                        1 Reply Last reply
                        1
                        • R Reza

                          @wimd we can build a gateway with raspberrypi without arduino . @gohan saying true . but i have to use gpio for serial gateway because when i use a usb serial port after turn on/off or reboot raspberry can not detect my gateway... but with gpio i test and this is true, so i have to use gpio for gateway

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

                          @Reza
                          Maybe it is worth a try and get a W5100 network shield and make an ethernet gateway. I have one now and so far I'm happy with it.

                          1 Reply Last reply
                          1
                          • R Offline
                            R Offline
                            Reza
                            wrote on last edited by
                            #73

                            thank you friends

                            1 Reply Last reply
                            0
                            • R Offline
                              R Offline
                              Reza
                              wrote on last edited by
                              #74

                              @kimot @gohan do you use a wired network with rs485 ? i have problem with rf24 and i want change my wireless network to a wiring network , but i want know with a rs485 all command are send? without error and NACK ? now for wireless network i have for example every 5 true commands 1 fail command(NACK)

                              gohanG 1 Reply Last reply
                              0
                              • R Reza

                                @kimot @gohan do you use a wired network with rs485 ? i have problem with rf24 and i want change my wireless network to a wiring network , but i want know with a rs485 all command are send? without error and NACK ? now for wireless network i have for example every 5 true commands 1 fail command(NACK)

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

                                @Reza
                                not yet, but I am getting the parts to make a wired rs485 network of 4 nodes + gateway. About the NACK error it should be handled by the library and retransmit the lost packet.

                                R 1 Reply Last reply
                                1
                                • P Offline
                                  P Offline
                                  pjr
                                  wrote on last edited by
                                  #76

                                  Currently there is no "hw" ack functionlity like the radio has.
                                  You can check out the rs485 transmit code from here.

                                  But you can of course use the ack functionality between controller software and node to make sure message will get to destination.

                                  1 Reply Last reply
                                  1
                                  • gohanG gohan

                                    @Reza
                                    not yet, but I am getting the parts to make a wired rs485 network of 4 nodes + gateway. About the NACK error it should be handled by the library and retransmit the lost packet.

                                    R Offline
                                    R Offline
                                    Reza
                                    wrote on last edited by
                                    #77

                                    @gohan now my sensors lib how many send packet if first is lost ? how more this ?
                                    i want after send command Turn on light Certainly

                                    1 Reply Last reply
                                    0
                                    • R Offline
                                      R Offline
                                      Reza
                                      wrote on last edited by Reza
                                      #78

                                      i am tired for test and trying to configure wiring network with RS485. this is strange :angry:
                                      i build a gateway and a relay with rs485 . for test i now use 2raspberry pi and 1orangepi and a laptop ! every time disconnect gateway from one and connect to other one ( with out other change for example sketch and wiring and etc. just change controller) some time this is very good work on laptop. some time good work on orange and some time good on raspbrrey pis !! some time same first command has sent(LED on gateway and on node just one blink. some time LEDs 2 blink and turn on later)
                                      i am using 15cm wire between 2nodes! when change to some meter so dont work never...
                                      so there is not any one that understand what is reason this issue !!!

                                      i am ready and i have devices and madules. so any body that think can solve this , told me so i test on my devices and feedback.

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

                                        @Reza have you tried to use terminating resistors?

                                        And perhaps it could be good to try 1k pull-up and pull-downs at the gateway end. The left diagram:
                                        alt text

                                        With these two tricks I got my setup stable.

                                        And a little tweak to transport class could help also..

                                        R 2 Replies Last reply
                                        1
                                        • P pjr

                                          @Reza have you tried to use terminating resistors?

                                          And perhaps it could be good to try 1k pull-up and pull-downs at the gateway end. The left diagram:
                                          alt text

                                          With these two tricks I got my setup stable.

                                          And a little tweak to transport class could help also..

                                          R Offline
                                          R Offline
                                          Reza
                                          wrote on last edited by
                                          #80

                                          @pjr
                                          i use 120 ohm in terminate before. but now i use 1k for pull-up and down.but this is effectless.
                                          please wait until i read this topic (rs485 stress test) and do it and feedback here . thank you

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


                                          6

                                          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
                                          • OpenHardware.io
                                          • Categories
                                          • Recent
                                          • Tags
                                          • Popular