Testing "Wave USB to RS485 Industrial Converter" to 8CH relay on Linux using modpoll

Hi,

I bought 2 x Waveshare products, which I want to hook up to Node-RED - once I can confirm that they work:

I am not able to get these products talking to one another on Raspberry Pi per my tests with modpoll on modbusdriver - a terminal app.

I have done the following (Raspberry Pi - 3B+ - with latest Buster OS):

  1. Connected products (Relay to Power 5V, Relay to USB 3 wires or RS485, GND, A+, B-; and USB)
  2. Checked the drivers on RPi - (already in the latest kernel of OS Buster) - checked this with command lsmod | grep "usbserial" gives the output: usbserial 36864 1 ftdi_sio- which is correct.
  3. Checked the starting up of the driver against the mounting of USB ls -l /dev/ttyUSB0.
  4. Added my uid to dialout, for my uid to have access to the /dev/ttyUSB0 (command groups includes dialout)
  5. sudo raspi-config / 5 Interfacing Options / a6 Serial / enable.
  6. Installed ModBus testing software to be run from ssh, with commands:
    a) wget https://www.modbusdriver.com/downloads/modpoll.tgz
    b) tar xzf modpoll.tgz && rm modpoll.tgz
    c) export PATH=$PWD/modpoll/linux_arm-eabihf:$PATH
  7. Tested the above config with modbusdriver modpoll, as follows:

modpoll -m rtu -b 9600 /dev/ttyUSB0

Above command gives the following:

modpoll 3.9 - FieldTalk(tm) Modbus(R) Master Simulator
Copyright (c) 2002-2020 proconX Pty Ltd
Visit https://www.modbusdriver.com for Modbus libraries and tools.

Protocol configuration: Modbus RTU, FC3
Slave configuration...: address = 1, start reference = 1, count = 1
Communication.........: /dev/ttyUSB0, 9600, 8, 1, even, t/o 1.00 s, poll rate 1000 ms
Data type.............: 16-bit register, output (holding) register table

-- Polling slave...
Reply time-out!

When I send this command, I can see the Tx light on the USB come on, and the Rx on the 8CH relay come on briefly. So their is comms.

PS: I thought that the 8CH relay's modbus protocols will have some clues, but have not been able to work that out.

What should I do?

If I try connect to USB rs485 device with Node-RED, I also get a timeout. From log file:

10 Dec 21:15:11 - [warn] [modbus-read:174978cb.b7da67] Modbus Failure On State sending Get More About It By Logging
10 Dec 21:15:11 - [error] [modbus-read:174978cb.b7da67] Timed out

Here is the flow:

[{"id":"e4d6becf.7d167","type":"modbus-response","z":"76274d8e.fd5214","name":"","registerShowMax":"10","x":660,"y":40,"wires":[]},{"id":"174978cb.b7da67","type":"modbus-read","z":"76274d8e.fd5214","name":"","topic":"","showStatusActivities":true,"logIOActivities":false,"showErrors":true,"unitid":"1","dataType":"InputRegister","adr":"1","quantity":"1","rate":"30","rateUnit":"s","delayOnStart":false,"startDelayTime":"","server":"4099da6.7419b24","useIOFile":false,"ioFile":"","useIOForPayload":false,"emptyMsgOnFail":false,"x":340,"y":140,"wires":[["e4d6becf.7d167"],["942f710f.4b0c1"]]},{"id":"942f710f.4b0c1","type":"debug","z":"76274d8e.fd5214","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"payload","targetType":"msg","statusVal":"","statusType":"auto","x":750,"y":160,"wires":[]},{"id":"4099da6.7419b24","type":"modbus-client","name":"","clienttype":"simpleser","bufferCommands":true,"stateLogEnabled":true,"queueLogEnabled":false,"tcpHost":"127.0.0.1","tcpPort":"502","tcpType":"DEFAULT","serialPort":"/dev/ttyUSB0","serialType":"RTU","serialBaudrate":"9600","serialDatabits":"8","serialStopbits":"1","serialParity":"none","serialConnectionDelay":"100","unit_id":"1","commandDelay":"1","clientTimeout":"5000","reconnectOnTimeout":false,"reconnectTimeout":"2000","parallelUnitIdsAllowed":true}]

This topic was automatically closed 60 days after the last reply. New replies are no longer allowed.