Open main menu

DAVE Developer's Wiki β

Changes

Testbed
===Enabling the connection to the PLC===
As described in MISC-TN-024, the PLC is connected to a different subnet, namely 192.168.30.0/24. To test For testing the connection to the PLC, after adding the required subnet configuration, the <code>modbus</code> command line tool was used, which is provided by the <code>modbus_cli</code> package.
<pre class="board-terminal">
root@sbcspg:/usr/local/fledge/python/fledge/plugins/north# ip addr add 192.168.30.253/24 dev eth0 label eth0:1
 
armbian@sbcspg:~/devel/fledge$ pip install modbus_cli
Defaulting to user installation because normal site-packages is not writeable
Requirement already satisfied: modbus_cli in /home/armbian/.local/lib/python3.9/site-packages (0.1.8)
Requirement already satisfied: colorama in /home/armbian/.local/lib/python3.9/site-packages (from modbus_cli) (0.4.6)
Requirement already satisfied: umodbus in /home/armbian/.local/lib/python3.9/site-packages (from modbus_cli) (1.0.4)
Requirement already satisfied: pyserial~=3.4 in /usr/local/lib/python3.9/dist-packages (from umodbus->modbus_cli) (3.5)
 
[notice] A new release of pip is available: 23.0 -> 23.0.1
[notice] To update, run: python3 -m pip install --upgrade pip
...
armbian@sbcspg:~$ ./.local/bin/modbus 192.168.30.42:502 300
Parsed 0 registers definitions from 1 files
300: 32 0x20
</pre>
root@sbcspg:/usr/local/fledge/python/fledge/plugins/north# history | grep mosq 205 history | grep mosq
root@sbcspg:/usr/local/fledge/python/fledge/plugins/north# apt install mosquitto mosquitto-clients
Reading package lists... Done
[notice] A new release of pip is available: 23.0 -> 23.0.1
[notice] To update, run: python3 -m pip install --upgrade pip
 
 
armbian@sbcspg:~/devel/fledge$ ./.local/bin/modbus 192.168.30.42:502 300 Parsed 0 registers definitions from 1 files 300: 33 0x21^C
 
armbian@sbcspg:~/devel/fledge$ cd
 
armbian@sbcspg:~$ ./.local/bin/modbus 192.168.30.42:502 300 Parsed 0 registers definitions from 1 files 300: 33 0x21
Parsed 0 registers definitions from 1 files
KeyError: ':'
^C
armbian@sbcspg:~$ ./.local/bin/modbus 192.168.30.42:502 300
Parsed 0 registers definitions from 1 files
300: 34 0x22
4,650
edits