Alexander_Kuznetsov, благодарю за помощь.
Указание в шаблоне опции “max_read_registers”:0 результата не дало - контроллер упорно читает последовательно расположенные дискретные регистры отдельными запросами - адреса 4096, 4097, 4098 и т.д. Кроме того, при попытке посмотреть, что делает драйвер командой wb-mqtt-serial - отваливается устройство (единственное подключенное устройство)… это нормальное поведение? При переподключении порта связь восстанавливается.
Ниже фрагмент вывода лога из консоли
7>DEBUG: [serial client] </dev/ttyRS485-1 115200 8 N 1>552035409: Wait until 552035409
<7>DEBUG: [port] /dev/ttyRS485-1: Sleep 20000 us
<7>DEBUG: [port] /dev/ttyRS485-1: Sleep 350 us
<7>DEBUG: [port] /dev/ttyRS485-1: Write: 10 02 10 00 00 01 be 4b
<7>DEBUG: [port] /dev/ttyRS485-1: Sleep 695 us
<4>WARNING: [modbus] failed to read 1 discrete(s) @ 4096 of device modbus:16: Serial protocol error: request timed out
<4>WARNING: [serial device] device modbus:16 is disconnected
<7>DEBUG: [serial client] </dev/ttyRS485-1 115200 8 N 1>552035556: Wait until 552035556
<7>DEBUG: [port] /dev/ttyRS485-1: Sleep 20000 us
<7>DEBUG: [port] /dev/ttyRS485-1: Sleep 350 us
<7>DEBUG: [port] /dev/ttyRS485-1: Write: 10 02 10 01 00 01 ef 8b
<7>DEBUG: [port] /dev/ttyRS485-1: Sleep 695 us
<7>DEBUG: [modbus] failed to read 1 discrete(s) @ 4097 of device modbus:16: Serial protocol error: read() failed
<7>DEBUG: [serial client] Device modbus:16 poll delayed for 500 ms
<7>DEBUG: [serial client] </dev/ttyRS485-1 115200 8 N 1>552035598: Wait until 552035698
<7>DEBUG: [serial client] </dev/ttyRS485-1 115200 8 N 1>552035698: Wait until 552035798
<7>DEBUG: [serial client] </dev/ttyRS485-1 115200 8 N 1>552035798: Wait until 552035898
<7>DEBUG: [serial client] </dev/ttyRS485-1 115200 8 N 1>552035898: Wait until 552035998
<7>DEBUG: [serial client] </dev/ttyRS485-1 115200 8 N 1>552035998: Wait until 552036056
<7>DEBUG: [port] /dev/ttyRS485-1: Sleep 20000 us
<7>DEBUG: [port] /dev/ttyRS485-1: Sleep 350 us
<7>DEBUG: [port] /dev/ttyRS485-1: Write: 10 02 10 02 00 01 1f 8b
<7>DEBUG: [port] /dev/ttyRS485-1: Sleep 695 us
<7>DEBUG: [modbus] failed to read 1 discrete(s) @ 4098 of device modbus:16: Serial protocol error: request timed out
<7>DEBUG: [serial client] Device modbus:16 poll delayed for 1000 ms
<7>DEBUG: [serial client] </dev/ttyRS485-1 115200 8 N 1>552036183: Wait until 552036283
<7>DEBUG: [serial client] </dev/ttyRS485-1 115200 8 N 1>552036283: Wait until 552036383
<4>WARNING: [mqtt] connection lost
<7>DEBUG: [serial client] </dev/ttyRS485-1 115200 8 N 1>552036384: Wait until 552036484
<7>DEBUG: [serial client] </dev/ttyRS485-1 115200 8 N 1>552036484: Wait until 552036584
<7>DEBUG: [serial client] </dev/ttyRS485-1 115200 8 N 1>552036584: Wait until 552036684
<7>DEBUG: [serial client] </dev/ttyRS485-1 115200 8 N 1>552036684: Wait until 552036784
<7>DEBUG: [serial client] </dev/ttyRS485-1 115200 8 N 1>552036784: Wait until 552036884
<7>DEBUG: [serial client] </dev/ttyRS485-1 115200 8 N 1>552036884: Wait until 552036984
<7>DEBUG: [serial client] </dev/ttyRS485-1 115200 8 N 1>552036985: Wait until 552037056
<7>DEBUG: [port] /dev/ttyRS485-1: Sleep 20000 us
<7>DEBUG: [port] /dev/ttyRS485-1: Sleep 350 us
<7>DEBUG: [port] /dev/ttyRS485-1: Write: 10 02 10 03 00 01 4e 4b
<7>DEBUG: [port] /dev/ttyRS485-1: Sleep 695 us
<7>DEBUG: [modbus] failed to read 1 discrete(s) @ 4099 of device modbus:16: Serial protocol error: read() failed
<7>DEBUG: [serial client] Device modbus:16 poll delayed for 1500 ms
<7>DEBUG: [serial client] </dev/ttyRS485-1 115200 8 N 1>552037097: Wait until 552037197
<7>DEBUG: [serial client] </dev/ttyRS485-1 115200 8 N 1>552037198: Wait until 552037298
<7>DEBUG: [serial client] </dev/ttyRS485-1 115200 8 N 1>552037298: Wait until 552037398
Также прикладываю шаблон устройства:
{
"device_type": "oven_pr200",
"title": "ОВЕН ПР 200",
"group": "g-custom",
"device":
{
"name": "ОВЕН ПР200",
"id": "oven_pr200",
"max_read_registres":0,
"groups": [
{
"title": "Дискретные входы",
"id": "group1",
"order":0
},
{
"title": "Дискретные выходы",
"id": "group2",
"order":1
}
],
"channels": [
{
"name": "DI1",
"reg_type": "discrete",
"address": "4096",
"group": "group1"
},
{
"name": "DI2",
"reg_type": "discrete",
"address": "4097",
"group": "group1"
},
{
"name": "DI3",
"reg_type": "discrete",
"address": "4098",
"group": "group1"
},
{
"name": "DI4",
"reg_type": "discrete",
"address": "4099",
"group": "group1"
},
{
"name": "DI5",
"reg_type": "discrete",
"address": "4100",
"group": "group1"
},
{
"name": "DI6",
"reg_type": "discrete",
"address": "4101",
"group": "group1"
},
{
"name": "DI7",
"reg_type": "discrete",
"address": "4102",
"group": "group1"
},
{
"name": "DI8",
"reg_type": "discrete",
"address": "4103",
"group": "group1"
},
{
"name": "DO1",
"reg_type": "coil",
"type": "switch",
"address": "0",
"group": "group2"
},
{
"name": "DO2",
"reg_type": "coil",
"type": "switch",
"address": "1",
"group": "group2"
}
],
"parameters": [
{
"id": "modification",
"title": "Модификация реле",
"reg_type": "holding",
"type": "value",
"enum": [0,1,2],
"enum_titles": [
"ПР200-220.1.х.0 - 8DI(230)/6DO",
"ПР200-220.2.х.0 - 8xDI(230)/4xAI/8xDO(Р)/2xAO(И)",
"ПР24.3.2.0 - 8xDI(24)/4xAI/8xDO(Р)"
],
"default": 0,
"readonly": true,
"order":0
},
{
"id": "exp_module",
"title": "Модули расширения",
"reg_type": "holding",
"type": "value",
"enum": [0,1,2],
"enum_titles": ["нет","1","2"],
"default": 0,
"readonly": true,
"order":1
}
],
"translations": {}
}
}