rs485 on nano



  • 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



  • @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/



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



  • @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



  • @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 ?



  • This post is deleted!


  • 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.



  • Also keepin mind that those cheap rs485 adapters have a 120ohm load resistor and pull up and pulldown resistors installed for the rs485 bus..

    Those should only ve installed on the ends of the data bus.. So remove them from the rest of the adapters if you use more than 2.



  • This post is deleted!


  • This post is deleted!

Log in to reply
 

Looks like your connection to MySensors Forum was lost, please wait while we try to reconnect.