Python Forum
Raspberry + RS485 shield | pySerial
Thread Rating:
  • 3 Vote(s) - 2.67 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Raspberry + RS485 shield | pySerial
#1
Hello,

I am using a RS485 shield for Raspberry v3 together with the pySerial class provided by Python to communicate with a device through the serial port.
The device I am communicating with, uses the S-Bus protocol and has a physical output with D+/D- and ground.
The device has a proprietary software that displays, in hex, what is broadcast and received on the device and on any other supplementary devices attached to it.
So, regarding topology, I went from the device's S-Bus port into the RS485 shield attached to the Raspberry.
At first, I was not sure that I will receive anything while listening to the port since I wasn't sure of the compatibility. Had to try it tough..

After I did the setup and made a little code in python using the pySerial class I was able to receive the same messages that are shown in the proprietary software of the device.
As a mention, in python, I had to encode the message received, to hex to have an exact match with what the proprietary software was displaying.

On the proprietary software I can give commands to the device and this device can trigger, from example, a relay.
While giving such a command and while monitoring the communication between the Raspberry and the device I "recorded" all the messages, in hex, that were transmitted on the S-bus protocol, including the code sent from the proprietary software to the device to trigger the relay.

My goal is to send the same command (as hex code) that triggers the relay from Raspberry and not from the proprietary software; and to work of course :D.
My logic (faulty or not ) was that sending the same hex code as the proprietary software sent to the device to trigger the relay should have the same effect. This seems like Captain Obvious.

Unfortunately, it didn't happen.
The message leaves the Raspberry (the led on the RS485 shield confirms it) but the relay isn't triggered and nothing is shown on the proprietary software display.
As a mention, I managed to command the relay with commands from the Raspberry to the device on the RS485 port also present on the device.
I am trying to make the commands work through the S-Bus port since it will benefit more.

Any ideas, hints of what could cause that ? Things to try ?

Serial Novice :D
Reply


Messages In This Thread
Raspberry + RS485 shield | pySerial - by Coada - Feb-24-2017, 12:04 PM
RE: Raspberry + RS485 shield | pySerial - by Coada - Mar-01-2017, 07:54 AM
RE: Raspberry + RS485 shield | pySerial - by Coada - Apr-13-2017, 01:55 PM

Possibly Related Threads…
Thread Author Replies Views Last Post
  help with code for USB-RS485 korenron 3 5,065 Nov-17-2022, 09:04 AM
Last Post: wiseweezer
  Help reading data from serial RS485 korenron 8 19,788 Nov-14-2021, 06:49 AM
Last Post: korenron
Photo Raspberry PI writing to RS485 driver, DIR pin not holding state zazas321 2 3,102 Oct-30-2020, 06:23 AM
Last Post: zazas321

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020