Here is the script I have written:
./modpoll.bin -m rtu -a 1 -t 4:float -r 159 -b 9600 -s 1 -P none /dev/ttyS2
Got error as below:
@ruggedboard-a5d2x:/data/meter# sh modpoll.sh
modpoll: Unrecognized option or missing option parameter! Try -h for help.
@ruggedboard-a5d2x:/data/meter#
@ruggedboard-a5d2x:/data/meter# sh modpoll.sh
modpoll: Unrecognized option or missing option parameter! Try -h for help.
@ruggedboard-a5d2x:/data/meter#
Please help!
The correct code line for the script is: ./modpoll.bin -m rtu -a 1-t 4:float -r 159 -b 9600 -s 1 -p none /dev/ttyS2
@ruggedboard-a5d2x:/data# ./modpoll.bin -m rtu -a 65 -t 4:float -r 0001 -b 2400
-s 1 -p none /dev/ttyS2
modpoll 3.7 - aieldTalk(tm) Modbus(R) Master Simulatortmel_usart_serial atmel_usart_serial.2.auto: using dma0chan7 for rx DMA transfers
atmel_usart_serial atmel_usart_serial.2.auto: using dma0chan8 for tx DMA transfers
Copyright (c) 2002-2019 proconX Pty Ltd
Visit https://www.modbusdriver.com for Modbus libraries and tools.
Protocol configuration: Modbus RTU
Slave configuration...: address = 65, start reference = 1, count = 1
Communication.........: /dev/ttyS2, 2400, 8, 1, none, t/o 1.00 s, poll rate 1000 ms
Data type.............: 32-bit float, output (holding) register table
-- Polling slave... (Ctrl-C to stop)
[1]: 0.000000
-- Polling slave... (Ctrl-C to stop)
[1]: 0.000000
-- Polling slave... (Ctrl-C to stop)
[1]: 0.000000
-- Polling slave... (Ctrl-C to stop)
[1]: 0.000000
-- Polling slave... (Ctrl-C to stop)
[1]: 0.000000
-- Polling slave... (Ctrl-C to stop)
[1]: 0.000000
-- Polling slave... (Ctrl-C to stop)
[1]: 0.000000
-- Polling slave... (Ctrl-C to stop)
[1]: 0.000000
-- Polling slave... (Ctrl-C to stop)
[1]: 0.000000
-- Polling slave... (Ctrl-C to stop)