Hilscher Community Forum
USB to RS485 convetrer - Printable Version

+- Hilscher Community Forum (https://forum.hilscher.com)
+-- Forum: netPI - Industrial Ethernet featuring rugged Raspberry Pi (https://forum.hilscher.com/forum-1.html)
+--- Forum: Software (https://forum.hilscher.com/forum-5.html)
+--- Thread: USB to RS485 convetrer (/thread-653.html)



USB to RS485 convetrer - MGharat - October-19th-2020

Hello,

do USB to RS485 converter work with netPI core directly? we are testing it but face issue. we connected modbus energy meter through our USB to RS485 conveter to USB port of netPI. attached is Modbus flow n settings herewith.
In this we are not able to connect to Modbus meter , no data is received, no error in debug, also the Modbus Read node is always Green even though we remove USB conveter from netPI, I think it is not detected .
one more point we can not search for other serial ports as marked in image.


Is any other setting related to usb driver required? 

Thanks & BR
Madhumati


RE: USB to RS485 convetrer - Armin@netPI - October-19th-2020

Well,

I have no USB to RS485 converter personally. I have a USB to RS232 converter only and it works perfect with netPI product.

My USB converter maps to "/dev/ttyUSB0". So have you verfied that your USB converter also maps to this device? You can verify the exact device when plugging in the device to a commercial Raspberry Pi and list the folder "/dev/". When you plug it in a new folder /dev/ttyUSB0" should appear. So if the device maps to a commercial Raspberry Pi to "/dev/ttyUSB0" then also this device will map on netPI "/dev/ttyUSB0".

As next I would check the function of the converter on a commercial Raspberry Pi first. You can install Docker in your Raspberry Pi too using this command line documented here. Afterwards you can install hilschernetpi/Node-RED container using this command on your commercial Raspberry Pi as well:

Code:
docker volume create nodered && docker run -d --privileged --network=host --restart=always --device=/dev/ttyUSB0:/dev/ttyUSB0 -v nodered:/root/.node-red hilschernetpi/netpi-nodered

Open Node-RED using https://<ip-address of commercial Raspberry Pi>:1880 and check the USB converter function. When it works, then it must work in netPI too.

Then you say you remove the converter from netPI and everything is green. This is a speciality of Docker. When a Docker container is started a shadow device tree is copied to the container. Independent if you remove or add a device online after the container has been started, the shadow tree in the container will never change until you restart the container again. On the other hand this means you have to have inserted the converter before you start the container, else the contain sees no shadowed "/dev/ttyUSB0" device.

The most important point of using a USB device in a container is to map the device "/dev/ttyUSB0" to the container in the container start parameters. Have you done it?

Thx
Armin


RE: USB to RS485 convetrer - MGharat - October-19th-2020

Dear Armin,

Thanks. we did as you suggested & it is working now.

USB to RS 485 converter is working ok with netPI

Thanks for the guidance always.

BR
Madhumati

Dear Armin,

Thanks. we did as you suggested & it is working now.

USB to RS 485 converter is working ok with netPI

Thanks for the guidance always.

BR
Madhumati