RS485 To Wireless Converter API setup

Hello,

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?

Thanks!
Xudong

Just wrote another script to do some more testing. Run the following code to listen to any output from 485 port

code:

#!/usr/bin/env python3
"""
RS-485 Serial Data Listener
"""

import serial
import sys
from datetime import datetime

def print_data(data):
    timestamp = datetime.now().strftime("%Y-%m-%d %H:%M:%S.%f")[:-3]
    hex_str = ' '.join([f'{b:02X}' for b in data])

    print(f"[{timestamp}] Received {len(data)} bytes:")
    print(f"  HEX:   {hex_str}")
    print()

def main():
    # Serial port configuration
    PORT = '/dev/ttyUSB0'
    BAUDRATE = 9600
    BYTESIZE = serial.EIGHTBITS
    PARITY = serial.PARITY_NONE
    STOPBITS = serial.STOPBITS_ONE
    TIMEOUT = 3

    print(f"RS-485 Listener Starting...")
    print(f"Port: {PORT}")
    print(f"Baudrate: {BAUDRATE}")
    print(f"Config: {BYTESIZE}-{PARITY}-{STOPBITS}")
    print("-" * 50)

    try:
        # Open serial port
        ser = serial.Serial(
            port=PORT,
            baudrate=BAUDRATE,
            bytesize=BYTESIZE,
            parity=PARITY,
            stopbits=STOPBITS,
            timeout=TIMEOUT
        )

        print(f"Listening on {PORT}... (Press Ctrl+C to stop)\n")

        # Continuous reading loop
        while True:
            if ser.in_waiting > 0:
                # Read available data
                data = ser.read(ser.in_waiting)
                print_data(data)

    except serial.SerialException as e:
        print(f"Serial port error: {e}", file=sys.stderr)
        print("\nTroubleshooting tips:")
        print("1. Check if the device is connected: ls -l /dev/ttyUSB*")
        print("2. Check permissions: sudo chmod 666 /dev/ttyUSB0")
        print("3. Add user to dialout group: sudo usermod -a -G dialout $USER")
        return 1

    except KeyboardInterrupt:
        print("\nStopping listener...")

    except Exception as e:
        print(f"Unexpected error: {e}", file=sys.stderr)
        return 1

    finally:
        if 'ser' in locals() and ser.is_open:
            ser.close()
            print("Serial port closed.")

    return 0

if __name__ == "__main__":
    sys.exit(main())

Every time i pressed the “R” button, i got the following respons…

RS-485 Listener Starting...
Port: /dev/ttyUSB0
Baudrate: 9600
Config: 8-N-1
--------------------------------------------------
Listening on /dev/ttyUSB0... (Press Ctrl+C to stop)

[2025-10-27 14:30:23.858] Received 8 bytes:
  HEX:   01 03 00 00 00 01 84 0A

Is there any way i can send command directly to this device 485 device without using Node-red?

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.

Thanks,
Eduardo M

Thanks! We’ll fill in the RMA as soon as possible.

Best,
xqin