12 063
правки
(Новая страница: «In older firmware versions <syntaxhighlight lang="bash">| xxd -r -p</syntaxhighlight> wasn't necessary») |
(Новая страница: «---- 4. Determine the current address of the device connected to the Wiren Board. The address is unknown to us and we do not want to change it. To do this, at the…») |
||
Строка 124: | Строка 124: | ||
---- | ---- | ||
4. | 4. Determine the current address of the device connected to the Wiren Board. The address is unknown to us and we do not want to change it. To do this, at the command line, run a cyclic command to poll the register of 0x80 devices with addresses from 1 to 247: | ||
<syntaxhighlight lang="bash">root@wirenboard:~# for i in {1..247}; do modbus_client -mrtu /dev/ttyAPP1 --debug -a$i -t3 -r0x80 -s2 -pnone; done 2>/dev/null | grep Data: </syntaxhighlight> | <syntaxhighlight lang="bash">root@wirenboard:~# for i in {1..247}; do modbus_client -mrtu /dev/ttyAPP1 --debug -a$i -t3 -r0x80 -s2 -pnone; done 2>/dev/null | grep Data: </syntaxhighlight> | ||
Answer | |||
<syntaxhighlight lang="bash"> Data: 0x0072</syntaxhighlight> | <syntaxhighlight lang="bash"> Data: 0x0072</syntaxhighlight> | ||
Result: the address of the connected device is 0x0072, i.e. 114. It takes a little more than 2 minutes to search all addresses from 1 to 247. | |||
---- | ---- |
правки