Пустой ответ от wb-db


#1

Добрый вечер!

От wb-mqtt-db иногда приходит пустой ответ. Это бывает когда значение долго не меняется, при этом устройство подключено и работает исправно.
Поведение, как я считаю, странное, потому что я указываю min_unchanged_interval меньше, чем запрашиваемый промежуток.


#2

Здравствуйте!
Вы через wb-mqtt-db-cli опрашиваете базу данных?


#3

Не совсем, я использую свое ПО для опроса, но запрос в wb-mqtt-db идентичный. По сути, я генерирую тоже, что и wb-mqtt-db-cli.

Если для такого случая предусмотрены параметры к wb-mqtt-db-cli, можете написать их?


#4

Приведите здесь пожалуйста целиком JSON запроса и ответа


#5
{
  "id": 20111,
  "params": {
    "channels": [
      [
        "wb-map12h_5",
        "Ch 2 AP energy L1"
      ]
    ],
    "limit": 1,
    "min_interval": 600,
    "timestamp": {
      "gt": 1544106691,
      "lt": 1544107291
    },
    "ver": 0
  }
}

{"error":null,"id":20111,"result":{"values":[]}}

/etc/wb-mqtt-db.conf
{
  "database": "/var/lib/wirenboard/db/data.db",
  "debug": false,
  "groups": [
    {
      "channels": [
        "wb-map12h_5/Ch 1 AP energy L1",
        "wb-map12h_5/Ch 1 Ipeak L1",
        "wb-map12h_5/Ch 1 Irms L1",
        "wb-map12h_5/Ch 1 P L1",
        "wb-map12h_5/Ch 1 PF L1",
        "wb-map12h_5/Ch 1 Phase angle L1",
        "wb-map12h_5/Ch 1 Q L1",
        "wb-map12h_5/Ch 1 S energy L1",
        "wb-map12h_5/Ch 1 THDN I L1",
        "wb-map12h_5/Ch 1 THDN U L1",
        "wb-map12h_5/Ch 1 Upeak L1",
        "wb-map12h_5/Ch 1 Voltage angle L1",
        "wb-map12h_5/Frequency",
        "wb-map12h_5/Urms L1",
        "wb-map12h_5/Ch 2 AP energy L1",
        "wb-map12h_5/Ch 2 AP energy L2",
        "wb-map12h_5/Ch 2 AP energy L3",
        "wb-map12h_5/Ch 2 Ipeak L1",
        "wb-map12h_5/Ch 2 Ipeak L2",
        "wb-map12h_5/Ch 2 Ipeak L3",
        "wb-map12h_5/Ch 2 Irms L1",
        "wb-map12h_5/Ch 2 Irms L2",
        "wb-map12h_5/Ch 2 Irms L3",
        "wb-map12h_5/Ch 2 P L1",
        "wb-map12h_5/Ch 2 P L2",
        "wb-map12h_5/Ch 2 P L3",
        "wb-map12h_5/Ch 2 PF L1",
        "wb-map12h_5/Ch 2 PF L2",
        "wb-map12h_5/Ch 2 PF L3",
        "wb-map12h_5/Ch 2 Phase angle L1",
        "wb-map12h_5/Ch 2 Phase angle L2",
        "wb-map12h_5/Ch 2 Phase angle L3",
        "wb-map12h_5/Ch 2 Q L1",
        "wb-map12h_5/Ch 2 Q L2",
        "wb-map12h_5/Ch 2 Q L3",
        "wb-map12h_5/Ch 2 S energy L1",
        "wb-map12h_5/Ch 2 S energy L2",
        "wb-map12h_5/Ch 2 S energy L3",
        "wb-map12h_5/Ch 2 THDN I L1",
        "wb-map12h_5/Ch 2 THDN I L2",
        "wb-map12h_5/Ch 2 THDN I L3",
        "wb-map12h_5/Ch 2 THDN U L1",
        "wb-map12h_5/Ch 2 THDN U L2",
        "wb-map12h_5/Ch 2 THDN U L3",
        "wb-map12h_5/Ch 2 Upeak L1",
        "wb-map12h_5/Ch 2 Upeak L2",
        "wb-map12h_5/Ch 2 Upeak L3",
        "wb-map12h_5/Ch 2 Voltage angle L1",
        "wb-map12h_5/Ch 2 Voltage angle L2",
        "wb-map12h_5/Ch 2 Voltage angle L3",
        "wb-map12h_5/Frequency",
        "wb-map12h_5/Urms L1",
        "wb-map12h_5/Urms L2",
        "wb-map12h_5/Urms L3",
        "wb-map12h_5/Ch 1 AP energy L3",
        "wb-map12h_5/Ch 1 Ipeak L3",
        "wb-map12h_5/Ch 1 Irms L3",
        "wb-map12h_5/Ch 1 P L3",
        "wb-map12h_5/Ch 1 PF L3",
        "wb-map12h_5/Ch 1 Phase angle L3",
        "wb-map12h_5/Ch 1 Q L3",
        "wb-map12h_5/Ch 1 S energy L3",
        "wb-map12h_5/Ch 1 THDN I L3",
        "wb-map12h_5/Ch 1 THDN U L3",
        "wb-map12h_5/Ch 1 Upeak L3",
        "wb-map12h_5/Ch 1 Voltage angle L3",
        "wb-map12h_5/Frequency",
        "wb-map12h_5/Urms L3",
        "wb-map12h_5/Ch 3 AP energy L1",
        "wb-map12h_5/Ch 3 AP energy L2",
        "wb-map12h_5/Ch 3 AP energy L3",
        "wb-map12h_5/Ch 3 Ipeak L1",
        "wb-map12h_5/Ch 3 Ipeak L2",
        "wb-map12h_5/Ch 3 Ipeak L3",
        "wb-map12h_5/Ch 3 Irms L1",
        "wb-map12h_5/Ch 3 Irms L2",
        "wb-map12h_5/Ch 3 Irms L3",
        "wb-map12h_5/Ch 3 P L1",
        "wb-map12h_5/Ch 3 P L2",
        "wb-map12h_5/Ch 3 P L3",
        "wb-map12h_5/Ch 3 PF L1",
        "wb-map12h_5/Ch 3 PF L2",
        "wb-map12h_5/Ch 3 PF L3",
        "wb-map12h_5/Ch 3 Phase angle L1",
        "wb-map12h_5/Ch 3 Phase angle L2",
        "wb-map12h_5/Ch 3 Phase angle L3",
        "wb-map12h_5/Ch 3 Q L1",
        "wb-map12h_5/Ch 3 Q L2",
        "wb-map12h_5/Ch 3 Q L3",
        "wb-map12h_5/Ch 3 S energy L1",
        "wb-map12h_5/Ch 3 S energy L2",
        "wb-map12h_5/Ch 3 S energy L3",
        "wb-map12h_5/Ch 3 THDN I L1",
        "wb-map12h_5/Ch 3 THDN I L2",
        "wb-map12h_5/Ch 3 THDN I L3",
        "wb-map12h_5/Ch 3 THDN U L1",
        "wb-map12h_5/Ch 3 THDN U L2",
        "wb-map12h_5/Ch 3 THDN U L3",
        "wb-map12h_5/Ch 3 Upeak L1",
        "wb-map12h_5/Ch 3 Upeak L2",
        "wb-map12h_5/Ch 3 Upeak L3",
        "wb-map12h_5/Ch 3 Voltage angle L1",
        "wb-map12h_5/Ch 3 Voltage angle L2",
        "wb-map12h_5/Ch 3 Voltage angle L3",
        "wb-map12h_5/Frequency",
        "wb-map12h_5/Urms L1",
        "wb-map12h_5/Urms L2",
        "wb-map12h_5/Urms L3"
      ],
      "min_interval": 120,
      "min_unchanged_interval": 180,
      "name": "all",
      "values": 10000,
      "values_total": 100000
    }
  ]
}

Конфиг автогенерированный, некоторые поля повторяются.


#6

делайте лучше ver: 1, ноль - это старая. Рекомендую посмотреть на запросы, которые шлёт веб-интерфейс или wb-mqtt-db-cli


#7

Как веб-интерфейсом сгенерировать запрос в wb-mqtt-db?


#8

Через движок правил можете, вызвав wb-mqtt-db-cli. НО для отладки лучше в командной строке разобираться.


#9
{
  "id": 20113,
  "params": {
    "channels": [
      [
        "wb-map12h_5",
        "Ch 3 AP energy L3"
      ]
    ],
    "limit": 1,
    "min_interval": 600,
    "timestamp": {
      "gt": 1544172098,
      "lt": 1544172698
    },
    "ver": 1
  }
}

Аналогично пустой ответ

{
  "error": null,
  "id": 20113,
  "result": {
    "values": []
  }
}

#10

Есть какое-то решение?


#11

Добрый день! Буду воспроизводить проблему у нас.

Пришлите, пожалуйста, вывод dpkg -s wb-mqtt-db и ваш конфиг /etc/wb-mqtt-db.conf