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. General Discussion
  3. rs485 on nano

rs485 on nano

Scheduled Pinned Locked Moved General Discussion
44 Posts 14 Posters 19.9k Views 15 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.
  • skatunS skatun

    @wimd include debug and remove inclusion from the sketches and it should be ok. I have ordered new rs485 shield, i expect that to be the issue..

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

    @skatun include debug, removal of inclusion and define MY_NODE_ID enabled communication on the RS485 bus.

    1 Reply Last reply
    0
    • R Offline
      R Offline
      Reza
      wrote on last edited by
      #23
      This post is deleted!
      1 Reply Last reply
      0
      • skatunS skatun

        @wimd include debug and remove inclusion from the sketches and it should be ok. I have ordered new rs485 shield, i expect that to be the issue..

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

        @skatun my problem is solve . you test this and feedback me. use 3.3v and gnd pins in arduino use for rs485 module.

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

          is this wiring true for rs485 ? thank you
          0_1485716457105_123.jpg

          also which cable is appropriate for A and B?

          1 Reply Last reply
          0
          • R Reza

            @skatun my problem is solve . you test this and feedback me. use 3.3v and gnd pins in arduino use for rs485 module.

            b0rmannB Offline
            b0rmannB Offline
            b0rmann
            wrote on last edited by
            #26

            @Reza

            no. rs485 must have LINEAR BUS topology.

            R 2 Replies Last reply
            1
            • b0rmannB b0rmann

              @Reza

              no. rs485 must have LINEAR BUS topology.

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

              @b0rmann my pic is not a bus ? i think this is a bus topology !

              1 Reply Last reply
              0
              • b0rmannB b0rmann

                @Reza

                no. rs485 must have LINEAR BUS topology.

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

                @b0rmann
                this is a bus ?
                0_1485723151109_RS485-Schnittstelle-11.png

                so in end of A and B , what am i do ?

                dbemowskD wimdW 2 Replies Last reply
                0
                • R Offline
                  R Offline
                  Reza
                  wrote on last edited by
                  #29
                  This post is deleted!
                  1 Reply Last reply
                  0
                  • R Reza

                    @b0rmann
                    this is a bus ?
                    0_1485723151109_RS485-Schnittstelle-11.png

                    so in end of A and B , what am i do ?

                    dbemowskD Offline
                    dbemowskD Offline
                    dbemowsk
                    wrote on last edited by
                    #30

                    @Reza Though your two pictures are both bus topologies, your first one is a star bus topology and your second is a linear bus topology. As to your second question "so in end of A and B , what am i do ?" Depending on a few factors such as equipment connected, cable type, cable length and data speed (baud rate) used, you may or may not need a termination resistor at the end of the line. For short runs you typically won't need them, but if you have hundreds of feet you are working with, you may want them, especially if you want to run at a higher baud like 115200 or higher. As to the resistor value, just do a google search for "RS485 termination resistor."

                    Vera Plus running UI7 with MySensors, Sonoffs and 1-Wire devices
                    Visit my website for more Bits, Bytes and Ramblings from me: http://dan.bemowski.info/

                    wallyllamaW 1 Reply Last reply
                    1
                    • R Reza

                      @b0rmann
                      this is a bus ?
                      0_1485723151109_RS485-Schnittstelle-11.png

                      so in end of A and B , what am i do ?

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

                      @Reza

                      This is how you build your network.

                      0_1485774949144_upload-db051496-c19d-4aea-8587-147867877ea3

                      I assume that you use these :
                      0_1485775090027_upload-6265356e-49b3-4577-8666-060af56319df

                      Node 1 is the MAX485 RS-485 Module connected to your gateway.
                      Node N is the MAX485 RS-485 Module connected to your last sensor of your network.

                      Between node 1 and N you can add addtional nodes but you need to keep the bus structure.

                      Important are the terminating resistors (1) and (2). They are R7 on the RS-485 module.
                      If you add modules between node 1 and node N and you have a failure in transmitting, check then with removal of R7 on that added node.

                      R 1 Reply Last reply
                      2
                      • wimdW wimd

                        @Reza

                        This is how you build your network.

                        0_1485774949144_upload-db051496-c19d-4aea-8587-147867877ea3

                        I assume that you use these :
                        0_1485775090027_upload-6265356e-49b3-4577-8666-060af56319df

                        Node 1 is the MAX485 RS-485 Module connected to your gateway.
                        Node N is the MAX485 RS-485 Module connected to your last sensor of your network.

                        Between node 1 and N you can add addtional nodes but you need to keep the bus structure.

                        Important are the terminating resistors (1) and (2). They are R7 on the RS-485 module.
                        If you add modules between node 1 and node N and you have a failure in transmitting, check then with removal of R7 on that added node.

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

                        @wimd
                        i use this module (rs485) . for max 30 or 40 meter. is need resistors ? ( if need 100 ohm is good ?)
                        i think the problem that @skatun told was solve with 3.3v pin on arduino but no. i use static ID for nodes and remove INCLUSION MODE in gateway but when connect i have error:

                        2035 !TSM:FPAR:NO REPLY
                        2037 TSM:FPAR
                        2055 TSF:MSG:SEND,1-1-255-255,s=255,c=3,t=7,pt=0,l=0,sg=0,ft=0,st=OK:
                        4063 !TSM:FPAR:NO REPLY
                        4065 TSM:FPAR
                        4082 TSF:MSG:SEND,1-1-255-255,s=255,c=3,t=7,pt=0,l=0,sg=0,ft=0,st=OK:
                        6090 !TSM:FPAR:NO REPLY
                        6092 TSM:FPAR
                        6110 TSF:MSG:SEND,1-1-255-255,s=255,c=3,t=7,pt=0,l=0,sg=0,ft=0,st=OK:
                        8118 !TSM:FPAR:FAIL
                        8119 TSM:FAIL:CNT=1
                        8121 TSM:FAIL:PDT
                        

                        after some reset and change pins of vcc and gnd , when use 3.3v in gateway for vcc rs485 module i see (in serial monitor) node is connect to gateway. so i think this is ok always. but today i try for new node and i see same problem again
                        do you think this is related to power ?

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

                          i found a thing about this . i think all of problem is related to power ! when power of node is with a adaptor 1A and power of gateway is with usb of raspberry so i have this error "!TSM:FPAR:NO REPLY" but when connect both ( node and gateway to laptop with usb) after several test i see all of connect is ok ( several reset and connect/disconnect usb cable) . i am beginner sorry , so for this what am i do ? can i use another power for vcc and gnd rs485 module ? how ? or you have better solution ?

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

                            i tested again . connected gateway to my laptop (use domoticz for laptop) and use a 30 meter wire between gateway and first node. and again use a 5 meter wire for second node ( without any resistor). when start domoticz , nodes detect easy and start working well. i test again and again (with reset and power off/on)but this is ok and dont any problem(relay give command and send ack and all of thing is true) . then i connect gateway to raspberry (2 nodes is connect to laptop yet) so for a short time relay worked ( 2 - 3 command send and relay on without ack ) then all command can not send....
                            again i connect gateway to laptop and all command send and ok .
                            so i think this is related to power of usb port (raspberry)
                            can i use rx-tx gpio on raspberry and arduino and use other power for arduino ?how configure on raspberry ? thank you

                            K 1 Reply Last reply
                            0
                            • vikmadV Offline
                              vikmadV Offline
                              vikmad
                              wrote on last edited by
                              #35

                              Many hours I solved why MySe485 example does not work :angry: ... I tried Mega, Uno, Mini, Nano, reinstallation of IDE, libraries, ClearEepromConfig, HWserial / AltSoftSerial / direct (Tx <> Rx) + (Rx <> TX) without MAX485 ...

                              The other day I came across this forum and the solution is:

                              #define MY_NODE_ID xx

                              I saw a bug that RS485 communication is bad, because it is illegible. My mistake, the communication between GW and the node is not readable ASCII ...

                              RS485 communication: Node waiting to GW respone:
                              0_1485894929734_upload-fb5458be-c704-4c5a-9377-61558ce658c5

                              dbemowskD 1 Reply Last reply
                              0
                              • R Reza

                                i tested again . connected gateway to my laptop (use domoticz for laptop) and use a 30 meter wire between gateway and first node. and again use a 5 meter wire for second node ( without any resistor). when start domoticz , nodes detect easy and start working well. i test again and again (with reset and power off/on)but this is ok and dont any problem(relay give command and send ack and all of thing is true) . then i connect gateway to raspberry (2 nodes is connect to laptop yet) so for a short time relay worked ( 2 - 3 command send and relay on without ack ) then all command can not send....
                                again i connect gateway to laptop and all command send and ok .
                                so i think this is related to power of usb port (raspberry)
                                can i use rx-tx gpio on raspberry and arduino and use other power for arduino ?how configure on raspberry ? thank you

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

                                @Reza
                                Maybe stupid question from me, but have got you connected ground wires between nodes?
                                Not only A and B?
                                http://www.chipkin.com/rs485-cables-why-you-need-3-wires-for-2-two-wire-rs485/

                                R 1 Reply Last reply
                                1
                                • vikmadV vikmad

                                  Many hours I solved why MySe485 example does not work :angry: ... I tried Mega, Uno, Mini, Nano, reinstallation of IDE, libraries, ClearEepromConfig, HWserial / AltSoftSerial / direct (Tx <> Rx) + (Rx <> TX) without MAX485 ...

                                  The other day I came across this forum and the solution is:

                                  #define MY_NODE_ID xx

                                  I saw a bug that RS485 communication is bad, because it is illegible. My mistake, the communication between GW and the node is not readable ASCII ...

                                  RS485 communication: Node waiting to GW respone:
                                  0_1485894929734_upload-fb5458be-c704-4c5a-9377-61558ce658c5

                                  dbemowskD Offline
                                  dbemowskD Offline
                                  dbemowsk
                                  wrote on last edited by
                                  #37

                                  @vikmad Are your gateway and receiving node baud rates the same? You can get gibberish like that if your baud rates differ between nodes.

                                  Vera Plus running UI7 with MySensors, Sonoffs and 1-Wire devices
                                  Visit my website for more Bits, Bytes and Ramblings from me: http://dan.bemowski.info/

                                  vikmadV 1 Reply Last reply
                                  0
                                  • dbemowskD dbemowsk

                                    @vikmad Are your gateway and receiving node baud rates the same? You can get gibberish like that if your baud rates differ between nodes.

                                    vikmadV Offline
                                    vikmadV Offline
                                    vikmad
                                    wrote on last edited by
                                    #38

                                    @dbemowsk It works now. To sketch, I added the line: #define MY_NODE_ID xx

                                    Arduino IDE 1.8.1, MySensors Library v2.1.1:

                                    • Upload ClearEepromConfig
                                    • Upload MotionSensorRS485
                                      = not working

                                    • Add #define MY_NODE_ID 1 to MotionSensorRS485 and upload
                                      = working

                                    1 Reply Last reply
                                    0
                                    • K kimot

                                      @Reza
                                      Maybe stupid question from me, but have got you connected ground wires between nodes?
                                      Not only A and B?
                                      http://www.chipkin.com/rs485-cables-why-you-need-3-wires-for-2-two-wire-rs485/

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

                                      @kimot said in rs485 on nano:

                                      @Reza
                                      Maybe stupid question from me, but have got you connected ground wires between nodes?
                                      Not only A and B?

                                      no i use just 2 wire ( A & B ) . but problem is solve. i change power of raspberry. this work well !

                                      this is compulsion (wire for ground) ? or if i connect ground of 2 nodes is better ?

                                      1 Reply Last reply
                                      0
                                      • R Offline
                                        R Offline
                                        Reza
                                        wrote on last edited by
                                        #40
                                        This post is deleted!
                                        1 Reply Last reply
                                        0
                                        • RedguyR Offline
                                          RedguyR Offline
                                          Redguy
                                          wrote on last edited by
                                          #41

                                          No, connecting ground is not mandatory.. In fact, i would not recommend it at all, especialy not on longer bus lengts.. Just use A&B

                                          If you have shielded cables.. Connect the shielding to gnd on 1 side only and leave the other side unconnected..

                                          This will provide shielding but prevent ground loop issues.

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


                                          1

                                          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