I'd like to connect energy meter with modbus rtu protol (3 pins, gnd, rx, tx) to rpi 3. Do I need to use usb to rs485 converter or can I do it by connection directly to gpio pins (gnd, tx, rx)? What is the next step in codesys if I'd like to read registers from my device? The rpi is master then and meter is a slave? Should I prepare (install, upgrade files etc.) rpi for this connection or it is enought to use Codesys? My rpi is connected with Codesys and it works with other in/out pins well. Thank you very much for your answers.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
szymon077 hat geschrieben:
Hi,
I'd like to connect energy meter with modbus rtu protol (3 pins, gnd, rx, tx) to rpi 3. Do I need to use usb to rs485 converter or can I do it by connection directly to gpio pins (gnd, tx, rx)? What is the next step in codesys if I'd like to read registers from my device? The rpi is master then and meter is a slave? Should I prepare (install, upgrade files etc.) rpi for this connection or it is enought to use Codesys? My rpi is connected with Codesys and it works with other in/out pins well. Thank you very much for your answers.
Hello,
In my case, I use a USB-RS485 adapter connect directly to USB raspberry pi.
It is not necessary to upgrade anything.
After connect USB adapter, use the command "dmesg" to check the port
in my case it reports: ttyUSB0
so you need to add in /etc/CODESYSControl.cfg
(Attention you need to remove the 0 from USB0)
[SysCom]
Linux.Devicefile=/dev/ttyUSB
And ...... voala !!!!!!!!
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Hi,
I'd like to connect energy meter with modbus rtu protol (3 pins, gnd, rx, tx) to rpi 3. Do I need to use usb to rs485 converter or can I do it by connection directly to gpio pins (gnd, tx, rx)? What is the next step in codesys if I'd like to read registers from my device? The rpi is master then and meter is a slave? Should I prepare (install, upgrade files etc.) rpi for this connection or it is enought to use Codesys? My rpi is connected with Codesys and it works with other in/out pins well. Thank you very much for your answers.
Hello,
In my case, I use a USB-RS485 adapter connect directly to USB raspberry pi.
It is not necessary to upgrade anything.
After connect USB adapter, use the command "dmesg" to check the port
in my case it reports: ttyUSB0
so you need to add in /etc/CODESYSControl.cfg
(Attention you need to remove the 0 from USB0)
[SysCom]
Linux.Devicefile=/dev/ttyUSB
And ...... voala !!!!!!!!