Who uses TMPO data and the query daemon?

Hello community,
working with the TMPO charting I started the corresponding query daemon on my FLM (still v244) some while ago; and it runs and runs and runs; no dump, no break... Anybody else gained experience so far? If nobody experiences any issues (if so, please report as github issue) we might convince Bart to integrate it into the tmpo-daemon with firmware v25x already...
Thanks for your feedback

P.S.: If somebody can tell me, why the heck the input fields do not provide full text height, please give me a hint also! (css oddity between the two bootstrap stylesheets, of course)

P.P.S.: To get an understanding what this is all about, read my corresponding blog article.

icarus75's picture

Hello Markus,

I'll be having a deeper look at your local charting code after r24x is out. With no major showstoppers, r24x should be released by the end of the month.


jgysenbergs's picture

I have FluksoChart running AOK in FF and Chrome OSX 10.10. Safari doesn't show text in the input fields (probably local problem), Chrome is fastest.


Still have to figure out this topic: .. payload: .. thing. If a day had 36 hours ...

gebhardm's picture

Looks quite OK. The weird squares in the solar graph are caused by the averaging; I changed this with the current code version of chart.js. I would be interested in the water/gas graph, please check the scaling as I currently just go for Wh... - you'll get that with the topic, it's straight forward, no magic...

gebhardm's picture

To provide an MQTT metaphor:

MQTT topics are like the titles and chapter headlines of a continuously updated essay book (might be called "blog" these days); you can subscribe to either of the chapters in which you are interested - subscription is explicit; only messages on named topics are passed on to you; this you can do explicit by exact chapter name "/sports/biathlon" or by wildcards /sports/# - the complete sub-chapter hierarchy of "sports" (here for example "biathlon" and "biathlon/Norway") and /sports/+ - exactly the first level of sub-chapters of "sports", thus only "biathlon" neglecting "Norway"; /sports/+/+ the first and second sub-level and to forth...
MQTT payload then denotes the actual content in the subscribed topics - this is the stuff to check, compute, recognize.

I enhanced the chart.js by a different handling of electricity and water/gas (I don't have that type of sensors attached, so I am dependent on your testing) - download the "raw" file from Github if you haven't cloned the complete repository to pull and "scp" just that into the respective FLM folder; this is actually also a method to play with different settings if you don't want to use the vi on the FLM directly... After a refresh on the browser this lets you test and debug the presentation; poor man's IDE ;-)

jgysenbergs's picture

Thanks very much for clarification and effort. This is what a mere mortal like me needs (after all, I'm more of an art scientist than an ICT person). Now, where is my thinking cap ...

Meanwhile, here are some screenshots. These clearly illustrate Flukso's measurements in a comprehensive format:


gebhardm's picture

New chart.js version available that should show the actual water and gas consumption as liters occuring in a certain time interval like the electricity wattage. Please test.
On Safari 8.0.3: This version throws CSS-errors already on loading the FLM's landing page and fails to instantiate any JS file; so I would name this simply "Safari sucks"...

gebhardm's picture

Update - the messy input on the chart indeed was an incompatibility with bootstrap v3, which I now removed; now all visualizations should work in all browsers... (I "love" web programming)
But again the question on the TMPO daemon ;-)

jgysenbergs's picture

Works AOK now in Safari. Again, thanks!

gebhardm's picture

FYI - the query daemon has been placed in a pull request with included startup capability, so no need for manual activity. See https://github.com/flukso/flm02/pull/7

vk2him's picture

It is running fine on mine too - no problems seen :)

B-Man's picture

i get this issue trying to run it

Jan 1 00:01:14 flukso-a5cda6 daemon.info queryd[699]: Sucessfully started with DEAMON=queryd and DAEMON_PATH=/var/run/queryd

May 3 12:00:04 flukso-a5cda6 daemon.err queryd[699]: /usr/sbin/queryd.lua:51: attempt to concatenate a nil value
May 3 12:00:05 flukso-a5cda6 daemon.err queryd[699]: 10 restarts within a 60 sec window
May 3 12:00:05 flukso-a5cda6 daemon.info queryd[699]: Exiting...

all other flm local works fine

B-Man's picture

downloaded and reinstalled latest FLM02 flm local www/ folder
installed new etc/init.d/flukso file
re added /usr/sbin/queryd.lua and linked it

now lost all graphs on the flukso and still non working tmpo

gebhardm's picture

Note: The flmlocal installation does not alter any FLM inherent data; it is just static content; so nothing lost until a factory reset... if you stay with the description it "should" all work straight forward. As an alternative, try the tmpo access via Python as described in https://github.com/flukso/tmpo-py

gebhardm's picture

And, of course, you have to start the new daemon /usr/sbin/queryd -u flukso Check with ps to see the running workers. There must be an entry like

  1.  839 flukso    5272 S N  /usr/sbin/queryd -u flukso

B-Man's picture

i ran /usr/sbin/queryd -u flukso and this is what syslog on flukso shows

unsure what you mean with the check with ps for a running worker

on another note the other flm local is working except the gauges

  1. May  5 02:24:32 flukso-a5cda6 daemon.info queryd[7825]: Sucessfully started with DEAMON=queryd and DAEMON_PATH=/var/run/queryd
  2. May  5 02:24:34 flukso-a5cda6 daemon.info fluksod[686]: processed pulse d77cac91139c7b669d6456679e4edd1d:1525487074:6960069
  3. May  5 02:24:35 flukso-a5cda6 daemon.err queryd[7825]: /usr/sbin/queryd.lua:51: attempt to concatenate a nil value
  4. May  5 02:24:36 flukso-a5cda6 daemon.err queryd[7825]: /usr/sbin/queryd.lua:51: attempt to concatenate a nil value
  5. May  5 02:24:38 flukso-a5cda6 daemon.err queryd[7825]: /usr/sbin/queryd.lua:51: attempt to concatenate a nil value
  6. May  5 02:24:39 flukso-a5cda6 daemon.err queryd[7825]: /usr/sbin/queryd.lua:51: attempt to concatenate a nil value
  7. May  5 02:24:41 flukso-a5cda6 daemon.err queryd[7825]: /usr/sbin/queryd.lua:51: attempt to concatenate a nil value
  8. May  5 02:24:42 flukso-a5cda6 daemon.info fluksod[686]: processed pulse d77cac91139c7b669d6456679e4edd1d:1525487082:6960070
  9. May  5 02:24:43 flukso-a5cda6 daemon.err queryd[7825]: /usr/sbin/queryd.lua:51: attempt to concatenate a nil value
  10. May  5 02:24:44 flukso-a5cda6 daemon.err queryd[7825]: /usr/sbin/queryd.lua:51: attempt to concatenate a nil value
  11. May  5 02:24:46 flukso-a5cda6 daemon.err queryd[7825]: /usr/sbin/queryd.lua:51: attempt to concatenate a nil value
  12. May  5 02:24:48 flukso-a5cda6 daemon.err queryd[7825]: /usr/sbin/queryd.lua:51: attempt to concatenate a nil value
  13. May  5 02:24:51 flukso-a5cda6 daemon.err queryd[7825]: /usr/sbin/queryd.lua:51: attempt to concatenate a nil value
  14. May  5 02:24:52 flukso-a5cda6 daemon.info fluksod[686]: processed pulse d77cac91139c7b669d6456679e4edd1d:1525487091:6960071
  15. May  5 02:24:52 flukso-a5cda6 daemon.err queryd[7825]: 10 restarts within a 60 sec window
  16. May  5 02:24:52 flukso-a5cda6 daemon.info queryd[7825]: Exiting...

gebhardm's picture

Hello B-Man,
with ps I refer to the command ps that just shows the running processes of the system like on any Unix machine. But from the syslog I see that queryd is successfully started. What irritates is the following bunch of errors on queryd. Here in line 51 of the lua script the path is set where tmpo stores its values; this seems to not exist on your FLM, why so ever. Please check the content of your queryd.lua file; if line 51 contains uci:get("flukso", "tmpo", "root") then you are using the FLM03 version instead of the FLM02 version; in the FLM03 the storage directory is set by configuration, not hard coded; and on the FLM02 exactly this configuration does not yet exist...
Regards, Markus

B-Man's picture

ah my mistake, got confused with the flm03 serial vs the flm02b model i did have the wrong version.


  1. /etc/init.d$ ps
  3.     1 root      1516 S    init
  4.     2 root         0 SW   [kthreadd]
  5.     3 root         0 SW   [ksoftirqd/0]
  6.     4 root         0 SW   [kworker/0:0]
  7.     5 root         0 SW   [kworker/u:0]
  8.     6 root         0 SW<  [khelper]
  9.     7 root         0 SW   [kworker/u:1]
  10.    43 root         0 SW   [sync_supers]
  11.    45 root         0 SW   [bdi-default]
  12.    47 root         0 SW<  [kblockd]
  13.    81 root         0 SW   [kswapd0]
  14.    82 root         0 SW   [fsnotify_mark]
  15.    99 root         0 SW   [mtdblock0]
  16.   104 root         0 SW   [mtdblock1]
  17.   109 root         0 SW   [mtdblock2]
  18.   114 root         0 SW   [mtdblock3]
  19.   119 root         0 SW   [mtdblock4]
  20.   124 root         0 SW   [mtdblock5]
  21.   129 root         0 SW   [mtdblock6]
  22.   150 root         0 SW   [kworker/0:1]
  23.   292 root         0 SWN  [jffs2_gcd_mtd3]
  24.   294 root         0 SW   [flush-mtd-unmap]
  25.   337 root         0 SW<  [cfg80211]
  26.   381 root         0 SW<  [spi_gpio.1]
  27.   402 root      1528 S    /sbin/syslogd -C16
  28.   404 root      1508 S    /sbin/klogd
  29.   406 root       848 S    /sbin/hotplug2 --override --persistent --set-rules-f
  30.   416 root       888 S    /sbin/ubusd
  31.   427 root      1492 S    /sbin/netifd
  32.   462 root      1528 S    udhcpc -p /var/run/udhcpc-eth0.pid -s /lib/netifd/dh
  33.   504 root      1520 S    /sbin/watchdog -t 5 /dev/watchdog
  34.   575 root      1532 S    /usr/sbin/crond -c /etc/crontabs -l 1
  35.   590 root      1160 S    /usr/sbin/dropbear -P /var/run/dropbear.1.pid -p 22
  36.   596 root      1172 S    /usr/sbin/uhttpd -f -h /www -r flukso-a5cda6 -x /cgi
  37.   602 root      1148 S    /usr/sbin/uhttpd -f -h /www -r flukso-a5cda6 -x /sen
  38.   638 nobody     964 S    /usr/sbin/dnsmasq -C /var/etc/dnsmasq.conf
  39.   644 nobody    1728 S    avahi-daemon: running [flukso-a5cda6.local]
  40.   658 flukso    3428 S    /usr/sbin/mosquitto -c /etc/mosquitto/mosquitto.conf
  41.   675 root      2600 S    /usr/sbin/supd
  42.   678 flukso    2924 S    /usr/sbin/spid -u flukso
  43.   681 flukso    5292 S    /usr/sbin/fluksod -u flukso
  44.   684 flukso    5532 R N  /usr/sbin/tmpod -u flukso
  45.   687 flukso    5140 S N  /usr/sbin/queryd -u flukso
  46.   695 flukso    2440 S    /usr/sbin/parsed -u flukso
  47.   698 flukso    5676 S    /usr/sbin/kubed -u flukso
  48.   725 root      1520 S    /usr/sbin/ntpd -n -p 0.openwrt.pool.ntp.org -p 1.ope
  49.   818 root      1224 S    /usr/sbin/dropbear -P /var/run/dropbear.1.pid -p 22
  50.   819 root      1516 S    -ash
  51.   826 root      1516 R    ps

all appears to be working!

gebhardm's picture

Yes, that looks fine now :-) Enjoy!