rpi 3 ethernet gateway to serial rs485
-
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=18pi@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=1then 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,CONNECTEDBut 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.
-
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=18pi@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=1then 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,CONNECTEDBut 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.
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