Доброго времени суток, возникла сложность с добавлением стороннего устройства на контроллер
wb v7.4.3 версия прошивки wb2404, добавляю шаблон в папку /etc/wb-mqtt-serial.conf.d/templates
вижу свое устройство, но при его выборе дает ошибку Server error: Can’t open file:/var/lib/wb-mqtt-serial/schemas/config-segnetics-smh4.schema.json.
Добрый день. А что при этом в логах? Посмотрите вывод wb-mqtt-confed
log-confed.txt (26,3 КБ)
Добавил два других устройства через шаблон, все в порядке, а конкретно этот не хочет, хотя функционирует на прошивке 2207
config-segnetics-smh4.json (32,4 КБ)
Цитата из лога:
Jun 12 02:20:45 wirenboard-AS566KG5 wb-mqtt-confed[1852]: ERROR: external command error, /etc/wb-mqtt-serial.conf: exit status 1 from wb-mqtt-serial -J: <3>ERROR: [serial] File: /usr/share/wb-mqtt-serial/templates/config-segnetics-smh4.json error: Validation failed.
Error 1
context: <root>[device][channels][58][name]
desc: Failed to match regex specified by 'pattern' constraint.
Error 2
context: <root>[device][channels][58]
desc: Failed to validate against schema associated with property name 'name'.
Error 3
context: <root>[device][channels][58]
desc: Failed to validate against child schema #0.
Error 4
context: <root>[device][channels][58]
desc: Failed to validate against child schema #0.
Error 5
context: <root>[device][channels][58]
desc: Missing required property 'consists_of'.
Error 6
context: <root>[device][channels][58]
desc: Failed to validate against child schema #1.
Error 7
context: <root>[device][channels][58][name]
desc: Failed to match regex specified by 'pattern' constraint.
Error 8
context: <root>[device][channels][58]
desc: Failed to validate against schema associated with property name 'name'.
Error 9
context: <root>[device][channels][58]
desc: Failed to validate against child schema #0.
Error 10
context: <root>[device][channels][58]
desc: Failed to validate against child schema #2.
Error 11
context: <root>[device][channels][58][name]
desc: Failed to match regex specified by 'pattern' constraint.
Error 12
context: <root>[device][channels][58]
desc: Failed to validate against schema associated with property name 'name'.
Error 13
context: <root>[device][channels][58]
desc: Failed to validate against child schema #0.
Error 14
context: <root>[device][channels][58]
desc: Failed to validate against child schema #3.
Error 15
context: <root>[device][channels][58]
desc: Failed to validate against any child schemas allowed by oneOf constraint.
Error 16
context: <root>[device][channels][58]
desc: Failed to validate against child schema #0.
Error 17
context: <root>[device][channels][58]
desc: Failed to validate against child schema #0.
Error 18
context: <root>[device][channels][58]
desc: Missing required property 'device_type'.
Error 19
context: <root>[device][channels][58]
desc: Failed to validate against child schema #1.
Error 20
context: <root>[device][channels][58]
desc: Failed to validate against any child schemas allowed by oneOf constraint.
Error 21
context: <root>[device][channels]
desc: Failed to validate item #58 in array.
Error 22
context: <root>[device][channels][59][name]
desc: Failed to match regex specified by 'pattern' constraint.
Error 23
context: <root>[device][channels][59]
desc: Failed to validate against schema associated with property name 'name'.
Error 24
context: <root>[device][channels][59]
desc: Failed to validate against child schema #0.
Error 25
context: <root>[device][channels][59]
desc: Failed to validate against child schema #0.
Error 26
context: <root>[device][channels][59]
desc: Missing required property 'consists_of'.
Error 27
context: <root>[device][channels][59]
desc: Failed to validate against child schema #1.
Error 28
context: <root>[device][channels][59][name]
desc: Failed to match regex specified by 'pattern' constraint.
Error 29
context: <root>[device][channels][59]
desc: Failed to validate against schema associated with property name 'name'.
Error 30
context: <root>[device][channels][59]
desc: Failed to validate against child schema #0.
Error 31
context: <root>[device][channels][59]
desc: Failed to validate against child schema #2.
Error 32
context: <root>[device][channels][59][name]
desc: Failed to match regex specified by 'pattern' constraint.
Error 33
context: <root>[device][channels][59]
desc: Failed to validate against schema associated with property name 'name'.
Error 34
context: <root>[device][channels][59]
desc: Failed to validate against child schema #0.
Error 35
context: <root>[device][channels][59]
desc: Failed to validate against child schema #3.
Error 36
context: <root>[device][channels][59]
desc: Failed to validate against any child schemas allowed by oneOf constraint.
Error 37
context: <root>[device][channels][59]
desc: Failed to validate against child schema #0.
Error 38
context: <root>[device][channels][59]
desc: Failed to validate against child schema #0.
Error 39
context: <root>[device][channels][59]
desc: Missing required property 'device_type'.
Error 40
context: <root>[device][channels][59]
desc: Failed to validate against child schema #1.
Error 41
context: <root>[device][channels][59]
desc: Failed to validate against any child schemas allowed by oneOf constraint.
Error 42
context: <root>[device][channels]
desc: Failed to validate item #59 in array.
Error 43
context: <root>[device]
desc: Failed to validate against schema associated with property name 'channels'.
Error 44
context: <root>[device]
desc: Failed to validate against child schema #2.
Error 45
context: <root>[device]
desc: Failed to validate against child schema #0.
Error 46
context: <root>[device]
desc: Failed to validate against any child schemas allowed by oneOf constraint.
Error 47
context: <root>
desc: Failed to validate against schema associated with property name 'device'.
Рекомендую выкинуть для проверки из указанных блоков, строки 541, 550 символы и экранированные кавычки…
{
"address" : "0xA046",
"format" : "u16",
"name" : "Current setting of summer and winter modes (setpoint \"Season\"): 0 \u2013 forced winter mode (\"Winter\") 1 \u2013 forced summer mode (\"Summer\") 2 \u2013 operation mode for the outdoor temperature sensor (\"Auto\")",
"offset" : 0,
"reg_type" : "input",
"scale" : 1,
"type" : "value"
},
{
"address" : "0xA047",
"format" : "float",
"name" : "The value of the correction calculated by the function \"Temperature setpoint compensation\"",
"offset" : 0,
"reg_type" : "input",
"scale" : 1,
"type" : "value",
"word_order" : "little_endian"
},
затык чисто тут, если убрать экраны, то schema.json генерируется и работает. Есть совет как поступить?
А если использовать простое и допустимое в качестве топика имя а использовать всякие спецсимволы в “переводах” (отображаемом имени)?