Page 1 of 1
Virtual Modbus RTU /dev/USB0 not visible
Posted: 30 Jan 2024, 09:28
by chris74
Hello everyone,
I am using a RevPi Core S8 with Buster V10.
I would like to use an Arduino to read existing sensors via i2c. Both boards are connected via USB and the Arduino is integrated via a virtual Modbus RTU master.
This procedure was outlined in
https://revolutionpi.de/blog/maker-herz (german article).
The settings in Pictory were made accordingly, I would like to read out 20 words, and the com settings are among others device_path=/dev/ttyUSB0.
Unfortunately, /dev/ttyUSB0 is not visible in the operating system, but that would be necessary to "pick up" the data in the process image, right?
I would be grateful for any support / suggestions.
Thanks,
Chris
Re: Virtual Modbus RTU /dev/USB0 not visible
Posted: 30 Jan 2024, 09:47
by dirk
Hi Chris, can you make a sketch of your setup? I recommend you try the communication as in the video tutorial #22 with the QModMaster software instead of PiCtory Modbus Client (formerly Master) first to check your wiring:
https://revolutionpi.com/tutorials/video-tutorials#VT22
Re: Virtual Modbus RTU /dev/USB0 not visible
Posted: 01 Feb 2024, 12:48
by chris74
Hello Dirk,
To establish a connection with an Arduino, I did the following.
For the wiring, the Revpi and Arduino are connected directly with an USB cable.
For a Modbus RTU Slave device on the Arduino side, I download the sample sketch "Arduino Coupling" from the download page (
https://revolutionpi.com/tutorials/downloads).
In the Pictory, I added a virtual Modbus RTU Master.
The device appears as:
Address: 0 module type: 95 (0x5f) RevPi Core V1.2
Module is present
input offset: 113 length: 6
output offset: 119 length: 5
Address: 31 module type: 96 (0x60) RevPi DIO V1.5
Module is present
input offset: 0 length: 70
output offset: 70 length: 18
Address: 64 module type: 24580 (0x6004) ModbusRTU Master Adapter V0.0
Module is present
input offset: 124 length: 101
output offset: 225 length: 73
The Arduino appears as /dev/ttyACM0.
Maybe I'm wrong, or maybe there are other, cleverer ways to interconnect both devices.
However, the video you sent me follows another approach, as the Revpi is configured as a Modbus TCP Slave, right? If this is the better way to configure the Arduino as a Modbus TCP master, then I will take it.
Sorry for the very basic questions, but I've never done this before.
Thanks,
Chris
Re: Virtual Modbus RTU /dev/USB0 not visible
Posted: 01 Feb 2024, 16:37
by dirk
Hi Chris, ok maybe I made a mistake here because it would be clear to me that the communication via Modbus-RTU should work via RS485 and not via USB, but perhaps I was wrong on that assumption. I need to get this working with a compatible Arduino board and will get back to you. I have an incompatible Arduino Due here - it doesn't compile. Thanks for your patience.
Re: Virtual Modbus RTU /dev/USB0 not visible
Posted: 01 Feb 2024, 17:10
by chris74
Thanks Dirk,
meanwhile, I have come one step further:
I am still using the Modbus RTU Slave device on the Arduino side "Arduino Coupling" from
https://revolutionpi.com/tutorials/downloads.
Based on (with modifications)
https://blog.mbedded.ninja/programming/ ... ing-c-cpp/
I am using C/C++ Linux' serial port functions to read out the data stream on the Revpi side. But it needs still some tweaking.
It is still a workaround and needs to be optimized for integration into the process image. So I will continue to work on it .....
Thanks,
Chris
Re: Virtual Modbus RTU /dev/USB0 not visible
Posted: 12 Feb 2024, 09:58
by dirk
Hi Chris, thank you for your positive feedback.