Так.
Я правильно понимаю, что описание в виде стандартной рыбы (template) пока не парсится?
wb-mqtt-serial -d1 -c ./wb-mqtt-serial.conf
ERROR: [serial] Validation failed.
Error 1
context: [device][channels][0]
desc: Object contains a property that could not be validated using ‘properties’ or ‘additionalProperties’ constraints: ‘channel_readonly’.
Error 2
context: [device][channels][0]
desc: Failed to validate against child schema #0.
Error 3
context: [device][channels][0]
desc: Object contains a property that could not be validated using ‘properties’ or ‘additionalProperties’ constraints: ‘address’.
Error 4
context: [device][channels][0]
desc: Failed to validate against child schema #1.
Error 5
context: [device][channels][0]
desc: Failed to validate against any child schemas allowed by oneOf constraint.
Error 6
context: [device][channels]
desc: Failed to validate item #0 in array.
Error 7
context: [device][channels][1]
desc: Object contains a property that could not be validated using ‘properties’ or ‘additionalProperties’ constraints: ‘channel_readonly’.
Error 8
context: [device][channels][1]
desc: Failed to validate against child schema #0.
Error 9
context: [device][channels][1]
desc: Object contains a property that could not be validated using ‘properties’ or ‘additionalProperties’ constraints: ‘address’.
Error 10
context: [device][channels][1]
desc: Failed to validate against child schema #1.
Error 11
context: [device][channels][1]
desc: Failed to validate against any child schemas allowed by oneOf constraint.
Error 12
context: [device][channels]
desc: Failed to validate item #1 in array.
Error 13
context: [device]
desc: Failed to validate against schema associated with property name ‘channels’.
Error 14
context:
desc: Failed to validate against schema associated with property name ‘device’.
Пришлите, пожалуйста, wb-mqtt-serial.conf, который вызвал эту ошибку. Тут парсер ругается на неизвестный параметр ‘channel_readonly’ и неверный формат параметра ‘address’.
На wb-mqtt-serial 1.57.0 еще настраивал Modbus TCP. Все работало. Не могу сказать, что всегда были корректные значения, но скорее всего виноват мост USR-W600.
Так же использовал socat c modbus_client. Вроде проблем небыло.
Wb6.2 с одной стороны, апдейт до последних версий всего сразу из коробки. С другого конца - на одном узле saia burgess (см. начало топика), на другом вот овён 160й. Оба отлично дуплят по wb-mqtt-serial, на обоих утилитка modbus_client не работает с tcp вообще.
Святый Ганеша, что за адские шудры вычесывали этот “код” из шелудивых подмышек… Я такого даже у китайских первокуров не видел…
Патч:
--- mbu-common.h.orig 2021-05-14 16:36:50.404155964 +0000
+++ mbu-common.h 2019-03-20 17:57:22.000000000 +0000
@@ -14,8 +14,11 @@
int getInt(const char str[], int *ok) {
int value;
int ret = sscanf(str, "0x%x", &value);
- if (0 >= ret) {//couldn't convert from hex, try dec
- ret = sscanf(str, "%d", &value);
+ if (0 >= ret) { // couldn't convert from hex, try dec
+ if (strstr(str, ".")) // dotted ip address
+ ret = 0;
+ else
+ ret = sscanf(str, "%d", &value);
}
if (0 != ok) {