Dashboard Panels (from MQTT) show No Data frequently

Total new guy here. Been trying to build my own dashboard, but… struggling. I watched a video and copied the JSON from a github repo to get a much faster, responsive dashboard, but… something’s off. Also, every time a panel goes to “No Data”, I lose the “history chart”. I assume that I need to get these into my InfluxDB for “no loss history”. But for now… can anyone tell me what I’m doing wrong? The underlying MQTT updates about every second, so I set these all to two seconds.



Here is, I believe, is one of the panel configs. (They are ALL configured the same, roughly, except for the topic and maybe thresholds.)

    {
      "datasource": {
        "type": "grafana-mqtt-datasource",
        "uid": "b22348bb-f4b0-41f5-aa8d-59adae64d195"
      },
      "fieldConfig": {
        "defaults": {
          "color": {
            "mode": "thresholds"
          },
          "mappings": [],
          "thresholds": {
            "mode": "absolute",
            "steps": [
              {
                "color": "green",
                "value": null
              },
              {
                "color": "#EAB839",
                "value": 25
              },
              {
                "color": "red",
                "value": 30
              }
            ]
          },
          "unit": "Watts"
        },
        "overrides": []
      },
      "gridPos": {
        "h": 4,
        "w": 3,
        "x": 0,
        "y": 0
      },
      "hideTimeOverride": true,
      "id": 7,
      "interval": "2s",
      "maxDataPoints": 10000,
      "options": {
        "colorMode": "value",
        "graphMode": "area",
        "justifyMode": "auto",
        "orientation": "auto",
        "reduceOptions": {
          "calcs": [
            "lastNotNull"
          ],
          "fields": "",
          "values": false
        },
        "textMode": "auto",
        "wideLayout": true
      },
      "pluginVersion": "10.2.2",
      "targets": [
        {
          "datasource": {
            "type": "grafana-mqtt-datasource",
            "uid": "b22348bb-f4b0-41f5-aa8d-59adae64d195"
          },
          "refId": "victron-multiplus-watts",
          "topic": "N/e8eb11e512f4/vebus/257/Dc/0/Power"
        }
      ],
      "timeFrom": "now-30m",
      "title": "DC Watts",
      "type": "stat"
    },

Hi @captainpalapa and welcome to the Grafana forum. Congrats on getting as far as you did. Your dashboard looks very good and now this pesky MQTT thing seems to be the problem.

I experienced the same issue a while back when I installed that plugin. I (along with dozens of others) reported it here. Have a look at the proposed solution in the thread and see if that works for you.

Second, have you set up InfluxDB already? If yes, which version did you install, and have you confirmed it’s working? Because it is possible via the above plugin to skip the database entirely and just have 20 or so minutes (perhaps more) of ephemeral data via MQTT flowing across Grafana’s panels, but no historical record of it.

I’ll give that thread a check. In the case of these particular panels, they are hitting MQTT direct, not through InfluxDB. (Mostly because I was wanting “instant” data, not historical, so I figured to skip the storage.) This is all in Docker, in fact, the MQTT broker I’m hitting here is my own, which is peering to the Victron MQTT (both are mosquitto, though different versions). Also, another reason I skipped the DB was simply that I’m not grokking the Influx query style, and I haven’t yet found the more “standard sql” view either within InfluxDB UI or in Grafana. I’ve been a coder for over 30 years, so I can query… But this is some java craziness. So I started with someone else’s work that I could just modify! :smiley:

InfluxDB v2.7.4
Grafana … well, can’t figure that one out quickly.

I’ll look into your suggested link, thank you very much! I’ll report back if it doesn’t solve the issue!

Hey @captainpalapa

You may already know this, but in early 2023, InfluxDB released v3 (currently Cloud only, but soon OSS version as well) that uses SQL, so you can do stuff like this (using a plugin called FlightSQL):

image

Yeah, SQL! That’s what I need! That’ll be great when that comes out. I’ve found it rather difficult to wire stuff up the way I want. Data into Influx, data out of Influx… seems like it could all be a bit simpler somehow.

Thanks for letting me know about that; I’ll be keeping an eye out for the new versions to show up in the OSS flavors.

In case others are curious…

1 Like

Cant believe this

Flux in maintenance mode

@grant2 Curious, any idea what’ll happen to all the dashboard queries that are Flux? Pretty much the ONLY way I’ve been building them is by using the InfluxDB “Data Explorer”, then copying the Flux query over to Grafana.

Even now, I’m trying to create a calculated field and have no idea how to do it (though I could do it in .42 seconds in SQL!) and I KNOW that I’ll be using Flux, which is why I thought of this question.

I may have solved some of my own problem. I just discovered “Flux” vs. InfluxQL in the data source setup. Now I can do something more akin to regular SQL. So, clearly I’ll have to convert my existing queries out of Flux. (Won’t be too hard.)

Now I have to go ask a question in a different category!

I also created my Flux queries in Influx Data Explorer, debugged them, etc. then copied/pasted into Grafana. I always liked that way of working and still do.

I was one of many that followed the message about Flux being the future of InfluxDB (even did a few of their online classes), so the change to SQL was a hard left turn. There is an open source project called Fluxpipe that will keep Flux alive and I expect it will continue given that it achieved a critical mass of users (IMHO).

Fortunately, recreating them (at this point) is easy enough.