Hi Gebhard,
I've been playing with your excellent mqtt scripts trying to get the combined to work from https://github.com/gebhardm/flmdisplay , but with no luck.
I have the following displayed when starting the node:
- www:combined vk2him$ node serve_flmdata.js
- Database flm successfully connected
- Detected MQTT service on: 192.168.1.73:1883
- Create/connect to config table successful...
- Create/connect to data table successful...
However when I navigate to localhost:1080 I get the following displayed
- Latest MQTT message: no message received
The mysql table is also empty.
I can connect fine with mosquito with no problem as you can see:
- www:combined vk2him$ mosquitto_sub -h 192.168.1.73 -p 1883 -v -t /sensor/#
- /sensor/c7c90d029e018769b5fb26380c369845/counter [1428230773,924264,"Wh"]
- /sensor/c7c90d029e018769b5fb26380c369845/gauge [1428230775,590,"W"]
- /sensor/c7c90d029e018769b5fb26380c369845/gauge [1428230776,586,"W"]
- /sensor/c7c90d029e018769b5fb26380c369845/gauge [1428230777,596,"W"]
- /sensor/c7c90d029e018769b5fb26380c369845/gauge [1428230778,588,"W"]
- /sensor/c7c90d029e018769b5fb26380c369845/counter [1428230779,924265,"Wh"]
As well as the latest versions, I have even tried installing an older 0.9 version of socket.io but it fails too:
- npm install socket.io@"~0.9.1"
I have tried your other older scripts by using the 0.9 version of socket.io but I always get this:
- Latest MQTT message: no message received
So I was wondering if I have done something wrong, or if my FLM needs something else to make it work? I am running Version 2.32
Thanks
Ian
Respectively (in the "combined" script)
Thus,
console.log
the content of "service" to see what address snipets are passed; better try with the "simple graph" from https://github.com/gebhardm/energyhacks/tree/master/Graph as you deal with static IP addresses here and thus can reduce by one source of errors...I tried the simple graph from master and changed to use static ip:
It only gives this:
So I assume it means I'm either connecting but not getting a 'connect" back, or it's just not connecting at all ...
Sorry - code should have been
It is not connecting at all... Check also your local firewall settings if port 1883 is open;
I just had a fresh install on a windows PC without an FLM, but mosquitto and node v0.12.2; I even got it running on plain "127.0.0.1", thus within the same machine, so there is something dubious in your environment...
The code is
Use the variable to alter the IP address; therefor I put them in there...
Irritatingly the .on("connect")-event gets never fired...
Yes, the code you have above is exactly what I had originally - I tried hand-coding the IP into the mqtt.connect function to see if it made a difference, which it didn't. Yes, something very strange in my environment as the .on("connect" event is never fired. I have also tried the same code on another Mac and a Windows machine with the same.
There is no firewall on the Mac, I can access port 1883 from the Mac using mosquito so it must be "node" or "mqtt.connect" functionality issues .. here is mosquito proving I can access FLM properly
Thanks for your patience, I'll think some more ...
Try it with a de-install and plain re-install of the simplest visualization...
git clone
) the energyhacks and decompress them./gauge
or./graph
folder.npm install
to get the required modules; check the install log for things that may went wrong (usually all is well even though there were warnings)serve_mqtt.js
node serve_mqtt.js
- the MQTT should connect...http://localhost:1080
If not, well, you might try another hobby ;-) (I checked this now on four different computers, with Mac OS, Debian Linux and Windows)
@VK2HIM - did you get the MQTT receiver working with node by now?
@GEBHARDM - No, I have had no luck and I'm hoping when the new firmware for Flukso is released it will have this pre-loaded :)
As Bart is working on TMPO with Python and Pandas I doubt preloading :-/
Hi @GEBHARDM
After Bart remote updated my FML to 245 your script worked immediately - so somehow my FLM wasn't working properly with mqtt.
Many thanks - I like it a lot,
Ian
Hi Markus,
I scp copied the files from /www/ onto the FLM to use it locally using the instructions in https://github.com/gebhardm/flmlocal
All is working well except for the Chart page won't display the charts .. I get this displayed "Query request sent..." with no graphs.
Do I also need to scp the /usr/ files over to the FML as I see that queryd.lua isn't on the FML?
Regards
Ian
As the query-daemon is "my invention", sure, this is currently not available on the FLM by nature; so yes, you have to copy this as well and start it corresponding to the description in the ReadMe.
Be aware that there a actually two changes: The query "daemon" (new) and an alteration to the flukso daemon to publish its configuration - to get the real sensor names. The flukso daemon version is 2.4.4, but should be "equal" to the 2.4.5 version - at own risk, as depicted by the MIT license.
A remark of warning: The flmlocal stuff referred to here is working on FLM version 2.4.4 and 2.4.5; with upcoming versions there is a change in the original firmware that may conflict with this implementation - so always "know what you are doing".
In any case, a factory reset of your FLM will clean up any mess you may have caused.
Perfect - yes it is now working very well - thank you for your efforts, it looks excellent!