Forum Home › Forums › Rapid SCADA on Linux Controllers and Raspberry Pi › Communication on Raspberry Pi with Device
- This topic has 10 replies, 4 voices, and was last updated 3 years, 2 months ago by hethongscada62.
-
AuthorPosts
-
May 17, 2019 at 3:23 am #5463scadarapidParticipant
Hi.
I use RapidScada on Raspberry Pi, and I have noticed that sometime the communication on raspberry pi with device is slow ,may be 5 minutes,after that communication will come back to normal.
At that time, what happen to communication of Rapidscada with devices on RPi?
How can I solve this problem.Thank you so much.
May 17, 2019 at 4:15 pm #5466MikhailModeratorHi,
You need to analyze Communicator logs, CPU and memory usage.
January 29, 2021 at 4:59 am #8194hethongscada62ParticipantDear Mr.Mikhail,
To continue this topic, i need your help. My project is working properly on Raspberry Pi4. Many RS485 devices are communicating with server on Raspberry Pi4 via RS485-WiFi converter (TCP/IP), but unusable. Now i want to replace a Modbus TCP/IP protocal by Modbus RTU. That’s mean the RS485-USB converter will be used. So could you let me know how to configure the PortName for USB on Rapid Scada Communicator?
Thanks and best regards
Han HoangJanuary 29, 2021 at 8:56 am #8196hethongscada62ParticipantDear Mr.Mikhail,
I want to note that the RS485-USB converter is recognised by Raspberry Pi4:
“Bus 001 Device 004: ID 1a86:7523 QinHeng Electronics HL-340 USB-Serial adapter”
Thank you again
Han HoangJanuary 29, 2021 at 9:17 am #8197hethongscada62ParticipantDear Mr.Mikhail,
I want to replace some words “but unusable” by “but unstable”.
ThanksJanuary 29, 2021 at 1:01 pm #8198manjey73ParticipantUse an online translator. The rules can bind the USB-RS485 converter to a specific port name, depending on which USB port you connect the device to. Then the port name will look like /dev/mydev/Com1 or Com3 and so on
January 29, 2021 at 1:07 pm #8199manjey73ParticipantIn general, by default, all ports have the form /dev/ttyUSBx, where instead of x, the number is from 0 and on. But if you have two or more devices, sometimes the numbers change. So that the number does not change and the Udev rule is made and the device has the same name, but it is bound to a specific port via symlink.
January 29, 2021 at 2:30 pm #8200hethongscada62ParticipantDear manjey73,
Thank you for your reply.
When i done a command: Sudo lsusb, i saw this “Bus 001 Device 004: ID 1a86:7523 QinHeng Electronics HL-340 USB-Serial adapter”. I did not see any /dev/ttyUSBx.
Maybe have to use another USB-RS485 converter, for example USB-RS485 converter FT232.
ThanksJanuary 30, 2021 at 8:51 am #8202manjey73ParticipantRun the
dmesg | grep usb
command and look at the output, there you will find the port number to which the USB-RS485 is connected, and in your case, most likely the serial number of the device. Cheap devices don’t have a serial number and can only be linked to the USB port number on the RaspberryUDEV rules must be applied when you connect two or more USB-RS485 devices. In your case, it will most likely be /dev/ttyUSB0
January 30, 2021 at 9:12 am #8205manjey73ParticipantBus 001 Device 006: ID 1a86:7523 QinHeng Electronics HL-340 USB-Serial adapter
Bus 001 Device 005: ID 1a86:7523 QinHeng Electronics HL-340 USB-Serial adapter
Bus 001 Device 004: ID 067b:2303 Prolific Technology, Inc. PL2303 Serial PortI didn’t pay attention, you have a cheap USB-RS485 converter, I have the same ones.
But I have only 3 pieces installed. And at the time of reboot, they can change their numbers, for example, from /dev/ttyUSB0 to /dev/ttyUSB1, which is unacceptable for the system to work.
So I apply the Udev rules so that they are named as I want, regardless of what number the device received.dmesg | grep usb
[ 2.031971] usb 1-1.2: new full-speed USB device number 4 using dwc_otg [ 2.164990] usb 1-1.2: New USB device found, idVendor=067b, idProduct=2303, bcdDevice= 3.00 [ 2.165006] usb 1-1.2: New USB device strings: Mfr=1, Product=2, SerialNumber=0 [ 2.165015] usb 1-1.2: Product: USB-Serial Controller [ 2.165025] usb 1-1.2: Manufacturer: Prolific Technology Inc. [ 2.262025] usb 1-1.3: new full-speed USB device number 5 using dwc_otg [ 2.395529] usb 1-1.3: New USB device found, idVendor=1a86, idProduct=7523, bcdDevice= 2.54 [ 2.395550] usb 1-1.3: New USB device strings: Mfr=0, Product=2, SerialNumber=0 [ 2.395559] usb 1-1.3: Product: USB2.0-Serial [ 2.491981] usb 1-1.5: new full-speed USB device number 6 using dwc_otg [ 2.625521] usb 1-1.5: New USB device found, idVendor=1a86, idProduct=7523, bcdDevice= 2.54 [ 2.625539] usb 1-1.5: New USB device strings: Mfr=0, Product=2, SerialNumber=0 [ 2.625549] usb 1-1.5: Product: USB2.0-Ser! [ 2.944434] usbcore: registered new interface driver usbserial_generic [ 2.944504] usbserial: USB Serial support registered for generic [ 2.953464] usbcore: registered new interface driver ch341 [ 2.953554] usbserial: USB Serial support registered for ch341-uart [ 2.965080] usb 1-1.3: ch341-uart converter now attached to ttyUSB0 [ 2.975967] usb 1-1.5: ch341-uart converter now attached to ttyUSB1 [ 3.042552] usbcore: registered new interface driver pl2303 [ 3.042659] usbserial: USB Serial support registered for pl2303 [ 3.058874] usb 1-1.2: pl2303 converter now attached to ttyUSB2 [ 3.955816] usbcore: registered new interface driver brcmfmac [13594.241044] pl2303 ttyUSB2: usb_serial_generic_read_bulk_callback - urb stopped: -32
see the output of the command
usb 1-1.3: ch341-uart converter now attached to ttyUSB0
usb 1-1.5: ch341-uart converter now attached to ttyUSB1
usb 1-1.2: pl2303 converter now attached to ttyUSB2Here 1.3 is the number of the USB port on the Raspberry and /dev/ttyUSB0 what is the port number received by the device
January 30, 2021 at 6:47 pm #8206hethongscada62ParticipantDear manjey73,
I saw the name port for my USB.
Thank you very much.
Han Hoang -
AuthorPosts
- You must be logged in to reply to this topic.