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. ESP32/ESP8266 RS485 gateway - example needed

ESP32/ESP8266 RS485 gateway - example needed

Scheduled Pinned Locked Moved Troubleshooting
3 Posts 3 Posters 45 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.
  • Konrad WiniarskiK Offline
    Konrad WiniarskiK Offline
    Konrad Winiarski
    wrote on last edited by
    #1

    Hi there!
    Did anyone tried (successfuly) to use ESP32 as gateway for RS485 nodes?
    So far I tried to (testing on ESP8266):

    1. ...use example for Serial Gateway: https://www.mysensors.org/build/rs485 but no success. AltSoftwareSerial is not working with ESP32, it won't compile,
    2. ...search for solution to replace AltSoftwareSerial to EspSoftwareSerial - but nothing found,
    3. ...change to HWSerial (#define MY_RS485_HWSERIAL Serial1 // also checked with Serial) but there is no data "comming out" from TX pin (except ESP "junk" and the start),

    Some debug info:

    • The node (Arduino) is the code from example: https://www.mysensors.org/build/rs485:
    381282 TSM:FAIL:RE-INIT
    381284 TSM:INIT
    381285 TSM:INIT:TSP OK
    381287 TSF:SID:OK,ID=10
    381290 TSM:FPAR
    381308 ?TSF:MSG:SEND,10-10-255-255,s=255,c=3,t=7,pt=0,l=0,sg=0,ft=0,st=OK:
    383316 !TSM:FPAR:NO REPLY
    383319 TSM:FPAR
    383337 ?TSF:MSG:SEND,10-10-255-255,s=255,c=3,t=7,pt=0,l=0,sg=0,ft=0,st=OK:
    385345 !TSM:FPAR:NO REPLY
    385347 TSM:FPAR
    385366 ?TSF:MSG:SEND,10-10-255-255,s=255,c=3,t=7,pt=0,l=0,sg=0,ft=0,st=OK:
    387374 !TSM:FPAR:NO REPLY
    387376 TSM:FPAR
    387394 ?TSF:MSG:SEND,10-10-255-255,s=255,c=3,t=7,pt=0,l=0,sg=0,ft=0,st=OK:
    389402 !TSM:FPAR:FAIL
    389404 TSM:FAIL:CNT=7
    389406 TSM:FAIL:DIS
    389408 TSF:TDI:TSL
    
    • the data is transmitted out to RS485 (checked with another TTL-USB converter), hex:
    01 FF 0A 58 07 02 0A 0A FF 02 03 07 FF 03 86 04
    
    • the data is received from RS485 (same content) as above - DE/RE pins are controlled from ESP (at least Low State is set)
    • RO is connected to RX pin at ESP32
    • no response is comming out from TX pin (except junk at start)

    The code:
    Thanks in advance for hints!
    Konrad

    B 1 Reply Last reply
    0
    • Konrad WiniarskiK Konrad Winiarski

      Hi there!
      Did anyone tried (successfuly) to use ESP32 as gateway for RS485 nodes?
      So far I tried to (testing on ESP8266):

      1. ...use example for Serial Gateway: https://www.mysensors.org/build/rs485 but no success. AltSoftwareSerial is not working with ESP32, it won't compile,
      2. ...search for solution to replace AltSoftwareSerial to EspSoftwareSerial - but nothing found,
      3. ...change to HWSerial (#define MY_RS485_HWSERIAL Serial1 // also checked with Serial) but there is no data "comming out" from TX pin (except ESP "junk" and the start),

      Some debug info:

      • The node (Arduino) is the code from example: https://www.mysensors.org/build/rs485:
      381282 TSM:FAIL:RE-INIT
      381284 TSM:INIT
      381285 TSM:INIT:TSP OK
      381287 TSF:SID:OK,ID=10
      381290 TSM:FPAR
      381308 ?TSF:MSG:SEND,10-10-255-255,s=255,c=3,t=7,pt=0,l=0,sg=0,ft=0,st=OK:
      383316 !TSM:FPAR:NO REPLY
      383319 TSM:FPAR
      383337 ?TSF:MSG:SEND,10-10-255-255,s=255,c=3,t=7,pt=0,l=0,sg=0,ft=0,st=OK:
      385345 !TSM:FPAR:NO REPLY
      385347 TSM:FPAR
      385366 ?TSF:MSG:SEND,10-10-255-255,s=255,c=3,t=7,pt=0,l=0,sg=0,ft=0,st=OK:
      387374 !TSM:FPAR:NO REPLY
      387376 TSM:FPAR
      387394 ?TSF:MSG:SEND,10-10-255-255,s=255,c=3,t=7,pt=0,l=0,sg=0,ft=0,st=OK:
      389402 !TSM:FPAR:FAIL
      389404 TSM:FAIL:CNT=7
      389406 TSM:FAIL:DIS
      389408 TSF:TDI:TSL
      
      • the data is transmitted out to RS485 (checked with another TTL-USB converter), hex:
      01 FF 0A 58 07 02 0A 0A FF 02 03 07 FF 03 86 04
      
      • the data is received from RS485 (same content) as above - DE/RE pins are controlled from ESP (at least Low State is set)
      • RO is connected to RX pin at ESP32
      • no response is comming out from TX pin (except junk at start)

      The code:
      Thanks in advance for hints!
      Konrad

      B Offline
      B Offline
      benb
      wrote on last edited by
      #2

      @Konrad-Winiarski i tried this in the last days as well. It seems as if AltSoftSerial would be working if the right module names in the library boards definitions would be included. I searched for the wemos d1 mini and lolin esp32 lines but could not find them up to now.

      Did you come any further since your post in 2021?

      1 Reply Last reply
      0
      • J Offline
        J Offline
        JeeLet
        wrote on last edited by
        #3

        Dual Transport (dual bus)

        Hello
        Yes a Gateway with several buses or a Node with two different buses would be a good thing.

        You may have seen the post and the version of @tekka

        https://forum.mysensors.org/topic/11135/something-s-cooking-in-the-mysensors-labs?_=1674118354490
        . maybe not a problem for you
        "tekka's personal fork from the MySensors 2.4 branch and has not been updated"

        https://github.com/tekka007/MySensors/tree/UpdateMultiTransport

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


        12

        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