Sensors Modbus Management/en: различия между версиями

Материал из Wiren Board
(Новая страница: «=== Modbus commands supported by the device ===»)
 
(не показано 26 промежуточных версий 3 участников)
Строка 10: Строка 10:
=== Modbus commands supported by the device ===
=== Modbus commands supported by the device ===


Датчики Wirenboard поддерживают все основные команды Modbus. Подробнее смотрите здесь: [[Протокол Modbus#Коды функций чтения и записи регистров|Коды функций чтения и записи регистров]].
The Wirenboard sensors support all major Modbus commands. Read more here: [[Протокол_Modbus/en#Register reading and writing function codes|Register reading and writing function codes]].


=== Карта регистров хранения (Holding Registers)===
===Holding Registers===


{| border="1" class="wikitable" style="text-align:center"
{| border="1" class="wikitable" style="text-align:center"
!rowspan="2"|Регистр/ адрес
!rowspan="2"|Register/ address
!rowspan="2"|Тип
!rowspan="2"|Type
!rowspan="2"|Чтение/ запись
!rowspan="2"|Read/ write
!rowspan="2"|Значение по умолчанию или при ошибке
!rowspan="2"|default or error Value
!rowspan="2"|Формат
!rowspan="2"|Format
!rowspan="2"|Назначение
!rowspan="2"|Purpose
!colspan="5"|Поддерживается в
!colspan="5"|Supported in
!С версии
!From version
прошивки
insertions
|-
|-
!WB-MS (код модели)
!WB-MS (model code)
!WB-MS v2 (код модели)
!WB-MS v2 (model code)
!WB-MSW
!WB-MSW
!WB-MSW2
!WB-MSW2
!WB-MSW v.3
!WB-MSW V. 3
!
!
|-
|-
| 0 || input || R || 0x7FFF ||°C × 10 (signed)||Температура с встроенного датчика
| 0 || input || R || 0x7FFF ||°C × 10 (signed)||Temperature with built-in sensor
| T
| T
| -
| -
Строка 40: Строка 40:
|
|
|-
|-
|1|| input || R || 0xFFFF ||<blockquote>%RH × 10 (signed)</blockquote>||Относительная влажность с встроенного датчика
|1|| input || R || 0xFFFF / |<blockquote>%RH × 10 (signed)</blockquote>||relative humidity with built-in sensor
|H
|H
|<nowiki>-</nowiki>
|<nowiki>-</nowiki>
Строка 52: Строка 52:
|R
|R
|<nowiki>-</nowiki>
|<nowiki>-</nowiki>
|лк
|LC
|''(регистр не используется в датчиках WB-MSW, вместо него регистры 9 и 10)''<br>Освещённость с встроенного датчика
|"(register is not used in WB-MSW sensors, registers 9 and 10 instead)"<br>Illumination from built-in sensor
|L
|L
|Lux
|Lux
Строка 65: Строка 65:
|R
|R
|<nowiki>-</nowiki>
|<nowiki>-</nowiki>
|дБ × 100
|dB × 100
|Уровень шума, умноженный на 100
|Noise level multiplied by 100
|S
|S
|<nowiki>-</nowiki>
|<nowiki>-</nowiki>
Строка 79: Строка 79:
|0x7FFF
|0x7FFF
|°C × 100 (signed)
|°C × 100 (signed)
|Температура с встроенного датчика
|Temperature with built-in sensor
| +
| +
| +
| +
Строка 92: Строка 92:
|<nowiki>-</nowiki>
|<nowiki>-</nowiki>
|%RH × 100 (signed)
|%RH × 100 (signed)
|Относительная влажность с встроенного датчика
|Relative humidity with built-in sensor
| +
| +
| +
| +
Строка 105: Строка 105:
|0x7FFF
|0x7FFF
|°C × 16 (signed)
|°C × 16 (signed)
|Температура с внешнего датчика
|Temperature from external sensor
| D
| D
| +
| +
Строка 118: Строка 118:
|0x7FFF
|0x7FFF
|°C × 16 (signed)
|°C × 16 (signed)
|Температура с внешнего датчика
|Temperature from external sensor
| D
| D
| +
| +
Строка 131: Строка 131:
|0xFFFF
|0xFFFF
|PPM
|PPM
|Концентрация CO2
|CO2 concentration
| -
| -
| -
| -
|С
|After
|C
|C
|
|
Строка 142: Строка 142:
| R
| R
|
|
|лк
|LC
|'''Освещенность, умноженная на 100''' (9 - старший разряд, 10 — младший разряд значения освещенности)
|'''The illumination, multiplied by 100''' (9 - high-order, 10 — LSB luminance values)
| -
| -
| -
| -
Строка 155: Строка 155:
|0xFFFF
|0xFFFF
|PPM
|PPM
|Качество воздуха
|Air quality
| -
| -
| VOC
| VOC
Строка 168: Строка 168:
|0
|0
|ppm (400-1500)
|ppm (400-1500)
|Ручная калибровка датчика CO2. Для калибровки запишите сюда текущее значение концентрации CO2, измеренное другим прибором
|Service register, doesn't present in most devices. Manual calibration of CO2 sensor. For calibration, write down here the current CO2 concentration measured by another instrument
| -
| -
| -
| -
Строка 180: Строка 180:
|RW
|RW
|0xFF
|0xFF
|дней
|days'
|Длительность цикла для алгоритма самокалибровки датчика CO (ABC)
|Service register, doesn't present in most devices. Cycle time for co sensor self-calibration algorithm (ABC)
| -
| -
| -
| -
Строка 189: Строка 189:
|3.12
|3.12
|-
|-
|90||holding||RW||20 (200 ms)||× 10 ms||Время усреднения освещённости
|90||holding||RW||20 (200 ms)||× 10 ms||light averaging Time
|<blockquote>L, B</blockquote>
|<blockquote>L, B</blockquote>
| -
| -
Строка 197: Строка 197:
|
|
|-
|-
|91||holding||RW||20 (200 ms)||× 10 ms
||Noise averaging time
|S
| -
| +
|S
|S
|
|-
|95
|holding
|RW
|1
|1 or 0
|CO2 sensor (ABC) auto-calibration to atmospheric CO2
| -
| -
| -
|After
|C
|
|-
|96||holding||R||2000 / 5000||ppm
||(available from firmware version 3.5.0) CO2 concentration measurement Range. Valid values: 2000, 5000, 10000.
| -
| -
| -
|C
|C
|3.5.0
|-
|91||holding||RW||20 (200 ms)||× 10 ms
|91||holding||RW||20 (200 ms)||× 10 ms
||Время усреднения шума
||Время усреднения шума
Строка 204: Строка 236:
|S
|S
|S
|S
|
|-
 
|92
||holding
||RW||0||x0.0625||Служебный регистр HOLD_REG_SPL_RAW_OFFSET - сдвиг значения АЦП
|<nowiki>-</nowiki>
|<nowiki>-</nowiki>
|S
|S
|S
|4.9.0
|-
 
|93
||holding
||RW||0||x0.1dB||Служебный регистр HOLD_REG_SPL_OFFSET - поправка к значению уровня шума
|<nowiki>-</nowiki>
|<nowiki>-</nowiki>
|S
|S
|S
|4.9.0
|-
 
 
 
 
|-
|-
|95
|95
Строка 230: Строка 288:


|97||holding||RW||0 — 10||c
|97||holding||RW||0 — 10||c
||Период между вспышками сигнальных светодиодов
||Period between flashes of signal LEDs
| -
| -
| -
| -
Строка 240: Строка 298:




|98||holding||RW||0 — 50||мс
|98||holding||RW||0 — 50||MS
||Длительность вспышки светодиодов
||Led flash duration
| -
| -
| -
| -
Строка 254: Строка 312:




|99||holding||RW||16|| 1 = 0.0625C
|99||holding||RW||16|| 1 = 0.0625 C
||(доступно с версии прошивки 3.10.0) Фильтр подозрительных значений для датчиков 1-Wire (85.000C, 127.937C). Значения отбрасываются, если предыдущее отличается от подозрительного больше, чем на значение регистра*0.0625C. Запишите 0, чтобы отключить фильтр.
||(available from firmware version 3.10.0) suspicious value Filter for 1-Wire sensors (85.000 C, 127.937 C). The values are discarded if the previous value differs from the suspicious value by more than * 0.0625 C. Write 0 to disable the filter.
| D
| D
| +
| +
Строка 265: Строка 323:




|100
||input
||R||||||Служебный регистр HOLD_REG_SPL_RAW_INT
|<nowiki>-</nowiki>
|<nowiki>-</nowiki>
|S
|S
|S
|
|-




|101
|101
||input
||input
||R||||||Служебный регистр HOLD_REG_TH_READS
||R||||||Service register HOLD_REG_TH_READS
|colspan="5"|все
|colspan="5"|all
|
|
|-
|-
Строка 276: Строка 345:
|102
|102
||input
||input
||R||||||Служебный регистр HOLD_REG_TH_ERRORS
||R||||||Service register HOLD_REG_TH_ERRORS
|colspan="5"|все
|colspan="5"|all
|
|
|-
|-




|104-105
|103
||input
||holding
||R||||32-bit unsigned int||Время работы устройства (uptime counter) в секундах
||RW||||||Служебный регистр HOLD_REG_ILLUMINANCE_MODE
|colspan="5"|все
|<nowiki>+</nowiki>
|<nowiki>+</nowiki>
|<nowiki>+</nowiki>
|<nowiki>-</nowiki>
|<nowiki>-</nowiki>
|
|-
 
 
| 104-105 || input || R|| || 32-bit unsigned int || uptime counter in seconds ||colspan="5"|all
|
|
|-
|-


|106||input||R|| ||  
|106||input||R|| ||  
|| Служебный регистр INPUT_REG_SGPC3_BASELINE
|| Service register INPUT_REG_SGPC3_BASELINE
| -
| -
| -
| -
Строка 300: Строка 378:


|107||input||R|| ||  
|107||input||R|| ||  
|| Служебный регистр INPUT_REG_SGPC3_RAW_SIGNAL
|| Service register INPUT_REG_SGPC3_RAW_SIGNAL
| -
| -
| -
| -
Строка 313: Строка 391:
|0xFFFF
|0xFFFF
|
|
|Служебный регистр SGPC3 VERSION
|Sgpc3 VERSION service register
| -
| -
| -
| -
Строка 323: Строка 401:




| 110 || holding || RW || 96 || baud rate / 100 || скорость порта RS-485, '''делённая на 100'''. Допустимые скорости: 1200, 2400, 4800, 9600, 19200, 38400, 57600, 115200 <br>([[UART_Communication_Settings|Настройка параметров обмена данными по RS-485 для modbus-устройств Wiren Board]])
| 110 || holding || RW|| 96 || baud rate / 100 || RS-485 port speed, '''divided by 100'''. Permissible speeds: 1200, 2400, 4800, 9600, 19200, 38400, 57600, 115200 <br>([[UART_Communication_Settings/en|Configure RS-485 communication parameters for Wiren Board Modbus devices]])
|colspan="5"|все
|colspan="5"|all
| rowspan="3" |>3.1.0
| rowspan="3" |>3.1.0
|-
|-
| 111 || holding || RW || 0 || || настройка бита чётности порта RS-485. Допустимые значения: 0 - нет бита чётности (none), 1 - нечётный (odd), 2 - чётный (even)  
| 111 || holding || RW|| 0 || || configure the RS-485 port parity bit. Valid values: 0 - no parity bit (none), 1 - odd (odd), 2 - even (even)  
|colspan="5"|все
|colspan="5"|all
|-
|-
| 112 || holding || RW || 2 || || количество стоп-битов порта RS-485. Допустимые значения: 1, 2  
| 112 || holding || RW|| 2 || || number of stop bits of RS-485 port. Valid values: 1, 2  
|colspan="5"|все
|colspan="5"|all
|-
|-
| 120 (0x78) || holding || RW || 0 || отличное от 0 || запись в регистр вызывает перезагрузку модуля без сохранения состояния
| 120 (0x78) || holding || RW|| 0 || non-0 || writing to the register causes the module to restart without saving state
|colspan="5"|все
|colspan="5"|all
|
|
|-
|-
| 121 (0x79) || input || R || - || mV || текущее напряжение питания модуля
| 121 (0x79) || input || R || - || mV || current supply voltage of the module
|colspan="5"|все
|colspan="5"|all
|
|
|-
|-
| 128 (0x80) || holding || RW || 1 || || Modbus-адрес устройства
| 128 (0x80) || holding || RW|| 1 || || Modbus device address
|colspan="5"|все
|colspan="5"|all
|
|
|-
|-
| 129 (0x81) || holding || RW || 0 || 0 или 1 || Переход в [[WB-MCU-Flasher|режим загрузчика]]  
| 129 (0x81) || holding || RW|| 0 || 0 or 1 || Go to [[WB-MCU-Flasher/en|bootloader mode]]  
|colspan="5"|все || 4.5.0
|colspan="5"|all || 4.5.0
|-
|-
| 200-206 || input || R || см. [[#Сигнатура устройства|Сигнатура устройства]] || || сигнатура
| 200-206 || input || R || see [[#Device signature|Device signature]] || || signature
|colspan="5"|все
|colspan="5"|all
|
|
|-
|-
| 220-241 || input || R || || __date__ __time__||   дата сборки прошивки
| 220-241 || input || R | | | | _date__ _time__|| firmware build date
|colspan="5"|все
|colspan="5"|all
|
|
|-
|-
Строка 361: Строка 439:
|0
|0
|°C × 100 (signed)
|°C × 100 (signed)
|Температурная компенсация самонагрева для датчика температуры и влажности (значение вычитается из измереной температуры)
|Self-heating temperature compensation for temperature and humidity sensor (value is subtracted from measured temperature)
| +
| +
| -
| -
Строка 369: Строка 447:
|4.2
|4.2
|-
|-
| 250-269 || input || R || ||  строка, null-terminated || версия прошивки
| 250-269 || input || R | | | / string, null-terminated || firmware version
|colspan="5"|все
|colspan="5"|all
|
|
|-
|-
| 270-271 || input || R || || 32-bit unsigned int || уникальный идентификатор (S/N)
| 270-271 || input || R|| || 32-bit unsigned int || unique identifier (S/N)
|colspan="5"|все
|colspan="5"|all
|
|
|-
|-
|280||input||R|| ||
|280||input||R|| ||
||Максимальное значение датчика движения с АЦП
||Maximum value of motion sensor with ADC
| -
| -
| -
| -
Строка 387: Строка 465:
|-
|-
|281||input||R|| ||
|281||input||R|| ||
||Значение датчика движения с АЦП
||Value of the motion sensor with ADC
| -
| -
| -
| -
Строка 395: Строка 473:
|
|
|-
|-
|282||holding||RW||10||с
|282||holding||RW||10||s
||Ширина временного окна для вычисления максимального усредненного значения датчика движения (от 1 до 60 секунд)
||The width of the time window for calculating the maximum average value of the motion sensor (from 1 to 60 seconds)
| -
| -
| -
| -
Строка 405: Строка 483:
|-
|-
|283||input||R|| ||
|283||input||R|| ||
||Текущее усредненное значение движения в условных единицах
||Current average value of movement in conventional units
| -
| -
| -
| -
Строка 416: Строка 494:
|}
|}


===Карта регистров флагов (Coils)===
===Coils===
Регистры, связанные с ИК-управлением, описаны в статье [[WB-MSx_Consumer_IR_Manual]].
Registers related to IR control are described in [[WB-MSx_Consumer_IR_Manual/en]].


{| border="1" class="wikitable" style="text-align:center"
{| border="1" class="wikitable" style="text-align:center"
!Начальный адрес || Количество || Назначение || В модификациях
!Starting address || Quantity || Purpose || In modifications
!С версии прошивки
!From firmware version
|-
|-
| 0 || 1 || style="text-align:left" |Включение пищалки (buzzer) || WB-MSW2, WB-MSW v.3
| 0 || 1 || style="text-align:left" |Enable buzzer (buzzer) || WB-MSW v.3, WB-MSW2
|
|
|-
|-
| 1 || 1 || style="text-align:left" | Принудительная калибровка встроенного датчика CO2. Включать после 20 минут работы при уровне CO2, равном 400 ppm || WB-MSW2
| 1 || 1 || style="text-align:left" | Forced calibration of the built-in CO2 sensor. Turn on after 20 minutes of operation at a CO2 level of 400 ppm || WB-MSW v.3, WB-MSW2
|
|
|-
|-
| 2 || 1 || style="text-align:left" | Включение подогрева (heater) в микросхеме сенсора температуры и влажности HDC1080 || WB-MS (в серии 2017 г.), WB-MSW2, WB-MSW v.3
| 2 || 1 || style="text-align:left" | Turn on the heating (heater) in the temperature and humidity sensor chip HDC1080 || WB-MS, WB-MSW v.3, WB-MSW2
|3.2.0
|3.2.0
|-
|-
|3
|3
|1
|1
|Включение датчика CO2
|Power on/off of the CO2 sensor
|WB-MSW v.3
|WB-MSW V. 3
|4.1.0
|4.1.0
|-
|-
| 10 || 1 || style="text-align:left" | Включение зеленого светодиода || WB-MSW v.3  
| 10 || 1 || style="text-align:left" | Green led on || WB-MSW v.3  
|
|
|-
|-
| 11 || 1 || style="text-align:left" | Включение красного светодиода || WB-MSW v.3  
| 11 || 1 || style="text-align:left" | Enable red led || WB-MSW v.3  
|
|
|-
|-
|}
|}


===Сигнатура устройства ===
== Device signature ==


По адресу 200 хранится сигнатура модуля длиной 6 байт. Сигнатура уникальна для каждой модели устройств Wiren Board и позволяет идентифицировать модель по Modbus:
The 6-byte module signature is stored at address 200. The signature is unique for each model of Wiren Board devices and allows to identify the model by Modbus:


{| class="wikitable"
{| class="wikitable"
! style="font-weight: bold;" | Модуль
! style="font-weight: bold;" | Module
! style="font-weight: bold;" | Сигнатура
! style="font-weight: bold;" | Signature
|-
|-
| WB-MS
| WB-MS
Строка 467: Строка 545:
|}
|}


Для получения сигнатуры устройства нужно выполнить команду READ_HOLDING_REGISTERS по адресу 200 (длина 6 регистров). Запись в эту область памяти не поддерживается, при попытке записи в недопустимое место возвращается ошибка 3. Пустые места в тексте сигнатуры забиваются значением 0x00.  
To get the signature of a device you need to run command READ_HOLDING_REGISTERS at 200 (length of 6 registers). Writing to this area of memory is not supported, and error 3 is returned when attempting to write to an invalid location. Empty spaces in the signature text are clogged with the value 0x00.  
Начиная с регистра 220 записана дата сборки прошивки, в формате "число'''x00'''время'''x00'''" в виде строки (пример: 'Jan 27 2017 17:01:13'). Длина записи — 21 регистр.
Starting from register 220, the firmware build date is recorded, in the format ''number'''x00'''time'''x00''''' as a string (example: 'Jan 27 2017 17:01:13'). The length of the record is 21 registers.


== Управление модулем из командной строки ==
== Command-line device management ==
Программное обеспечение контроллера Wiren Board включает в себя утилиту modbus_client для работы с устройствами, подключенными к выходам RS-485, по протоколу Modbus, подробное описание команды находится на странице [[Modbus-client]]. Доступ к командной строке описан в статье [[SSH]].
The Wiren Board controller software includes  modbus_client utility to work with devices connected to the RS-485 outputs, via Modbus Protocol, the detailed description of the command is on the page [[Modbus-client/en| Modbus client]]. Access to the command line is described in [[SSH/en| SSH]].


=== Пример чтения регистров ===
=== Register reading example ===
Проверим, верно ли, что мы подключились именно к модулю нужного типа. (Модуль wb-mqtt-serial должен быть предварительно остановлен). По адресу 200 хранится уникальная сигнатура длиной в 6 регистров. Прочтем 6 регистров, начиная с адреса 200, и преобразуем полученный шестнадцатеричный ответ в символьную строку:
Let's check whether it is true that we are connected to the module of the desired type. (Module wb-mqtt-serial needs to be stopped). At address 200, a unique signature of 6 registers is stored. Let's read 6 registers, starting with the address 200, and convert the received hexadecimal answer into a character string:


<syntaxhighlight lang="bash">echo  -e `modbus_client --debug -mrtu -pnone -s2 /dev/ttyAPP1 \
<syntaxhighlight lang="bash">echo  -e `modbus_client --debug -mrtu -pnone -s2 /dev/ttyRS485-1 \
-a1 -t0x03 -r200 -c 6 | \
-a1 -t0x03 -r200 -c 6 | \
grep Data | sed -e 's/0x00/\\\x/g' -e 's/Data://' -e 's/\s//g'` </syntaxhighlight>
grep Data | sed -e 's/0x00/\\\x/g' -e 's/Data://' -e 's/\s//g'` </syntaxhighlight>


В результате выполнения команды получаем строку, например '''WBMS'''. Модуль WB-MS в примере имеет Modbus-адрес 1.
As a result of the command we receive string  '''WBMS'''. The WB-MS module in the example has Modbus address 1.

Текущая версия на 22:41, 29 марта 2020

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


Modbus parameters

Modbus address

Modbus-the address of the Wiren Board devices is easy to determine — it is printed on the sticker (the address is in decimal format). The new address of the device is written by the command WRITE_SINGLE_REGISTER to the storage register (holding register) with the address 128 (0x80). For details on how to determine (if the address has been changed) or change the Modbus address of the module, see Define and change the Modbus address of Wirenboard devices.

Modbus commands supported by the device

The Wirenboard sensors support all major Modbus commands. Read more here: Register reading and writing function codes.

Holding Registers

Register/ address Type Read/ write default or error Value Format Purpose Supported in From version

insertions

WB-MS (model code) WB-MS v2 (model code) WB-MSW WB-MSW2 WB-MSW V. 3
0 input R 0x7FFF °C × 10 (signed) Temperature with built-in sensor T - - + +
1 input R

%RH × 10 (signed)

relative humidity with built-in sensor H - + + +
2 input R - LC "(register is not used in WB-MSW sensors, registers 9 and 10 instead)"
Illumination from built-in sensor
L Lux - - -
3 input R - dB × 100 Noise level multiplied by 100 S - + S S
4 input R 0x7FFF °C × 100 (signed) Temperature with built-in sensor + + - - + 4.2
5 input R - %RH × 100 (signed) Relative humidity with built-in sensor + + - - + 4.2
6 input R 0x7FFF °C × 16 (signed) Temperature from external sensor D + - - -
7 input R 0x7FFF °C × 16 (signed) Temperature from external sensor D + - - -
8 input R 0xFFFF PPM CO2 concentration - - After C
9-10 input R LC The illumination, multiplied by 100 (9 - high-order, 10 — LSB luminance values) - - + L
11 input R 0xFFFF PPM Air quality - VOC - - +
88 holding RW 0 ppm (400-1500) Service register, doesn't present in most devices. Manual calibration of CO2 sensor. For calibration, write down here the current CO2 concentration measured by another instrument - - - C C 3.12
89 holding RW 0xFF days' Service register, doesn't present in most devices. Cycle time for co sensor self-calibration algorithm (ABC) - - - C C 3.12
90 holding RW 20 (200 ms) × 10 ms light averaging Time

L, B

- - - -
91 holding RW 20 (200 ms) × 10 ms Noise averaging time S - + S S
95 holding RW 1 1 or 0 CO2 sensor (ABC) auto-calibration to atmospheric CO2 - - - After C
96 holding R 2000 / 5000 ppm (available from firmware version 3.5.0) CO2 concentration measurement Range. Valid values: 2000, 5000, 10000. - - - C C 3.5.0
91 holding RW 20 (200 ms) × 10 ms Время усреднения шума S - + S S
92 holding RW 0 x0.0625 Служебный регистр HOLD_REG_SPL_RAW_OFFSET - сдвиг значения АЦП - - S S S 4.9.0
93 holding RW 0 x0.1dB Служебный регистр HOLD_REG_SPL_OFFSET - поправка к значению уровня шума - - S S S 4.9.0
95 holding RW 1 1 or 0 Режим автокалибровки датчика CO2 (ABC) на атмосферный уровень CO2 - - - С C
96 holding R 2000 / 5000 ppm (доступно с версии прошивки 3.5.0) Диапазон измерения концентрации CO2. Допустимые значения: 2000, 5000, 10000. - - - C C 3.5.0
97 holding RW 0 — 10 c Period between flashes of signal LEDs - - - - + 3.13.0
98 holding RW 0 — 50 MS Led flash duration - - - - + 3.13.0
99 holding RW 16 1 = 0.0625 C (available from firmware version 3.10.0) suspicious value Filter for 1-Wire sensors (85.000 C, 127.937 C). The values are discarded if the previous value differs from the suspicious value by more than * 0.0625 C. Write 0 to disable the filter. D + - - - 3.10.0
100 input R Служебный регистр HOLD_REG_SPL_RAW_INT - - S S S
101 input R Service register HOLD_REG_TH_READS all
102 input R Service register HOLD_REG_TH_ERRORS all
103 holding RW Служебный регистр HOLD_REG_ILLUMINANCE_MODE + + + - -
104-105 input R 32-bit unsigned int uptime counter in seconds all
106 input R Service register INPUT_REG_SGPC3_BASELINE - - - - +
107 input R Service register INPUT_REG_SGPC3_RAW_SIGNAL - - - - +
108 input R 0xFFFF Sgpc3 VERSION service register - - - - + 4.2
110 holding RW 96 baud rate / 100 RS-485 port speed, divided by 100. Permissible speeds: 1200, 2400, 4800, 9600, 19200, 38400, 57600, 115200
(Configure RS-485 communication parameters for Wiren Board Modbus devices)
all >3.1.0
111 holding RW 0 configure the RS-485 port parity bit. Valid values: 0 - no parity bit (none), 1 - odd (odd), 2 - even (even) all
112 holding RW 2 number of stop bits of RS-485 port. Valid values: 1, 2 all
120 (0x78) holding RW 0 non-0 writing to the register causes the module to restart without saving state all
121 (0x79) input R - mV current supply voltage of the module all
128 (0x80) holding RW 1 Modbus device address all
129 (0x81) holding RW 0 0 or 1 Go to bootloader mode all 4.5.0
200-206 input R see Device signature signature all
220-241 input | | | _date__ _time__ firmware build date all
245 holding RW 0 °C × 100 (signed) Self-heating temperature compensation for temperature and humidity sensor (value is subtracted from measured temperature) + - - - + 4.2
250-269 input | | / string, null-terminated firmware version all
270-271 input R 32-bit unsigned int unique identifier (S/N) all
280 input R Maximum value of motion sensor with ADC - - - - +
281 input R Value of the motion sensor with ADC - - - - +
282 holding RW 10 s The width of the time window for calculating the maximum average value of the motion sensor (from 1 to 60 seconds) - - - - +
283 input R Current average value of movement in conventional units - - - - +

Coils

Registers related to IR control are described in WB-MSx_Consumer_IR_Manual/en.

Starting address Quantity Purpose In modifications From firmware version
0 1 Enable buzzer (buzzer) WB-MSW v.3, WB-MSW2
1 1 Forced calibration of the built-in CO2 sensor. Turn on after 20 minutes of operation at a CO2 level of 400 ppm WB-MSW v.3, WB-MSW2
2 1 Turn on the heating (heater) in the temperature and humidity sensor chip HDC1080 WB-MS, WB-MSW v.3, WB-MSW2 3.2.0
3 1 Power on/off of the CO2 sensor WB-MSW V. 3 4.1.0
10 1 Green led on WB-MSW v.3
11 1 Enable red led WB-MSW v.3

Device signature

The 6-byte module signature is stored at address 200. The signature is unique for each model of Wiren Board devices and allows to identify the model by Modbus:

Module Signature
WB-MS WBMS,'0x00','0x00'
WB-MSW WBMSW,'0x00'
WB-MSW2 WBMSW2
WB-MSW v.3 WBMSW3

To get the signature of a device you need to run command READ_HOLDING_REGISTERS at 200 (length of 6 registers). Writing to this area of memory is not supported, and error 3 is returned when attempting to write to an invalid location. Empty spaces in the signature text are clogged with the value 0x00. Starting from register 220, the firmware build date is recorded, in the format numberx00timex00 as a string (example: 'Jan 27 2017 17:01:13'). The length of the record is 21 registers.

Command-line device management

The Wiren Board controller software includes modbus_client utility to work with devices connected to the RS-485 outputs, via Modbus Protocol, the detailed description of the command is on the page Modbus client. Access to the command line is described in SSH.

Register reading example

Let's check whether it is true that we are connected to the module of the desired type. (Module wb-mqtt-serial needs to be stopped). At address 200, a unique signature of 6 registers is stored. Let's read 6 registers, starting with the address 200, and convert the received hexadecimal answer into a character string:

echo  -e `modbus_client --debug -mrtu -pnone -s2 /dev/ttyRS485-1 \
-a1 -t0x03 -r200 -c 6 | \
grep Data | sed -e 's/0x00/\\\x/g' -e 's/Data://' -e 's/\s//g'`

As a result of the command we receive string WBMS. The WB-MS module in the example has Modbus address 1.