I ordered a RS-485 TO WIRELESS CONVERTER (PR55-34M) recently and I’d like to use the API to read the data from RS485 directly with a linux machine.
I have one Smart Vibration Sensor Gen4 up and running. RS485 Converter is connected to a FTDI 485 to USB cable, then plugged into a linux machine. The linux machine can recognize the FTDI cable as ttyUSB0. However, when i tried to send a command to the 485 converter, i got no response. Here is my code
#!/usr/bin/env python3
"""
Send Read PAN ID command to NCD device
"""
import serial
import time
# Command to send
command = bytes([
0x7E, 0x00, 0x13, 0x10, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0xFF, 0xFF, 0xFF, 0xFE, 0x00,
0x00, 0xF7, 0x19, 0x00, 0x00, 0x00, 0xE4
])
# Open serial port
ser = serial.Serial('/dev/ttyUSB0', 115200, timeout=3)
# Send command
print(f"Sending: {command.hex(' ').upper()}")
ser.write(command)
print("Command sent!")
# Wait for response
time.sleep(10)
# Read response
if ser.in_waiting > 0:
response = ser.read(ser.in_waiting)
print(f"Response: {response.hex(' ').upper()}")
else:
print("No response")
ser.close()
Do you guys have any code examples to get the API working for this device?
Hi @xqin For this specific application, you will need the PR55-34_AutoEncoder version. You can select this specific version during the purchasing process. You can fill out an RMA request here: Log In ‹ NCD.io — WordPress to switch your device for the correct version.