socat filter and replace character for modbus ascii
2
votes
1
answer
38
views
The goal is to get modbus ascii working with a Wallbox from ABL.
So I placed a RS485 to TCP converter in the box, created a pseudo tty for my application and got the wrong frame.
The answer starts with
>
and should start with :
.
So my approach is the following:
Terminal1: sudo socat -d -d -d pty,link=/dev/ttyVA00,echo=0,perm=0777 pty,link=/dev/ttyVB00,echo=0,perm=0777
Terminal2: sudo socat -d -d -d pty,link=/dev/ttyV0,perm=0777 tcp:10.10.49.249:502
Terminal3: cat /dev/ttyVB00 > /dev/ttyV0
Terminal4: cat /:/g' > /dev/ttyVB00
Terminal5: ./modpoll -m ascii /dev/ttyVA00 -b 38400 -d 8 -p even -t4 -c 2 -0
And this works!
Could you give advice on how to simplify the socat solution and how to get it to autostart?
Asked by martin
(21 rep)
Jul 31, 2025, 10:49 AM
Last activity: Aug 1, 2025, 08:57 AM
Last activity: Aug 1, 2025, 08:57 AM