WB Modbus Devices Firmware Update/en: различия между версиями

Материал из Wiren Board
(Новая страница: «Below is an example with the following input data:»)
Метки: правка с мобильного устройства правка из мобильной версии
 
(не показано 10 промежуточных версий этого же участника)
Строка 1: Строка 1:
<languages/>
<languages/>
{{DISPLAYTITLE:Updating Wiren Board Modbus Device Firmware}}
== General Information ==
== General Information ==
{{PeerTube
| link= https://peertube.wirenboard.com/video-playlists/embed/6623c76e-1abe-4728-959c-f5dde919d80c?playlistPosition=8
| playlist = true
| text=Updating Device Firmware (24:08)
}}
Wiren Board modbus devices have a [[Bootloader |bootloader]], which allows updating firmware via RS-485/Modbus RTU. In bootloader mode, the main functions of the device are disabled, and the communication parameters in bootloader mode are fixed and do not depend on the values in the device memory: 9600 8N2.
Wiren Board modbus devices have a [[Bootloader |bootloader]], which allows updating firmware via RS-485/Modbus RTU. In bootloader mode, the main functions of the device are disabled, and the communication parameters in bootloader mode are fixed and do not depend on the values in the device memory: 9600 8N2.


Строка 164: Строка 158:
*The current bootloader version is not lower than '''1.3.0'''.
*The current bootloader version is not lower than '''1.3.0'''.


'''Otherwise, the update can only be performed with [[:ru:WB_Modbus_Devices_Firmware_Update#Обновление_со_стандартными_настройками_соединения |standard 9600N2 connection settings.]]'''
'''Otherwise, the update can only be performed with standard 9600N2 connection settings.'''


Below is an example with the following input data:
Below is an example with the following input data:
Строка 174: Строка 168:
{{note|info|'''Attention!''' In your case, the settings may be different.}}
{{note|info|'''Attention!''' In your case, the settings may be different.}}


<div lang="ru" dir="ltr" class="mw-content-ltr">
#Prepare the firmware file and install the socat utility if it is not installed:
#[[Firmware_Repository_For_Wiren_Board_Modbus_Devices |Приготовьте файл прошивки]] и установите утилиту socat, если ее нет:
#:<syntaxhighlight lang="bash">
#:<syntaxhighlight lang="bash">
apt install socat
apt install socat
</syntaxhighlight>
</syntaxhighlight>
#Дважды подключитесь к контроллеру по [[SSH |SSH]], у вас должно быть открыто два окна: первое для создания тоннеля socat, второе для отправки команд устройству.
#Connect twice to the controller via SSH, you should have two windows open: the first one for creating a socat tunnel, the second one for sending commands to the device.
#Остановите [[Wb-mqtt-serial_driver |wb-mqtt-serial]]:
#Stop wb-mqtt-serial:
#:<syntaxhighlight lang="bash">
#:<syntaxhighlight lang="bash">
systemctl stop wb-mqtt-serial
systemctl stop wb-mqtt-serial
</syntaxhighlight>
</syntaxhighlight>
#В первом окне запустите перенаправление утилитой socat с текущими настройками соединения:
#In the first window, start redirecting with socat using the current connection settings:
#:<syntaxhighlight lang="bash">
#:<syntaxhighlight lang="bash">
socat -d -d -d -x PTY,raw,b115200,parenb=0,cstopb=2,cs8,link=/dev/ttyRS485-5 tcp:192.168.0.7:23
socat -d -d -d -x PTY,raw,b115200,parenb=0,cstopb=2,cs8,link=/dev/ttyRS485-5 tcp:192.168.0.7:23
</syntaxhighlight>
</syntaxhighlight>
#Во втором окне запустите обновление прошивки устройства утилитой [[Wb-mcu-fw-flasher |wb-mcu-fw-flasher]], используя параметр <code>-J</code>. Укажите файл прошивки, который приготовили в начале:
#In the second window, start the device firmware update with the wb-mcu-fw-flasher utility, using the -J parameter. Specify the firmware file prepared earlier:
#:<syntaxhighlight lang="bash">
#:<syntaxhighlight lang="bash">
wb-mcu-fw-flasher -J -d /dev/ttyRS485-5 -a14 -f ./firmware.wbfw
wb-mcu-fw-flasher -J -d /dev/ttyRS485-5 -a14 -f ./firmware.wbfw
</syntaxhighlight>
</syntaxhighlight>
#Запустите wb-mqtt-serial
#Start wb-mqtt-serial
#:<syntaxhighlight lang="bash">
#:<syntaxhighlight lang="bash">
systemctl start wb-mqtt-serial
systemctl start wb-mqtt-serial
</syntaxhighlight>
</syntaxhighlight>
</div>


<div lang="ru" dir="ltr" class="mw-content-ltr">
===Updating with default connection settings===
===Обновление со стандартными настройками соединения===
This instruction is used for devices where the current bootloader version is below '''1.3.0''' and/or the current firmware does not support '''131''' register.  
Инструкция используется для устройств в которых текущая версия загрузчика ниже '''1.3.0''' и/или текущая прошивка не поддерживает '''131''' регистр.
</div>


<div lang="ru" dir="ltr" class="mw-content-ltr">
In this case, the update can only be performed at a speed of '''9600N2''', by specifying the <code>-j</code> parameter for the wb-mcu-fw-flasher utility. If different connection settings are used, they must first be changed to the standard ones.
В этом случае обновление можно выполнить только на скорости '''9600N2''', указав параметр <code>-j</code> для утилиты wb-mcu-fw-flasher. Если используются другие настройки соединения сначала нужно изменить их на стандартные.
</div>


<div lang="ru" dir="ltr" class="mw-content-ltr">
We also recommend updating the bootloader if its version is
Рекомендуем также обновить загрузчик если его версия ниже '''1.3.0'''. Это позволит в дальнейшем обновлять прошивку на [[WB_Modbus_Devices_Firmware_Update#Обновление_на_любой_скорости_соединения |любой скорости соединения]].
1.3.0
</div>
. This will allow you to update the firmware at any speed of connection [[WB_Modbus_Devices_Firmware_Update#Обновление_на_любой_скорости_соединения |any connection speed]].


<div lang="ru" dir="ltr" class="mw-content-ltr">
Let's consider a synthetic example of firmware update for devices, where non-standard connection settings are used:  
Рассмотрим синтетический пример обновления прошивки устройств, в котором используются нестандартные настройки соединения:
*WB-MGE (WB-MIO-E) gateway configured for Modbus over TCP with IP address 192.168.0.7, port 23.
*Шлюз WB-MGE (WB-MIO-E), настроенный на Modbus over TCP и имеющий IP-адрес 192.168.0.7, порт 23.
*Connected to the gateway is WB-MDM3 device with address 58.
*К шлюзу подключено устройство WB-MDM3 с адресом 58.
*Device and gateway settings are set to a speed of 115200 kbit/s.
*В настройках устройства и шлюза выставлена скорость 115200 кбит/с.
</div>


<div lang="ru" dir="ltr" class="mw-content-ltr">
{{note|info| '''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.}}
{{note|info| '''Внимание!''' В инструкции рассмотрен пример, в котором устройства работают на скорости '''115200 8N2'''. В вашем случае настройки соединения могут быть другими.}}
To update the firmware:
Чтобы обновить прошивку:
#Connect to the controller twice via [[SSH |SSH]], you should have two windows open: the first to create a socat tunnel, the second to send commands to the device.
#Дважды подключитесь к контроллеру по [[SSH |SSH]], у вас должно быть открыто два окна: первое для создания тоннеля socat, второе для отправки команд устройству.
#Stop wb-mqtt-serial:
#Остановите wb-mqtt-serial:
#:<syntaxhighlight lang="bash">  
#:<syntaxhighlight lang="bash">
systemctl stop wb-mqtt-serial  
systemctl stop wb-mqtt-serial  
</syntaxhighlight>
</syntaxhighlight>  
#В первом окне запустите перенаправление:
#In the first window, start the redirect:
#:<syntaxhighlight lang="bash">
#:<syntaxhighlight lang="bash">  
socat -d -d -d -x PTY,raw,b115200,parenb=0,cstopb=2,cs8,link=/dev/ttyRS485-5 tcp:192.168.0.7:23
socat -d -d -d -x PTY,raw,b115200,parenb=0,cstopb=2,cs8,link=/dev/ttyRS485-5 tcp:192.168.0.7:23
</syntaxhighlight>
</syntaxhighlight>  
#:если у вас стабильный релиз до wb-2207 включительно, вместо параметра b115200, используйте <code>ispeed=115200,ospeed=115200</code>.
#:if you have a stable release up to and including wb-2207, instead of the b115200 parameter, use <code>ispeed=115200,ospeed=115200</code> .
#Во втором окне измените скорость порта устройства на 9600 кбит/с:
#In the second window, change the device port speed to 9600 kbps:
#:<syntaxhighlight lang="bash">
#:<syntaxhighlight lang="bash">  
modbus_client --debug -mrtu -b115200 -pnone -s2 /dev/ttyRS485-5 -a58 -t0x06 -r110 96
modbus_client --debug -mrtu -b115200 -pnone -s2 /dev/ttyRS485-5 -a58 -t0x06 -r110 96
</syntaxhighlight>
</syntaxhighlight>  
#В первом окне разорвите соединение socat клавишами <kbd>Ctrl</kbd>+<kbd>C</kbd>.
#In the first window, terminate the socat connection with <kbd>Ctrl</kbd> + <kbd>C</kbd> .
#В [[socat#Настройка шлюза для обновления прошивки | настройках шлюза]] установите скорость порта 9600 кбит/с.
#In [[socat#Configuring a gateway for firmware updates | gateway settings]] set the port speed to 9600 kbps.
#В первом окне снова запустите перенаправление socat с новыми параметрами соединения:
#In the first window, restart socat forwarding with the new connection parameters:
#:<syntaxhighlight lang="bash">
#:<syntaxhighlight lang="bash">  
socat -d -d -d -x PTY,raw,b9600,parenb=0,cstopb=2,cs8,link=/dev/ttyRS485-5 tcp:192.168.0.7:23
socat -d -d -d -x PTY,raw,b9600,parenb=0,cstopb=2,cs8,link=/dev/ttyRS485-5 tcp:192.168.0.7:23
</syntaxhighlight>
</syntaxhighlight>  
#:если у вас стабильный релиз до wb-2207 включительно, вместо параметра b9600, используйте <code>ispeed=9600,ospeed=9600</code>.
#:if you have a stable release up to and including wb-2207, instead of the b9600 parameter, use <code>ispeed=9600,ospeed=9600</code> .
#Во втором окне запустите обновление прошивки устройства, например, утилитой wb-mcu-fw-flasher ([[WB_Modbus_Devices_Firmware_Update#Ручное_обновление|полная инструкция]]):
#In the second window, run the device firmware update, for example, with the wb-mcu-fw-flasher utility ([[WB_Modbus_Devices_Firmware_Update#Manual_update|full instructions]]):
#:<syntaxhighlight lang="bash">
#:<syntaxhighlight lang="bash">  
wb-mcu-fw-flasher -j -d /dev/ttyRS485-5 -a25 -f ./firmware.wbfw
wb-mcu-fw-flasher -j -d /dev/ttyRS485-5 -a25 -f ./firmware.wbfw
</syntaxhighlight>
</syntaxhighlight>  
#После окончания прошивки верните в устройстве старую скорость 115200 кбит/с:
#After finishing the firmware, return the old speed of 115200 kbps to the device:
#:<syntaxhighlight lang="bash">
#:<syntaxhighlight lang="bash">  
modbus_client --debug -mrtu -b9600 -pnone -s2 /dev/ttyRS485-5 -a58 -t0x06 -r110 1152
modbus_client --debug -mrtu -b9600 -pnone -s2 /dev/ttyRS485-5 -a58 -t0x06 -r110 1152
</syntaxhighlight>
</syntaxhighlight>  
#В первом окне разорвите соединение socat клавишами <kbd>Ctrl</kbd>+<kbd>C</kbd>.
#In the first window, break the socat connection with <kbd>Ctrl</kbd> + <kbd>C</kbd> .
#В настройках шлюза измените скорость порта с 9600 кбит/с на 115200 кбит/с.
#In the gateway settings, change the port speed from 9600 kbps to 115200 kbps.
#Подключите шлюз к контроллеру по Ethernet.
#Connect the gateway to the controller via Ethernet.
#Запустите wb-mqtt-serial
#Run wb-mqtt-serial
#:<syntaxhighlight lang="bash">
#:<syntaxhighlight lang="bash">  
systemctl start wb-mqtt-serial
systemctl start wb-mqtt-serial
</syntaxhighlight>
</syntaxhighlight>
</div>


<div lang="ru" dir="ltr" class="mw-content-ltr">
If you need to flash several devices, you can first modify their speed, reconfigure the gateway, and then flash them one by one, restore their original speed, and reconfigure the gateway again.
Если вам нужно прошить несколько устройств, то вы можете сперва изменить им скорость, перенастроить шлюз, а потом так же поочереди их прошить, вернуть им прежнюю скорость и снова перенастроить шлюз.
</div>


<div lang="ru" dir="ltr" class="mw-content-ltr">
===Configuring the gateway for updating the firmware===
===Настройка шлюза для обновления прошивки===
</div>


<div lang="ru" dir="ltr" class="mw-content-ltr">
The easiest way to change the gateway settings is to connect to its built-in web interface. To do this, you need to:
Самый простой способ изменить настройки шлюза — подключиться к его встроенному веб-интерфейсу. Для этого нужно:
</div>


<div lang="ru" dir="ltr" class="mw-content-ltr">
#connect the gateway to the computer using a UTP cable directly or through a router,
#подключить шлюз к компьютеру UTP кабелем напрямую или через роутер,
#assign a static IP address to the computer in the gateway network, for example, 192.168.0.201,
#присвоить компьютеру статический IP-адрес в сети шлюза, например, 192.168.0.201,
#open a browser and enter the gateway's IP address, by default 192.168.0.7.
#открыть браузер и ввести IP-адрес шлюза, по умолчанию 192.168.0.7.
</div>


<div lang="ru" dir="ltr" class="mw-content-ltr">
==  Useful links ==
==  Полезные ссылки ==
* [[Restore factory settings Wiren Board Modbus device | Restoring access resetting communication settings]]
* [[Restore factory settings Wiren Board Modbus device | Восстановление доступа сброс настроек связи]]
* [[Wiren Board Device Modbus Address | Modbus address of the Wiren Board device]]
* [[Wiren Board Device Modbus Address | Modbus-адрес устройства Wiren Board]]
* [[wb-mcu-fw-updater | Firmware update and recovery utility wb-mcu-fw-updater]]
* [[wb-mcu-fw-updater | Утилита обновления и восстановления прошивок wb-mcu-fw-updater]]
* [[wb-mcu-fw-flasher | Service utility wb-mcu-fw-flasher]]
* [[wb-mcu-fw-flasher | Сервисная утилита wb-mcu-fw-flasher]]
* [[Firmware Repository For Wiren Board Modbus Devices | Firmware repository for Wiren Board Modbus devices]]
* [[Firmware Repository For Wiren Board Modbus Devices |Репозиторий прошивок для Modbus-устройств Wiren Board]]
</div>

Текущая версия на 08:01, 27 августа 2024

Другие языки:

General Information

Wiren Board modbus devices have a bootloader, which allows updating firmware via RS-485/Modbus RTU. In bootloader mode, the main functions of the device are disabled, and the communication parameters in bootloader mode are fixed and do not depend on the values in the device memory: 9600 8N2.

The firmware itself is released in the format of releases, which are linked to controller software releases, but have a different cycle:

  • testing — firmware that has passed internal testing lands here, available to users of the controller's testing release;
  • stable — three weeks after being published in testing and with no error reports, the firmware is considered stable. At this point, it becomes available to users of the stable release of the controller. If there were major changes in the firmware that affected the device's core functions, the firmware may be slightly delayed in testing.

On the page of each device there is a link to the list of firmware changes, where firmware in testing is marked with the "testing" marker. Firmware without a mark is considered stable.

Distributing firmware updates by releases helps prevent a situation where a new firmware version, without undergoing thorough testing, ends up in a very critical installation. If the new firmware requires new features in the controller's software, either these features will be included in the stable software release along with the firmware, or the firmware update will be delayed in testing until the required features appear in the software.

To update devices connected via a WB-MGE gateway or a similar device, use the socat redirection, instructions.

Automatic firmware update

Example of wb-fw-mcu-updater operation

When updating the firmware, IR commands stored in WB-MSW and WB-MIR devices are deleted. We recommend saving command banks before updating using the script. Automatic firmware update is performed using the utility wb-mcu-fw-updater preinstalled on Wiren Board controllers, allowing you to install the latest version of the software on all connected devices at once or separately on each one. The device model and new firmware will be automatically identified.

The utility only works on our controller and requires internet access. If you do not have internet or our controller, refer to the section Manual Update.

Updating firmware on devices connected to WB-MGE and WM-MIO-E gateways is also performed manually with displaying the network port to local.

Updating all devices on the bus

You can update all devices configured in the Serial Devices Configuration section of the web interface

  1. Connect the devices via the RS-485 bus to the controller.
  2. Configure the connected devices in the web interface.
  3. Open the controller's console via SSH.
  4. Update all configured devices with the following command:
    wb-mcu-fw-updater update-all
    

Updating a Single Device

To update only one device:

  1. Connect the device via RS-485 to the controller.
  2. Determine the Modbus address of the device you want to update.
  3. Open the controller console via SSH.
  4. Run the utility wb-mcu-fw-updater with the following parameters: the update-fw key, as well as the port and Modbus address.

For example, let's update the firmware of a device with a modbus address of 70 connected to port /dev/ttyRS485-1:

wb-mcu-fw-updater update-fw /dev/ttyRS485-1 -a70

For the full list of parameters and examples of usage, refer to the utility page.

Manual Update

Features

This method is used if:

In all other cases, use the automatic update.

Manual update can be done with the utility wb-mcu-fw-flasher, which needs to be installed beforehand. The installation method varies and depends on the operating system being used.

Device preparation

Devices can be flashed in the following ways:

  • by the device's Modbus address.
  • by the broadcast address, which is 0.

To flash multiple devices on the bus, you need to sequentially switch them to the bootloader mode and flash them.

Firmware upload to the device

To upload the firmware, follow these steps:

  1. Connect the device via RS-485 bus to the controller or other equipment where the firmware utility is installed.
  2. Если вы выполняете команды на контроллере:
  3. Download the firmware file for your device from the repository following the instructions.
  4. Upload the firmware file to the controller or other device.
  5. Go to the folder with the firmware file and execute the command:
    • on the controller or a Linux computer:
    wb-mcu-fw-flasher -j -d /dev/ttyRS485-1 -a25 -f ./firmware.wbfw
    
    • on a Windows computer:
    wb-mcu-fw-flasher_1.0.3.exe -j -d COM1 -a25 -f firmware.wbfw
    
  6. If you executed the command from the controller, start the wb-mqtt-serial driver.

In the above command, using the -j flag, we switched the device connected to the port /dev/ttyRS485-1 (COM1) with address 25 to bootloader mode and then flashed it.

A successful firmware update process looks like this:

~# wb-mcu-fw-flasher -j -d /dev/ttyRS485-1 -a 25 -f mr6c__1.15.5_master_971fe50.wbfw  
   /dev/ttyRS485-1 opened successfully.
   Send jump to bootloader command and wait 2 seconds...
   Ok, device will jump to bootloader.
   mr6c__1.15.5_master_971fe50.wbfw opened successfully, size 14720 bytes

   <div lang="ru" dir="ltr" class="mw-content-ltr">
Sending info block... OK
</div>

   <div lang="ru" dir="ltr" class="mw-content-ltr">
Sending data block 108 of 108... OK.
   All done!

If the device signature and firmware file do not match, you will receive an error message:

Sending info block...
   Error while sending info block: Slave device or server failure 
   Data format is invalid or firmware signature doesn't match the device

Restoring the device firmware

If an error occurred during the update, the device will enter the bootloader mode and you can restore its firmware.

Automatically

To automatically restore the firmware of one or multiple devices, you can use the utility wb-mcu-fw-updater in the modes recover and recover-all.

To recover the device with address 10 and connected to port /dev/ttyRS485-1, execute the command:

wb-mcu-fw-updater recover /dev/ttyRS485-1 -a 10

For more information on the recover and recover-all modes, read the documentation in the documentation.

Manually

If you cannot use wb-mcu-fw-updater, you can restore the firmware of devices using the service utility wb-mcu-fw-flasher. This method can also be used by Windows computer users.

To do this, you will need the utility itself and the firmware file:

  1. Connect the device via the RS-485 bus to the controller or other equipment where the firmware utility is installed.
  2. Если вы выполняете команды на контроллере:
  3. Download the firmware file for your device from the repository.
  4. Upload the firmware file to the controller or other device with the firmware utility installed.
  5. Go to the folder with firmware and execute the command:
    • on a Linux-based controller or computer:
    wb-mcu-fw-flasher -d /dev/ttyRS485-1 -a 25 -f ./firmware.wbfw
    
    • on a Windows-based computer:
    wb-mcu-fw-flasher_1.0.3.exe -d COM1 -a 25 -f firmware.wbfw
    

Here we flashed the device in bootloader mode with Modbus address 25 connected to port /dev/ttyRS485-1 (COM1) using the file firmware.wbfw.

Updating firmware of devices connected to WB-MGE and WB-MIO-E gateways

Gateway settings for firmware update

To update the firmware of a Wiren Board device connected to the WB-MGE and WB-MIO-E gateways via RS-485, it can only be done manually using the wb-mcu-fw-flasher utility. However, first, you need to convert the network port to a local one using the socat utility.

The gateway must be set to TCP Server/None mode (for WB-MGE v2, WB-MIO-E v2) or TCP Server mode (for WB-MGE v1, WB-MIO-E v1).

Update at any connection speed

Connection settings can be any, !if! only:

  • Version of wb-mcu-fw-flasher is not less than 1.3.0 (available in testing),
  • The current firmware version of the device supports 131 registers (see Change logs on device pages),
  • The current bootloader version is not lower than 1.3.0.

Otherwise, the update can only be performed with standard 9600N2 connection settings.

Below is an example with the following input data:

  • Gateway WB-MGE (WB-MIO-E), configured for Modbus over TCP and having IP address 192.168.0.7, port 23.
  • Modbus device Wiren Board with address 14.
  • Connection speed is 115200 kbit/s.

Attention! In your case, the settings may be different.

  1. Prepare the firmware file and install the socat utility if it is not installed:
    apt install socat
    
  2. Connect twice to the controller via SSH, you should have two windows open: the first one for creating a socat tunnel, the second one for sending commands to the device.
  3. Stop wb-mqtt-serial:
    systemctl stop wb-mqtt-serial
    
  4. In the first window, start redirecting with socat using the current connection settings:
    socat -d -d -d -x PTY,raw,b115200,parenb=0,cstopb=2,cs8,link=/dev/ttyRS485-5 tcp:192.168.0.7:23
    
  5. In the second window, start the device firmware update with the wb-mcu-fw-flasher utility, using the -J parameter. Specify the firmware file prepared earlier:
    wb-mcu-fw-flasher -J -d /dev/ttyRS485-5 -a14 -f ./firmware.wbfw
    
  6. Start wb-mqtt-serial
    systemctl start wb-mqtt-serial
    

Updating with default connection settings

This instruction is used for devices where the current bootloader version is below 1.3.0 and/or the current firmware does not support 131 register.

In this case, the update can only be performed at a speed of 9600N2, by specifying the -j parameter for the wb-mcu-fw-flasher utility. If different connection settings are used, they must first be changed to the standard ones.

We also recommend updating the bootloader if its version is 1.3.0 . This will allow you to update the firmware at any speed of connection any connection speed.

Let's consider a synthetic example of firmware update for devices, where non-standard connection settings are used:

  • WB-MGE (WB-MIO-E) gateway configured for Modbus over TCP with IP address 192.168.0.7, port 23.
  • Connected to the gateway is WB-MDM3 device with address 58.
  • Device and gateway settings are set to a speed of 115200 kbit/s.

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:

  1. 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.
  2. Stop wb-mqtt-serial:
     
    systemctl stop wb-mqtt-serial
    
  3. 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 .
  4. 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
    
  5. In the first window, terminate the socat connection with Ctrl + C .
  6. In gateway settings set the port speed to 9600 kbps.
  7. 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 .
  8. 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
    
  9. 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
    
  10. In the first window, break the socat connection with Ctrl + C .
  11. In the gateway settings, change the port speed from 9600 kbps to 115200 kbps.
  12. Connect the gateway to the controller via Ethernet.
  13. Run wb-mqtt-serial
     
    systemctl start wb-mqtt-serial
    

If you need to flash several devices, you can first modify their speed, reconfigure the gateway, and then flash them one by one, restore their original speed, and reconfigure the gateway again.

Configuring the gateway for updating the firmware

The easiest way to change the gateway settings is to connect to its built-in web interface. To do this, you need to:

  1. connect the gateway to the computer using a UTP cable directly or through a router,
  2. assign a static IP address to the computer in the gateway network, for example, 192.168.0.201,
  3. open a browser and enter the gateway's IP address, by default 192.168.0.7.

Useful links