Translations:WB Modbus Devices Firmware Update/84/en
Attention! The instructions consider an example in which the devices operate at a speed of 115200 8N2. In your case, the connection settings may be different. To update the firmware:
- Connect to the controller twice via SSH, you should have two windows open: the first to create a socat tunnel, the second to send commands to the device.
- Stop wb-mqtt-serial:
systemctl stop wb-mqtt-serial
- In the first window, start the redirect:
socat -d -d -d -x PTY,raw,b115200,parenb=0,cstopb=2,cs8,link=/dev/ttyRS485-5 tcp:192.168.0.7:23
- if you have a stable release up to and including wb-2207, instead of the b115200 parameter, use
ispeed=115200,ospeed=115200
.
- In the second window, change the device port speed to 9600 kbps:
modbus_client --debug -mrtu -b115200 -pnone -s2 /dev/ttyRS485-5 -a58 -t0x06 -r110 96
- In the first window, terminate the socat connection with Ctrl + C .
- In gateway settings set the port speed to 9600 kbps.
- In the first window, restart socat forwarding with the new connection parameters:
socat -d -d -d -x PTY,raw,b9600,parenb=0,cstopb=2,cs8,link=/dev/ttyRS485-5 tcp:192.168.0.7:23
- if you have a stable release up to and including wb-2207, instead of the b9600 parameter, use
ispeed=9600,ospeed=9600
.
- In the second window, run the device firmware update, for example, with the wb-mcu-fw-flasher utility (full instructions):
wb-mcu-fw-flasher -j -d /dev/ttyRS485-5 -a25 -f ./firmware.wbfw
- After finishing the firmware, return the old speed of 115200 kbps to the device:
modbus_client --debug -mrtu -b9600 -pnone -s2 /dev/ttyRS485-5 -a58 -t0x06 -r110 1152
- In the first window, break the socat connection with Ctrl + C .
- In the gateway settings, change the port speed from 9600 kbps to 115200 kbps.
- Connect the gateway to the controller via Ethernet.
- Run wb-mqtt-serial
systemctl start wb-mqtt-serial