WB-MIR v1 - Modbus IR Remote Control

Материал из Wiren Board
Версия от 14:40, 23 июля 2019; RomanKulibaba (обсуждение | вклад) (Новая страница: «== Module management from the web interface ==»)

<languages>


This page describes the device WB-MIR v1, discontinued in 11.2017. Direct replacement is improved module WB-MIR v2

WB-MIR Module
Module internals. Contact labels are visible on the connectors
IR transmitter hole on the back of the module

Learning module with IR transceiver for IR control of various devices, including air conditioners, TVs, etc. The module is controlled from the controller or PC via RS-485 bus by Modbus commands.

Inputs

The module is powered by V+ and GND screw terminals, the RS-485 line is connected to inputs A and B. the DS18B20 External temperature sensor is connected via a parasitic power supply circuit, when the +5V and GND terminals are connected and connected to the GND terminal, the data output is connected to the 1-W terminal. D some models have an internal temperature sensor DS18B20 in the case TO-92, soldered in the upper left part of the module Board (the top view of the sensor housing is printed in this place by silkscreen).

Installation

The module is mounted on the air conditioner on a double-sided tape so that a small hole of the emitting diode on the reverse side would be located opposite the IR receiver of the air conditioner, without closing the receiver from the main console of the device. The position is selected experimentally due to the huge variety of designs of air conditioning housings. The same applies to any household devices controlled by IR channel.

Specifications

Option Value
Power
Supply voltage 9 — 24 V DC
Power consumption

0.1 W

Transmitter range < 1m
External sensor Digital temperature sensor DS18B20 can be connected.
Control
Management interface RS-485
Interface isolation Uninsulated
Communication protocol Modbus RTU, address is set by software, factory settings are indicated on the label
RS-485 interface parameters

speed 9600 bps; data bits 8; parity N; stop bits 2; Starting from firmware version 3.1.0 parameters interfaces can be configured programmatically:

dimensions
Size 45x35x14 mm
Operating conditions
Air temperature -40°C to +80°C
Relative humidity up to 98%,without moisture condensate

Learning and using the module

Detailed description and use of the module, and a map of the registers is described in section how to work with the IR receiver in the WB-MS WB-MSW, WB-MIR devices.

Additional functionality

Address change is broadcast (slave_id 0) team record (WRITE_SINGLE_REGISTER) to holding register with address 128 (0x80).

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. To obtain the signatures necessary to fulfill READ_HOLDING_REGISTERS address 200 length 6. Writing to this area of memory is not supported and error 3 is returned when attempting to write to an invalid location.

Register map

Described in detail in how to work with the IR receiver in the WB-MS WB-MSW, WB-MIR devices .

Register/ address Type Read/ write Default Format Purpose Versions

insertions

6 input R 0x7FFF °C × 16 (signed) Temperature with built-in 1-Wire sensor
7 input R 0x7FFF °C × 16 (signed) Temperature from external 1-Wire sensor
110 holding RW 96 baud rate / 100 RS-485 port speed, "'divided by 100"'. Permissible speeds: 1200, 2400, 4800, 9600, 19200, 38400, 57600, 115200 >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)
112 holding RW 2 number of stop bits of RS-485 port. Valid values: 1, 2
120 (0x78) holding RW 0 other than 0 write to the register causes a reset of the module without saving state
121 (0x79) input R - mV current supply voltage of the module
128 (0x80) holding RW 1 The Modbus address of the device
200-206 input R see device Signature signature
220-241 input R __date__ _ _ time__ the build date of the firmware
250-269 input R string, null-terminated firmware version
270-271 input R 32-bit unsigned int unique identifier (S/N)

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-MIR WBMIR'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. 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.

Module management from the web interface

В настоящий момент для подключения модуля WB-MIR имеется два шаблона WB-MIR и WB-MIR (simple). Шаблон WB-MIR предоставляет полный набор к функциям модуля из веб-интерфейса, включая обучение, а упрощенная версия WB-MIR (simple) может использоваться с уже обученным пультом и содержит гораздо меньшее количество элементов управления.

Веб-интерфейс модуля WB-MIR
Упрощенный веб-интерфейс модуля WB-MIR


На примере полнофункционального модуля рассмотрим основные органы управления модулем и их назначение.

Название элемента управления Назначение
Input Voltage Напряжение питания модуля
Learn to RAM Запись ИК-сигнала в оперативный буфер (см. раздел Оперативный режим). Для обучения контрол переводится в положение ON, после обучения — OFF.
Play from RAM Воспроизведение ИК-сигнала из оперативного буфера (см. раздел Оперативный режим).
Learn to ROMx Запись ИК-сигнала в соотв. ячейку ПЗУ (см. раздел Постоянный режим). Для обучения контрол переводится в положение ON, после обучения — OFF.
Play from ROMx Воспроизведение ИК-сигнала из соотв. ячейки ПЗУ (см. раздел Постоянный режим). Для обучения контрол переводится в положение ON, после обучения — OFF.
ROMx -> RAM Копирование данных из соотв. ячейки ПЗУ в оперативный буфер для редактирования (см. раздел Постоянный режим). Для редактирования контрол переводится в положение ON, после редактирования — OFF.
Internal/External Temperature Sensor Температура внутреннего/внешнего цифрового датчика. Если датчик отсутствует или неисправен, его название выделяется красным цветом.
Serial NO Серийный номер модуля WB-MIR, может потребоваться при обращении в техподдержку.
Reset all ROM Сброс содержимого всех ячеек памяти. Будьте внимательны, очистка ПЗУ будет выполнена без запроса на подтверждение!

Управление модулем из командной строки

Программное обеспечение контроллера Wiren Board включает в себя утилиту modbus_client для работы с устройствами, подключенными к выходам RS-485, по протоколу Modbus, подробное описание команды находится на странице Modbus-client. Доступ к командной строке описан в статье SSH.

Пример чтения регистров

Проверим, верно ли, что мы подключились именно к модулю нужного типа. (Модуль wb-mqtt-serial должен быть предварительно остановлен). По адресу 200 хранится уникальная сигнатура длиной в 6 регистров. Прочтем 6 регистров, начиная с адреса 200, и преобразуем полученный ответ из шестнадцатеричных цифр в символьную строку:

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

В результате выполнения команды получаем строку, например WBMIR. В этом примере модуль WB-MIR имеет Modbus-адрес 1.