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. Hardware
  3. rpi 3 ethernet gateway to serial rs485

rpi 3 ethernet gateway to serial rs485

Scheduled Pinned Locked Moved Hardware
2 Posts 2 Posters 968 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.
  • T Offline
    T Offline
    trentbliss
    wrote on last edited by
    #1

    Hi

    I have set up my rpi 3 b+ with raspbian lite to the following page.

    https://forum.mysensors.org/topic/6960/raspberry-pi-3-as-gateway-using-rs485

    ./configure --my-rs485-serial-port=/dev/serial0 --my-gateway=ethernet --my-port=5003 --my-transport=rs485 --my-rs485-baudrate=9600 --my-rs485-de-pin=37 --my-leds-err-pin=12 --my-leds-rx-pin=16 --my-leds-tx-pin=18
    
    pi@raspberrypi:~/MySensors $ sudo ./configure
    [SECTION] Detecting target machine.
      [OK] machine detected: SoC=BCM2837, Type=rpi3, CPU=armv7l.
    [SECTION] Detecting SPI driver.
      [OK] SPI driver detected:BCM.
    [SECTION] Gateway configuration.
      [OK] Type: ethernet.
      [OK] Transport: rs485.
      [OK] Signing: Disabled.
      [OK] Encryption: Disabled.
    [SECTION] Detecting init system.
      [OK] Init system detected: systemd.
    [SECTION] Saving configuration.
      [OK] Saved.
    [SECTION] Cleaning previous builds.
      [OK] Finished.
    pi@raspberrypi:~/MySensors $
    

    When i run the code i get

    pi@raspberrypi:~/MySensors $ sudo ./bin/mysgw
    Sep 23 03:33:43 INFO  Starting gateway...
    Sep 23 03:33:43 INFO  Protocol version - 2.3.0
    Sep 23 03:33:43 DEBUG MCO:BGN:INIT GW,CP=RSNGL---,VER=2.3.0
    Sep 23 03:33:43 DEBUG TSF:LRT:OK
    Sep 23 03:33:43 DEBUG TSM:INIT
    Sep 23 03:33:43 DEBUG TSF:WUR:MS=0
    Sep 23 03:33:43 DEBUG Serial port /dev/serial0 (9600 baud) created
    Sep 23 03:33:43 DEBUG TSM:INIT:TSP OK
    Sep 23 03:33:43 DEBUG TSM:INIT:GW MODE
    Sep 23 03:33:43 DEBUG TSM:READY:ID=0,PAR=0,DIS=0
    Sep 23 03:33:43 DEBUG MCO:REG:NOT NEEDED
    Sep 23 03:33:43 DEBUG Listening for connections on 0.0.0.0:5003
    Sep 23 03:33:43 DEBUG MCO:BGN:STP
    Sep 23 03:33:43 DEBUG MCO:BGN:INIT OK,TSP=1
    

    then i use cas modbus scanner to send a command

    then i get

    Sep 23 03:33:51 DEBUG New connection from 192.168.6.66
    Sep 23 03:33:51 DEBUG GWT:TSA:C=0,CONNECTED
    

    But nothing else happens. I then manually disconnect CMS

    Sep 23 05:25:11 DEBUG GWT:TSA:C=0,DISCONNECTED
    Sep 23 05:25:11 DEBUG Ethernet client disconnected.
    

    When i do a write command CMS says it was successful but it didn't send command to my device.

    When i write a read holding register command it replies with unknown error.

    Can anyone point me to where this is not working correctly.

    mfalkviddM 1 Reply Last reply
    0
    • T trentbliss

      Hi

      I have set up my rpi 3 b+ with raspbian lite to the following page.

      https://forum.mysensors.org/topic/6960/raspberry-pi-3-as-gateway-using-rs485

      ./configure --my-rs485-serial-port=/dev/serial0 --my-gateway=ethernet --my-port=5003 --my-transport=rs485 --my-rs485-baudrate=9600 --my-rs485-de-pin=37 --my-leds-err-pin=12 --my-leds-rx-pin=16 --my-leds-tx-pin=18
      
      pi@raspberrypi:~/MySensors $ sudo ./configure
      [SECTION] Detecting target machine.
        [OK] machine detected: SoC=BCM2837, Type=rpi3, CPU=armv7l.
      [SECTION] Detecting SPI driver.
        [OK] SPI driver detected:BCM.
      [SECTION] Gateway configuration.
        [OK] Type: ethernet.
        [OK] Transport: rs485.
        [OK] Signing: Disabled.
        [OK] Encryption: Disabled.
      [SECTION] Detecting init system.
        [OK] Init system detected: systemd.
      [SECTION] Saving configuration.
        [OK] Saved.
      [SECTION] Cleaning previous builds.
        [OK] Finished.
      pi@raspberrypi:~/MySensors $
      

      When i run the code i get

      pi@raspberrypi:~/MySensors $ sudo ./bin/mysgw
      Sep 23 03:33:43 INFO  Starting gateway...
      Sep 23 03:33:43 INFO  Protocol version - 2.3.0
      Sep 23 03:33:43 DEBUG MCO:BGN:INIT GW,CP=RSNGL---,VER=2.3.0
      Sep 23 03:33:43 DEBUG TSF:LRT:OK
      Sep 23 03:33:43 DEBUG TSM:INIT
      Sep 23 03:33:43 DEBUG TSF:WUR:MS=0
      Sep 23 03:33:43 DEBUG Serial port /dev/serial0 (9600 baud) created
      Sep 23 03:33:43 DEBUG TSM:INIT:TSP OK
      Sep 23 03:33:43 DEBUG TSM:INIT:GW MODE
      Sep 23 03:33:43 DEBUG TSM:READY:ID=0,PAR=0,DIS=0
      Sep 23 03:33:43 DEBUG MCO:REG:NOT NEEDED
      Sep 23 03:33:43 DEBUG Listening for connections on 0.0.0.0:5003
      Sep 23 03:33:43 DEBUG MCO:BGN:STP
      Sep 23 03:33:43 DEBUG MCO:BGN:INIT OK,TSP=1
      

      then i use cas modbus scanner to send a command

      then i get

      Sep 23 03:33:51 DEBUG New connection from 192.168.6.66
      Sep 23 03:33:51 DEBUG GWT:TSA:C=0,CONNECTED
      

      But nothing else happens. I then manually disconnect CMS

      Sep 23 05:25:11 DEBUG GWT:TSA:C=0,DISCONNECTED
      Sep 23 05:25:11 DEBUG Ethernet client disconnected.
      

      When i do a write command CMS says it was successful but it didn't send command to my device.

      When i write a read holding register command it replies with unknown error.

      Can anyone point me to where this is not working correctly.

      mfalkviddM Offline
      mfalkviddM Offline
      mfalkvidd
      Mod
      wrote on last edited by mfalkvidd
      #2

      Welcome to the MySensors forum @trentbliss

      Could you explain what CMS is in this context?

      What is a read holding register command?

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


      22

      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