Ошибки при чтении ModBus устройств

Здравствуйте! Почему-то два из трёх устройств на одном из портов не читаются, регистры разве что на пару секунд после ребута WB становятся чёрными, а потом опять красными. Вот конфиг:

Конфиг
{
  "path": "/dev/ttyRS485-2",
  "devices": [
    {
      "slave_id": "2",
      "name": "Buhler",
      "id": "buhler",
      "protocol": "modbus",
      "enabled": true,
      "poll_interval": 1000,
      "channels": [
        {
          "name": "DrawingSW",
          "type": "switch",
          "reg_type": "coil",
          "address": "0",
          "format": "s16",
          "scale": 1,
          "offset": 0
        },
        {
          "name": "Drawing",
          "type": "value",
          "reg_type": "input",
          "address": "0",
          "format": "s16",
          "scale": 1,
          "offset": 0
        },
        {
          "name": "Drawing_setpoint",
          "type": "range",
          "reg_type": "holding",
          "address": "0",
          "format": "s16",
          "scale": 1,
          "offset": 0,
          "max": "100"
        },
        {
          "name": "MasterBedroomSW",
          "type": "switch",
          "reg_type": "coil",
          "address": "1",
          "format": "s16",
          "scale": 1,
          "offset": 0
        },
        {
          "name": "MasterBedroom",
          "type": "value",
          "reg_type": "input",
          "address": "1",
          "format": "s16",
          "scale": 1,
          "offset": 0
        },
        {
          "name": "MasterBedroom_setpoint",
          "type": "range",
          "reg_type": "holding",
          "address": "1",
          "format": "s16",
          "scale": 1,
          "offset": 0,
          "max": "100"
        },
        {
          "name": "BedroomGuestSW",
          "type": "switch",
          "reg_type": "coil",
          "address": "2",
          "format": "s16",
          "scale": 1,
          "offset": 0
        },
        {
          "name": "BedroomGuest",
          "type": "value",
          "reg_type": "input",
          "address": "2",
          "format": "s16",
          "scale": 1,
          "offset": 0
        },
        {
          "name": "BedroomGuest_setpoint",
          "type": "range",
          "reg_type": "holding",
          "address": "2",
          "format": "s16",
          "scale": 1,
          "offset": 0,
          "max": "100"
        }
      ],
      "device_max_fail_cycles": 0
    },
    {
      "slave_id": "1",
      "name": "SystemAir",
      "id": "SystemAir",
      "enabled": true,
      "protocol": "modbus",
      "poll_interval": 2000,
      "channels": [
        {
          "name": "Supply_air_sensor",
          "type": "value",
          "reg_type": "holding",
          "address": "213",
          "format": "s16",
          "poll_interval": 1000,
          "channel_readonly": false
        },
        {
          "name": "FanSpeed",
          "type": "range",
          "reg_type": "holding",
          "address": "100",
          "max": "4",
          "poll_interval": 1000
        },
        {
          "name": "Fan_SF_RPM",
          "type": "value",
          "reg_type": "holding",
          "address": "110",
          "channel_readonly": true,
          "poll_interval": 1000
        },
        {
          "name": "Fan_EF_RPM",
          "type": "value",
          "reg_type": "holding",
          "address": "111",
          "channel_readonly": true,
          "poll_interval": 1000
        },
        {
          "name": "REG_HC_WH_SIGNAL",
          "type": "value",
          "reg_type": "holding",
          "address": "204",
          "channel_readonly": true,
          "poll_interval": 1000
        },
        {
          "name": "REG_HC_TEMP_IN1",
          "type": "temperature",
          "reg_type": "holding",
          "address": "213",
          "scale": 0.1,
          "channel_readonly": true,
          "poll_interval": 1000
        },
        {
          "name": "REG_HC_TEMP_IN2",
          "type": "temperature",
          "reg_type": "holding",
          "address": "214",
          "scale": 0.1,
          "channel_readonly": true,
          "poll_interval": 1000
        },
        {
          "name": "REG_HC_TEMP_IN3",
          "type": "temperature",
          "reg_type": "holding",
          "address": "215",
          "scale": 0.1,
          "channel_readonly": true,
          "poll_interval": 1000
        },
        {
          "name": "REG_HC_TEMP_IN4",
          "type": "temperature",
          "reg_type": "holding",
          "address": "216",
          "scale": 0.1,
          "channel_readonly": true,
          "poll_interval": 1000
        },
        {
          "name": "REG_HC_TEMP_IN5",
          "type": "temperature",
          "reg_type": "holding",
          "address": "217",
          "scale": 0.1,
          "channel_readonly": true,
          "poll_interval": 1000
        },
        {
          "name": "REG_HC_TEMP_LVL",
          "type": "range",
          "reg_type": "holding",
          "address": "206",
          "max": "5",
          "poll_interval": 1000
        },
        {
          "name": "REG_HC_TEMP_SP",
          "type": "range",
          "reg_type": "holding",
          "address": "207",
          "max": "40",
          "poll_interval": 1000
        },
        {
          "name": "REG_HC_TEMP_SP_DEG",
          "type": "range",
          "reg_type": "holding",
          "address": "221",
          "scale": 0.1,
          "max": "40",
          "poll_interval": 1000
        },
        {
          "name": "REG_PREHEATER_SETPOINT",
          "type": "value",
          "reg_type": "holding",
          "address": "230",
          "scale": 0.1,
          "max": "40",
          "poll_interval": 1000
        },
        {
          "name": "REG_PREHEATER_P_BAND",
          "type": "range",
          "reg_type": "holding",
          "address": "231",
          "scale": 0.1,
          "max": "60",
          "poll_interval": 1000
        },
        {
          "name": "REG_ROTOR_STATE",
          "type": "text",
          "reg_type": "holding",
          "address": "350",
          "channel_readonly": true,
          "poll_interval": 1000
        },
        {
          "name": "REG_RH_SENSOR_VALUE",
          "type": "rel_humidity",
          "reg_type": "holding",
          "address": "380",
          "channel_readonly": true,
          "poll_interval": 1000
        },
        {
          "name": "REG_RH_SENSOR_DATA_VALID",
          "type": "value",
          "reg_type": "holding",
          "address": "381",
          "channel_readonly": true,
          "poll_interval": 1000
        },
        {
          "name": "REG_FILTER_PER",
          "type": "value",
          "reg_type": "holding",
          "address": "600",
          "channel_readonly": true,
          "poll_interval": 1000
        },
        {
          "name": "REG_FILTER_DAYS",
          "type": "value",
          "reg_type": "holding",
          "address": "601",
          "channel_readonly": true,
          "poll_interval": 1000
        },
        {
          "name": "REG_CLK_S",
          "type": "range",
          "reg_type": "holding",
          "address": "550",
          "poll_interval": 1000,
          "max": "59"
        },
        {
          "name": "REG_CLK_M",
          "type": "range",
          "reg_type": "holding",
          "address": "551",
          "poll_interval": 1000,
          "max": "59"
        },
        {
          "name": "REG_CLK_H",
          "type": "range",
          "reg_type": "holding",
          "address": "552",
          "poll_interval": 1000,
          "max": "23"
        },
        {
          "name": "REG_CLK_D",
          "type": "range",
          "reg_type": "holding",
          "address": "553",
          "poll_interval": 1000,
          "max": "31"
        },
        {
          "name": "REG_CLK_MNTH",
          "type": "range",
          "reg_type": "holding",
          "address": "554",
          "poll_interval": 1000,
          "max": "12"
        },
        {
          "name": "REG_CLK_Y",
          "type": "range",
          "reg_type": "holding",
          "address": "555",
          "poll_interval": 1000,
          "max": "2030"
        },
        {
          "name": "Filter Alarm",
          "type": "switch",
          "reg_type": "coil",
          "address": "12800",
          "poll_interval": 1000,
          "channel_readonly": true
        },
        {
          "name": "Fan Alarm",
          "type": "switch",
          "reg_type": "coil",
          "address": "12801",
          "poll_interval": 1000,
          "channel_readonly": true
        },
        {
          "name": "Rotor Alarm",
          "type": "switch",
          "reg_type": "coil",
          "address": "12803",
          "poll_interval": 1000,
          "channel_readonly": true
        },
        {
          "name": "Frost Alarm",
          "type": "switch",
          "reg_type": "coil",
          "address": "12804",
          "poll_interval": 1000,
          "channel_readonly": true
        },
        {
          "name": "PCU-PB Alarm",
          "type": "switch",
          "reg_type": "coil",
          "address": "12805",
          "poll_interval": 1000,
          "channel_readonly": true
        },
        {
          "name": "Temperature sensor Alarm",
          "type": "switch",
          "reg_type": "coil",
          "address": "12806",
          "poll_interval": 1000,
          "channel_readonly": true
        },
        {
          "name": "Emergency Thermostat Alarm",
          "type": "switch",
          "reg_type": "coil",
          "address": "12807",
          "poll_interval": 1000,
          "channel_readonly": true
        },
        {
          "name": "Damper Alarm",
          "type": "switch",
          "reg_type": "coil",
          "address": "12808",
          "poll_interval": 1000,
          "channel_readonly": true
        },
        {
          "name": "Low SS Alarm",
          "type": "switch",
          "reg_type": "coil",
          "address": "12809",
          "poll_interval": 1000,
          "channel_readonly": true
        },
        {
          "name": "Defrost Alarm",
          "type": "switch",
          "reg_type": "coil",
          "address": "12810",
          "poll_interval": 1000,
          "channel_readonly": true
        },
        {
          "name": "RH Sensor Alarm",
          "type": "switch",
          "reg_type": "coil",
          "address": "12811",
          "poll_interval": 1000,
          "channel_readonly": true
        }
      ],
      "device_max_fail_cycles": 0
    },
    {
      "slave_id": "201",
      "name": "RTM-2000",
      "id": "RTM2000",
      "enabled": true,
      "protocol": "modbus",
      "poll_interval": 2000,
      "channels": [
        {
          "name": "OsadCh1",
          "type": "value",
          "reg_type": "holding",
          "address": "90",
          "scale": 1,
          "poll_interval": 1000,
          "channel_readonly": true
        },
        {
          "name": "WaterCh1",
          "type": "value",
          "reg_type": "holding",
          "address": "0x5C",
          "scale": 1,
          "poll_interval": 1000,
          "channel_readonly": true
        },
        {
          "name": "TST01_3",
          "type": "temperature",
          "reg_type": "holding",
          "address": "0x08",
          "format": "s16",
          "scale": 1,
          "poll_interval": 1000,
          "channel_readonly": true
        },
        {
          "name": "TST01_3_10",
          "type": "value",
          "reg_type": "holding",
          "address": "0x09",
          "format": "s16",
          "poll_interval": 1000,
          "channel_readonly": true
        },
        {
          "name": "TST01_3_mult",
          "type": "value",
          "reg_type": "holding",
          "address": "0x0A",
          "format": "s16",
          "scale": 1,
          "poll_interval": 1000,
          "channel_readonly": true
        },
        {
          "name": "TST01_3_check",
          "type": "value",
          "reg_type": "holding",
          "address": "0x0B",
          "scale": 1,
          "poll_interval": 1000,
          "channel_readonly": true
        },
        {
          "name": "Relay0State",
          "type": "switch",
          "reg_type": "holding",
          "address": "176",
          "scale": 1,
          "poll_interval": 1000,
          "channel_readonly": true,
          "readonly": true
        },
        {
          "name": "Relay1State",
          "type": "switch",
          "reg_type": "holding",
          "address": "177",
          "scale": 1,
          "poll_interval": 1000,
          "channel_readonly": true,
          "readonly": true
        },
        {
          "name": "Relay2State",
          "type": "switch",
          "reg_type": "holding",
          "address": "178",
          "scale": 1,
          "poll_interval": 1000,
          "channel_readonly": true,
          "readonly": true
        },
        {
          "name": "Relay3State",
          "type": "switch",
          "reg_type": "holding",
          "address": "179",
          "scale": 1,
          "poll_interval": 1000,
          "channel_readonly": true,
          "readonly": true
        },
        {
          "name": "Relay4State",
          "type": "switch",
          "reg_type": "holding",
          "address": "180",
          "scale": 1,
          "poll_interval": 1000,
          "channel_readonly": true,
          "readonly": true
        },
        {
          "name": "Relay5State",
          "type": "switch",
          "reg_type": "holding",
          "address": "181",
          "scale": 1,
          "poll_interval": 1000,
          "channel_readonly": true,
          "readonly": true
        },
        {
          "name": "Addres_Teploskat_Air_Min",
          "type": "value",
          "reg_type": "holding_multi",
          "address": "0x012F",
          "format": "s16",
          "scale": 1,
          "poll_interval": 1000,
          "channel_readonly": false
        },
        {
          "name": "Addres_Teploskat_Air_Max",
          "type": "value",
          "reg_type": "holding_multi",
          "address": "0x0130",
          "scale": 1,
          "poll_interval": 1000,
          "channel_readonly": false
        },
        {
          "name": "Addres_Teploskat_Time_Delay_Ch1",
          "type": "value",
          "reg_type": "holding_multi",
          "address": "0x0137",
          "scale": 1,
          "poll_interval": 1000,
          "channel_readonly": false,
          "max": "180"
        },
        {
          "name": "Manual_Auto_Teploskat",
          "type": "switch",
          "reg_type": "holding_multi",
          "address": "0x153",
          "scale": 1,
          "poll_interval": 1000,
          "channel_readonly": false,
          "max": "1"
        },
        {
          "name": "Manual_Auto_Relay_1",
          "type": "switch",
          "reg_type": "holding_multi",
          "address": "0x014F",
          "scale": 1,
          "poll_interval": 1000,
          "channel_readonly": false,
          "max": "1"
        },
        {
          "name": "Manual_Control_Relay_1",
          "type": "switch",
          "reg_type": "holding_multi",
          "address": "0xAC",
          "scale": 1,
          "poll_interval": 1000,
          "channel_readonly": false,
          "max": "1"
        },
        {
          "name": "TST01_4",
          "type": "temperature",
          "reg_type": "holding",
          "address": "0x0C",
          "format": "s16",
          "scale": 0.1,
          "poll_interval": 1000,
          "channel_readonly": true
        },
        {
          "name": "TST01_4_10",
          "type": "value",
          "reg_type": "holding",
          "address": "0x0D",
          "format": "s16",
          "poll_interval": 1000,
          "channel_readonly": true
        },
        {
          "name": "TST01_4_mult",
          "type": "value",
          "reg_type": "holding",
          "address": "0x0E",
          "format": "s16",
          "scale": 1,
          "poll_interval": 1000,
          "channel_readonly": true
        },
        {
          "name": "TST01_4_check",
          "type": "value",
          "reg_type": "holding",
          "address": "0x0F",
          "scale": 1,
          "poll_interval": 1000,
          "channel_readonly": true
        }
      ],
      "device_max_fail_cycles": 1000
    }
  ],
  "baud_rate": 9600,
  "parity": "N",
  "data_bits": 8,
  "stop_bits": 1,
  "poll_interval": 2001,
  "enabled": true
}

Вот часть логов: WB Logs - Pastebin.com

Интересуют девайсы с номерами modbus 1 и 201, это ПВУ SystemAir и РТМ-2000 соответственно.

З.Ы. Работать перестало довольно внезапно

Здравствуйте! Проверьте отсутствие обрывов на линии и надежность соединений и подключений. Нет ли проблем с питанием? Попробуйте оставить на шине только одно устройство и проверьте работу каждого из них. Подключите одно устройство коротким кабелем (если возможно) для проверки. Если линия длинная, нужно установить терминирующие резисторы на ее концах (RS-485:Физическое подключение — Wiren Board).

Какая у вас версия пакета wb-mqtt-serial?

Можно попробовать подобрать (увеличить) таймауты и интервалы настроек связи (Драйвер wb-mqtt-serial: шаблоны — Wiren Board):

  • poll_interval — минимальный интервал опроса регистров устройства в миллисекундах.
  • response_timeout_ms — максимальное время ожидания ответа от устройства в миллисекундах. Если в течение этого времени ответ не будет получен — драйвер продолжит опрос других регистров и устройств.
  • frame_timeout_ms — минимально необходимая задержка между посылками в миллисекундах.
  • guard_interval_us — дополнительная задержка перед каждой отправкой данных в порт в микросекундах. Если при работе с устройством теряются пакеты — попробуйте увеличить значение этого параметра.
  • device_timeout_ms — интервал, по истечении которого (а также device_max_fail_cycles) устройство будет помечено отключенным и будет опрашиваться в ограниченном режиме.

Иногда помогает увеличить guard_interval_us (установить, например 20000). Вот похожая тема: Красные регистры 70% времени - #17 от пользователя changer

При рестарте wb-mqtt-serial нет ошибок? Вы конфигурацию вручную прописывали? Попробуйте убрать поле “protocol”: “modbus”.

Я бы еще посоветовал вынести конфигурацию каждого устройства в свой шаблон, положить его в папку /etc/wb-mqtt-serial.conf.d/templates (после этого нужно будет перезапустить сервис wb-mqtt, немного подождать и обновить страницу конфигурации). Затем добавить устройства на странице конфигурирования порта Settings->Configs → Serial Device Driver Configuration → Port serial /dev/ttyRS485-1, выбрав их из выпадающего списка.