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. Troubleshooting
  3. RS485 transmit errors

RS485 transmit errors

Scheduled Pinned Locked Moved Troubleshooting
4 Posts 3 Posters 1.1k Views 3 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.
  • sebastiengS Offline
    sebastiengS Offline
    sebastieng
    wrote on last edited by
    #1

    Hello,

    I am trying to setup a RS485 gateway on a raspberry with an arduino node.

    Raspberry gateway is build with

    ./configure  --my-gateway=ethernet --my-port=8011 --my-transport=rs485 --my-rs485-serial-port=/dev/ttyAMA0 --my-rs485-de-pin=37
    

    The arduino sketch is configured with

    #define MY_DEBUG
    #define MY_RS485
    
    #define MY_RS485_DE_PIN 2
    
    #define MY_RS485_BAUD_RATE 9600
    #define MY_BAUD_RATE 9600
    #define MY_NODE_ID 2
    

    On each RS485 I have a 120 ohm resistor. The arduino and the raspberry are very close so the wires are short

    The parent request from the node to the gateway fails. I have added extra logging on each side, and I see following issue

    • the parent request is received by the gateway
    • but the response to the node is corrupted.

    The gateway write following bytes

    • 1 -> SOH
    • 2 -> destination node
    • 0 -> source address
    • 88 -> command
    • 8 -> message length
    • 2 -> STX

    The node receives

    • 1 -> SOH
    • 65534-> destination node -> ERROR
    • 0 -> source address
    • 65496-> command-> ERROR
    • 8 -> message length
    • 2 -> STX

    As you can see some bits are corrupted
    Expected destination node =2 (in binary 0000 0000 0000 0010), while we received 65534 (in binary 1111 1111 1111 1110). The leading bits are 1 instead of 0
    Same issue about command byte.
    It is 100% reproductible, this message is always received with same values so I don't think it is caused by noise or something like that.

    Any idea about the root cause?

    F 1 Reply Last reply
    0
    • sebastiengS sebastieng

      Hello,

      I am trying to setup a RS485 gateway on a raspberry with an arduino node.

      Raspberry gateway is build with

      ./configure  --my-gateway=ethernet --my-port=8011 --my-transport=rs485 --my-rs485-serial-port=/dev/ttyAMA0 --my-rs485-de-pin=37
      

      The arduino sketch is configured with

      #define MY_DEBUG
      #define MY_RS485
      
      #define MY_RS485_DE_PIN 2
      
      #define MY_RS485_BAUD_RATE 9600
      #define MY_BAUD_RATE 9600
      #define MY_NODE_ID 2
      

      On each RS485 I have a 120 ohm resistor. The arduino and the raspberry are very close so the wires are short

      The parent request from the node to the gateway fails. I have added extra logging on each side, and I see following issue

      • the parent request is received by the gateway
      • but the response to the node is corrupted.

      The gateway write following bytes

      • 1 -> SOH
      • 2 -> destination node
      • 0 -> source address
      • 88 -> command
      • 8 -> message length
      • 2 -> STX

      The node receives

      • 1 -> SOH
      • 65534-> destination node -> ERROR
      • 0 -> source address
      • 65496-> command-> ERROR
      • 8 -> message length
      • 2 -> STX

      As you can see some bits are corrupted
      Expected destination node =2 (in binary 0000 0000 0000 0010), while we received 65534 (in binary 1111 1111 1111 1110). The leading bits are 1 instead of 0
      Same issue about command byte.
      It is 100% reproductible, this message is always received with same values so I don't think it is caused by noise or something like that.

      Any idea about the root cause?

      F Offline
      F Offline
      fsgraz
      wrote on last edited by
      #2

      @sebastieng too much load ? one 120ohm on the far one should be enough

      1 Reply Last reply
      0
      • sebastiengS Offline
        sebastiengS Offline
        sebastieng
        wrote on last edited by
        #3

        FYI, I have found my error

        The description of my setup was not totally correct, I don't use an arduino but a atmega328p standalone.
        The root cause was the use of the internal oscillator, it is not enough accurate. I am now using an external quarz and it is working fine

        OldSurferDudeO 1 Reply Last reply
        1
        • sebastiengS sebastieng

          FYI, I have found my error

          The description of my setup was not totally correct, I don't use an arduino but a atmega328p standalone.
          The root cause was the use of the internal oscillator, it is not enough accurate. I am now using an external quarz and it is working fine

          OldSurferDudeO Offline
          OldSurferDudeO Offline
          OldSurferDude
          wrote on last edited by
          #4

          @sebastieng Thanks for letting us and future readers know.

          -OSD

          1 Reply Last reply
          0

          Hello! It looks like you're interested in this conversation, but you don't have an account yet.

          Getting fed up of having to scroll through the same posts each visit? When you register for an account, you'll always come back to exactly where you were before, and choose to be notified of new replies (either via email, or push notification). You'll also be able to save bookmarks and upvote posts to show your appreciation to other community members.

          With your input, this post could be even better 💗

          Register Login
          Reply
          • Reply as topic
          Log in to reply
          • Oldest to Newest
          • Newest to Oldest
          • Most Votes


          53

          Online

          12.0k

          Users

          11.2k

          Topics

          113.4k

          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