Перейти к содержанию

Навигация

WB-MIR v1 - Modbus IR Remote Control/en: различия между версиями

Новая страница: «On the example of a fully functional module, consider the main controls of the module and their purpose. {| class="wikitable" ! The name of the control !Purpose |…»
(Новая страница: «== Learning and using the module ==»)
(Новая страница: «On the example of a fully functional module, consider the main controls of the module and their purpose. {| class="wikitable" ! The name of the control !Purpose |…»)
 
(не показано 17 промежуточных версий этого же участника)
Строка 75: Строка 75:
== Learning and using the module ==
== Learning and using the module ==


Подробное описание и использования модуля, а также карта регистров, описаны в разделе [[WB-MSx_Consumer_IR_Manual|Инструкция по работе с ИК-приёмопередатчиком в устройствах WB-MS, WB-MSW, WB-MIR]].
Detailed description and use of the module, and a map of the registers is described in section [[WB-MSx_Consumer_IR_Manual/en|how to work with the IR receiver in the  WB-MS WB-MSW, WB-MIR devices]].


== Дополнительные Функции==
== Additional functionality==


'''Смена адреса''' производится широковещательный (slave_id 0) командой записи (WRITE_SINGLE_REGISTER) в holding register с адресом 128 (0x80).
'''Address change''' is broadcast (slave_id 0) team record (WRITE_SINGLE_REGISTER) to holding register with address 128 (0x80).


По адресу 200 лежит '''сигнатура''' длинной 6 байт. Сигнатура уникальна для каждой модели устройства и позволяет идентифицировать модель.
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.
Для получения сигнатуры нужно выполнить READ_HOLDING_REGISTERS адрес 200 длина 6.   
To obtain the signatures necessary to fulfill READ_HOLDING_REGISTERS address 200 length 6.   
Запись в эту область памяти не поддерживается, при попытки записи в недопустимое место возвращается ошибка 3.
Writing to this area of memory is not supported and error 3 is returned when attempting to write to an invalid location.


== Карты регистров ==
== Register map ==


Подробно описаны в разделе [[WB-MSx_Consumer_IR_Manual|Инструкция по работе с ИК-приёмопередатчиком в устройствах WB-MS, WB-MSW, WB-MIR]].
Described in detail in [[WB-MSx_Consumer_IR_Manual/en|how to work with the IR receiver in the WB-MS WB-MSW, WB-MIR devices ]].


{| class="wikitable"
{| class="wikitable"
! rowspan="2" |Регистр/ адрес
! rowspan="2" |Register/ address
! rowspan="2" |Тип
! rowspan="2" |Type
! rowspan="2" |Чтение/ запись
! rowspan="2" |Read/ write
! rowspan="2" |Значение по умолчанию
! rowspan="2" |Default
! rowspan="2" |Формат
! rowspan="2" |Format
! rowspan="2" |Назначение
! rowspan="2" |Purpose
!Версии
!Versions
прошивки
insertions
|-
|-
!
!
Строка 106: Строка 106:
|0x7FFF
|0x7FFF
|°C × 16 (signed)
|°C × 16 (signed)
|Температура с встроенного датчика 1-Wire
|Temperature with built-in 1-Wire sensor
|
|
|-
|-
Строка 114: Строка 114:
|0x7FFF
|0x7FFF
|°C × 16 (signed)
|°C × 16 (signed)
|Температура с внешнего датчика 1-Wire
|Temperature from external 1-Wire sensor
|
|
|-
|-
Строка 130: Строка 130:
|96
|96
|baud rate / 100
|baud rate / 100
|скорость порта RS-485, '''делённая на 100'''. Допустимые скорости: 1200, 2400, 4800, 9600, 19200, 38400, 57600, 115200
|RS-485 port speed, "'divided by 100"'. Permissible speeds: 1200, 2400, 4800, 9600, 19200, 38400, 57600, 115200
| rowspan="3" |>3.1.0
| rowspan="3" |>3.1.0
|-
|-
Строка 138: Строка 138:
|0
|0
|
|
|настройка бита чётности порта RS-485. Допустимые значения: 0 - нет бита чётности (none), 1 - нечётный (odd), 2 - чётный (even)
|configure the RS-485 port parity bit. Valid values: 0 - no parity bit (none), 1 - odd (odd), 2 - even (even)
|-
|-
|112
|112
Строка 145: Строка 145:
|2
|2
|
|
|количество стоп-битов порта RS-485. Допустимые значения: 1, 2
|number of stop bits of RS-485 port. Valid values: 1, 2
|-
|-
|
|
Строка 159: Строка 159:
|RW
|RW
|0
|0
|отличное от 0
|other than 0
|запись в регистр вызывает перезагрузку модуля без сохранения состояния
|write to the register causes a reset of the module without saving state
|
|
|-
|-
Строка 168: Строка 168:
| -
| -
|mV
|mV
|текущее напряжение питания модуля
|current supply voltage of the module
|
|
|-
|-
Строка 176: Строка 176:
|1
|1
|
|
|Modbus-адрес устройства
|The Modbus address of the device
|
|
|-
|-
Строка 182: Строка 182:
|input
|input
|R
|R
|см. [[Sensors Modbus Management|Сигнатура устройства]]
|see [[Sensors Modbus Management|device Signature]]
|
|
|сигнатура
|signature
|
|
|-
|-
Строка 191: Строка 191:
|R
|R
|
|
|__date__ __time__
|__date__ _ _ time__
|дата сборки прошивки
|the build date of the firmware
|
|
|-
|-
Строка 199: Строка 199:
|R
|R
|
|
|строка, null-terminated
|string, null-terminated
|версия прошивки
|firmware version
|
|
|-
|-
Строка 208: Строка 208:
|
|
|32-bit unsigned int
|32-bit unsigned int
|уникальный идентификатор (S/N)
|unique identifier (S/N)
|
|
|}
|}


==Сигнатура устройства ==
== 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-MIR
| WB-MIR
Строка 224: Строка 224:
|}
|}


Для получения сигнатуры нужно выполнить команду 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.


== Управление модулем из web-интерфейса ==
== Module management from the web interface ==


В настоящий момент для подключения модуля WB-MIR имеется два шаблона '''WB-MIR''' и '''WB-MIR (simple)'''. Шаблон '''WB-MIR''' предоставляет полный набор к функциям модуля из веб-интерфейса, включая обучение, а упрощенная версия '''WB-MIR (simple)''' может использоваться с уже обученным пультом и содержит гораздо меньшее количество элементов управления.
At the moment, to connect the module WB-MIR, there are two templates: '''WB-MIR''' and '''WB-MIR (simple)'''. Template '''WB-MIR''' provides a complete set of functions of the module from the web interface, including training, and a simplified version '''WB-MIR (simple)''' can be used with the already trained remote control and contains a much smaller number of controls.


{| class="wikitable"
{| class="wikitable"
|[[File:Web_wb_mir.png |600px|thumb|right|Веб-интерфейс модуля WB-MIR]]  
|[[File:Web_wb_mir.png |600px|thumb|right|WB-MIR Web interface]]  
|[[File:Web-wb-mir-simple.png|300px|thumb|right|Упрощенный веб-интерфейс модуля WB-MIR]]  
|[[File:Web-wb-mir-simple.png|300px|thumb|right|Simplified WB-MIR web interface]]  
|}
|}




На примере полнофункционального модуля рассмотрим основные органы управления модулем и их назначение.
<div class="mw-translate-fuzzy">
On the example of a fully functional module, consider the main controls of the module and their purpose.
{| class="wikitable"
{| class="wikitable"
! Название элемента управления
! The name of the control
!Назначение
!Purpose
|-
|-
|Input Voltage||Напряжение питания модуля
|Input Voltage||module supply Voltage
|-
|-
|Learn to RAM||Запись ИК-сигнала в оперативный буфер (см. раздел [[#Оперативный режим|Оперативный режим]]). Для обучения контрол переводится в положение ON, после обучения — OFF.   
|Learn-to-RAM||Write the IR signal in the operational buffer (see section [[#Operational mode|Operational mode]]). For learning, the control is turned ON, after learning — OFF.   
|-
|-
|Play from RAM||Воспроизведение ИК-сигнала из оперативного буфера (см. раздел [[#Оперативный режим|Оперативный режим]]).
|Play from RAM||Play the IR signal from the operating buffer (see [[#Operating mode|Operating mode]]).
|-
|-
|Learn to ROMx||Запись ИК-сигнала в соотв. ячейку ПЗУ (см. раздел [[#Постоянный режим|Постоянный режим]]). Для обучения контрол переводится в положение ON, после обучения — OFF.
|Learn to ROMx||IR signal Recording ACC. the cell of the ROM (see section [[#DC mode|DC mode]]). For learning, the control is turn ON position, after learning — OFF.
|-
|-
|Play from ROMx||Воспроизведение ИК-сигнала из соотв. ячейки ПЗУ (см. раздел [[#Постоянный режим|Постоянный режим]]). Для обучения контрол переводится в положение ON, после обучения — OFF.
|Play from ROMx||Play IR signal from resp. ROM cells (see [[#Constant mode|Constant mode]]]). For learning, the control is transferred to THE on position, after learning — OFF.
|-
|-
|ROMx -> RAM||Копирование данных из соотв. ячейки ПЗУ в оперативный буфер для редактирования (см. раздел [[#Постоянный режим|Постоянный режим]]). Для редактирования контрол переводится в положение ON, после редактирования — OFF.
|ROMx -> RAM||Copy data from ACC. ROM cells to the online buffer for editing (see [[#Constant mode|Constant mode]]). For editing, control is transferred to THE on position, after editing — OFF.
|-
|-
|Internal/External Temperature Sensor||Температура внутреннего/внешнего цифрового датчика. Если датчик отсутствует или неисправен, его название выделяется красным цветом.
|Internal/External Temperature Sensor||Internal/external digital temperature sensor. If the sensor is missing or defective, its name is highlighted in red.
|-
|-
|Serial NO||Серийный номер модуля WB-MIR, может потребоваться при обращении в техподдержку.
|Serial NO||the Serial number of the WB-MIR module may be required when contacting technical support.
|-
|-
|Reset all ROM||Сброс содержимого всех ячеек памяти. '''Будьте внимательны, очистка ПЗУ будет выполнена без запроса на подтверждение!'''
|Reset all ROM||Resets the contents of all memory locations. '''Be careful, ROM cleaning will be done without asking for confirmation!'''
|-
|-
|}
|}
</div>


== Управление модулем из командной строки ==
== 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 answer from hexadecimal digits 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/ttyAPP1 \
Строка 272: Строка 274:
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>


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

правки