Hallo
Grundlegendes (bin Ahnungsloser); Raspi 3B, OS: Trixie 13.2
USB RS485 Adapter (https://de.aliexpress.com/item/1005008797398925.html blaue FT232)
ls -l /dev/serial/by-id/ -> usb-FTDI_FT232R_USB_UART_A5069RR4-if00-port0 -> ../../ttyUSB0
Frage a) was ist hier für config am Raspi nötig ?
Minicom meldet: 9600 8N1 | NOR | Minicom 2.10 | VT102 | Offline | ttyUSB0 (hab in Minicom schon diveres settings probiert)
Frage b) Falls das dann funktioniert, wie kann ich die Kommunikation am besten testen? Vielleicht hat jemand entsprechende Erfahrung
Die RS485 Seite ist mit einem Digital Input Board verbunden (Testaufbau, hat am Laptop funktioniert, siehe Beispiele). Das Format der Aufrufe ist hier RS485-Adr (1), Funktionscode(1) , Registeradresse(2) Anzahl(2) CRC-16(2) (Modbus-RTU, CRC16/Modbus)
Beispiele: 01 02 00 00 00 08 79 CC -> 01 02 01 01 60 48 , 01 02 00 00 00 30 78 1E -> 01 02 06 01 02 06 20 A0 60 E1 C2
Ich hab mir mbpoll angesehen, weiß aber nicht wie ich die richtige Befehlssyntax zusammenbring um damit der output 01 02 00 00 00 08 79 CC generiert wird.
ZB: mbpoll -m RTU -a 1 -r 1 -c 8 /dev/ttyUSB0 -b9600 -d 8 -s 1 -P none -v
Opening /dev/ttyUSB0 at 9600 bauds (N, 8, 1)
Set response timeout to 1 sec, 0 us
Protocol configuration: ModBus RTU
Slave configuration...: address = [1]
start reference = 1, count = 8
Communication.........: /dev/ttyUSB0, 9600-8N1
t/o 1.00 s, poll rate 1000 ms
Data type.............: 16-bit register, output (holding) register table
-- Polling slave 1... Ctrl-C to stop)
[01][03][00][00][00][08][44][0C]
Waiting for a confirmation...
ERROR Connection timed out: select
Read output (holding) register failed: Connection timed out
-- Polling slave 1... Ctrl-C to stop)
Danke für hilfreiche Infos, LG Herbert