pockybum522
New member
Hello,
I have purchased RTD Data Acquisition 8-Layer Stackable HAT for Raspberry Pi. RTD functionality works great, I can run "rtd 0 read 2" for example and get back temperature. I am now trying to send basic UART data over the RS-485 interface built into the RTD HAT.
Reading the documentation, it looks like I should set the 485-TERM dip switch to on (Towards the 40pin GPIO header)
As well as the 485-TX dip switch to on.
As well as the 485-RX dip switch to on.
After that, I run "rtd 0 rs485wr 0 0 0 0 0" because the docs say I need to do this to use the RS485 as passthrough. This simply returns "done" so it appears successful.
After that, I've wired B and A on the connector just to the left of the 40 pin header that says RS485 to a digital oscilloscope, I have not wired the RasPi GND to anything, as I don't believe that's necessary for RS-485, but please correct me if I'm wrong. I have no other components or wires hooked up. I'm seeing no activity when attempting to send UART with the very basic python program at the bottom of this post.
I have checked and I can see a 3.3v pulse on the DSO. As the RS485 is -7 to 12v (I believe) I should be seeing its pulses no problem, or so I would think.
How do I tell what serial port I should be using on the raspberry pi to send/recieve UART data on the RS-485 interfece built into the RTD HAT?
(I have tried /dev/tty0, /dev/ttyAMA10 (Which I think is the bluetooth controller, but I tried it anyways.) along with /dev/ttyS0, and /dev/serial0.) and I have tried various configurations of the dip switches when doing this, such as turning off/on TERM and/or turning off/on 485-TX and 485-RX. I have also tried B and A on the connector on the bottom-right of the board. (As viewed when 40-pin GPIO header is at the top) I figured it's time to ask. Thank you for your time and a great product.
When running the code below, I expect to see activity on the DSO once I get the serial port correct.
I have purchased RTD Data Acquisition 8-Layer Stackable HAT for Raspberry Pi. RTD functionality works great, I can run "rtd 0 read 2" for example and get back temperature. I am now trying to send basic UART data over the RS-485 interface built into the RTD HAT.
Reading the documentation, it looks like I should set the 485-TERM dip switch to on (Towards the 40pin GPIO header)
As well as the 485-TX dip switch to on.
As well as the 485-RX dip switch to on.
After that, I run "rtd 0 rs485wr 0 0 0 0 0" because the docs say I need to do this to use the RS485 as passthrough. This simply returns "done" so it appears successful.
After that, I've wired B and A on the connector just to the left of the 40 pin header that says RS485 to a digital oscilloscope, I have not wired the RasPi GND to anything, as I don't believe that's necessary for RS-485, but please correct me if I'm wrong. I have no other components or wires hooked up. I'm seeing no activity when attempting to send UART with the very basic python program at the bottom of this post.
I have checked and I can see a 3.3v pulse on the DSO. As the RS485 is -7 to 12v (I believe) I should be seeing its pulses no problem, or so I would think.
How do I tell what serial port I should be using on the raspberry pi to send/recieve UART data on the RS-485 interfece built into the RTD HAT?
(I have tried /dev/tty0, /dev/ttyAMA10 (Which I think is the bluetooth controller, but I tried it anyways.) along with /dev/ttyS0, and /dev/serial0.) and I have tried various configurations of the dip switches when doing this, such as turning off/on TERM and/or turning off/on 485-TX and 485-RX. I have also tried B and A on the connector on the bottom-right of the board. (As viewed when 40-pin GPIO header is at the top) I figured it's time to ask. Thank you for your time and a great product.
When running the code below, I expect to see activity on the DSO once I get the serial port correct.
import time
import serial
print ("Starting")
ser = serial.Serial("/dev/serial0", baudrate=9600, parity=serial.PARITY_EVEN, stopbits=serial.STOPBITS_ONE, bytesize=serial.EIGHTBITS)
time.sleep(1)
try:
message = b'\xFC\x01\xFA'
while True:
print(message)
ser.write(message)
except KeyboardInterrupt:
ser.close()
print ("Exiting program")
except:
print ("Error!")
finally:
ser.close()
pass