Шаблон, который я ввожу через веб-интерфейс, выглядит вот так:
Код
{
“slave_id”: “124:1”,
“name”: “MOTOR_2”,
“enabled”: true,
“protocol”: “modbus_io”,
“stride”: 1000,
“shift”: 500,
“channels”: [
{
“name”: “EXT2_DIR1”,
“type”: “switch”,
“reg_type”: “coil”,
“address”: “0”
},
{
“name”: “EXT2_ON1”,
“type”: “switch”,
“reg_type”: “coil”,
“address”: “1”
},
{
“name”: “EXT2_DIR2”,
“type”: “switch”,
“reg_type”: “coil”,
“address”: “2”
},
{
“name”: “EXT2_ON2”,
“type”: “switch”,
“reg_type”: “coil”,
“address”: “3”
},
{
“name”: “EXT2_DIR3”,
“type”: “switch”,
“reg_type”: “coil”,
“address”: “4”
},
{
“name”: “EXT2_ON3”,
“type”: “switch”,
“reg_type”: “coil”,
“address”: “5”
},
{
“name”: “EXT2_DIR4”,
“type”: “switch”,
“reg_type”: “coil”,
“address”: “6”
},
{
“name”: “EXT2_ON4”,
“type”: “switch”,
“reg_type”: “coil”,
“address”: “7”
}
],
“poll_interval”: 1000,
“delay_ms”: 10,
“id”: “wb-motor_2”,
“setup”: [
{
“address”: “10000”,
“title”: “IODIR”,
“value”: “0x0000”
},
{
“address”: “10001”,
“title”: “IPOL”,
“value”: “0x0000”
},
{
“address”: “10002”,
“title”: “GPINTEN”,
“value”: “0x0000”
},
{
“address”: “10003”,
“title”: “DEFVAL”,
“value”: “0x0000”
},
{
“address”: “10004”,
“title”: “INTCON”,
“value”: “0x0000”
},
{
“address”: “10005”,
“title”: “IOCON”,
“value”: “0x4444”
},
{
“address”: “9999”,
“title”: “FLAG”,
“value”: “1”
}
]
}
Но после сохранения он меняется на такой:
Код
{
“slave_id”: “124:1”,
“name”: “MOTOR_2”,
“enabled”: true,
“channels”: [
{
“name”: “EXT2_DIR1”,
“type”: “switch”,
“reg_type”: “coil”,
“address”: “0”
},
{
“name”: “EXT2_ON1”,
“type”: “switch”,
“reg_type”: “coil”,
“address”: “1”
},
{
“name”: “EXT2_DIR2”,
“type”: “switch”,
“reg_type”: “coil”,
“address”: “2”
},
{
“name”: “EXT2_ON2”,
“type”: “switch”,
“reg_type”: “coil”,
“address”: “3”
},
{
“name”: “EXT2_DIR3”,
“type”: “switch”,
“reg_type”: “coil”,
“address”: “4”
},
{
“name”: “EXT2_ON3”,
“type”: “switch”,
“reg_type”: “coil”,
“address”: “5”
},
{
“name”: “EXT2_DIR4”,
“type”: “switch”,
“reg_type”: “coil”,
“address”: “6”
},
{
“name”: “EXT2_ON4”,
“type”: “switch”,
“reg_type”: “coil”,
“address”: “7”
}
],
“poll_interval”: 1000,
“delay_ms”: 10,
“id”: “wb-motor_2”,
“setup”: [
{
“address”: “10000”,
“title”: “IODIR”,
“value”: “0x0000”
},
{
“address”: “10001”,
“title”: “IPOL”,
“value”: “0x0000”
},
{
“address”: “10002”,
“title”: “GPINTEN”,
“value”: “0x0000”
},
{
“address”: “10003”,
“title”: “DEFVAL”,
“value”: “0x0000”
},
{
“address”: “10004”,
“title”: “INTCON”,
“value”: “0x0000”
},
{
“address”: “10005”,
“title”: “IOCON”,
“value”: “0x4444”
},
{
“address”: “9999”,
“title”: “FLAG”,
“value”: “1”
}
],
“stride”: 1000,
“shift”: 500
}
Информация о протоколе куда-то пропадает, что я и пытаюсь донести с самого начала
Вывод из консоли вот такой:
Код
root@wirenboard-ANWOD5X3:~# dpkg -s wb-mqtt-serial
Package: wb-mqtt-serial
Status: install ok installed
Priority: optional
Section: misc
Installed-Size: 1487
Maintainer: Evgeny Boger boger@contactless.ru
Architecture: armhf
Version: 1.63.0
Replaces: wb-homa-modbus (<< 1.14.1)
Depends: libc6 (>= 2.4), libgcc1 (>= 1:3.5), libjsoncpp1 (>= 1.7.4), libmosquitto1 (>= 1.0), libmosquittopp1 (>= 1.0), libstdc++6 (>= 6), libwbmqtt0 (>= 1.7), bsdutils, wb-utils (>= 2.0)
Breaks: wb-homa-modbus (<< 1.14.1), wb-mqtt-confed (<< 1.0.2), wb-mqtt-homeui (<< 1.7)
Conffiles:
/etc/init.d/wb-mqtt-serial 1f6938ea476ac51c4b845327d5e40f03
/etc/wb-configs.d/11wb-mqtt-serial 5325e375bc486e31384ed908b8ceae0e
/etc/wb-mqtt-serial.conf.sample c8c1adbf630e6fd7ec871b1b5c4a5e0f
Description: Wiren Board Smart Home MQTT serial protocol driver.