Dev corner

Calling all engineers, tinkerers, hackers and geeks.

FLM2.4.x: MQTT websockets sometimes lose connection [solved]

When using the new MQTT websocket capability from firmware 2.4.4 via mqttws31.js it happens that the connection is lost due to an internal error of the websocket library; nevertheless, as the error message states something of "malformed UTF data" this might be checked on the FLM side as well.
See https://github.com/gebhardm/flmlocal for error message sent in the browser console (error occurs on message received).

Note: This is no issue with the updated MQTT broker in firmware v2.4.5++.

FLM MQTT broker to support web sockets [solved]

Jan-Piet Mens, one of the "masters" to test MQTT capabilities, in July 2014 described on how to make the mosquitto MQTT broker, which is also used on the FLM, supporting web sockets. See http://jpmens.net/2014/07/03/the-mosquitto-mqtt-broker-gets-websockets-s... - this I'd like to get implemented on the FLM as well, as then a "direct local gauge display" (with any cheap Android tablet) would be just some js-files and an additional html page on the FLM away.

And here is the solution: Beginning with the (yet experimental) FLM firmware version 2.4.4 the Fluksometer will natively support MQTT over websockets; to utilize this for a direct/local display served from the FLM's own web server, you may use my "develop" version of an FLM-AngularJS/jQuery-integrated gauge, graph and panel display (follow the link to GitHub).
Read this thread to get an understanding what happened so far and how to gain this native solution to display gauges (and panels and graphs) directly from your FLM.

Minimum A/D and Clamp values?

I have configured a new Flukso with current clamps. I have noticed that there appears to be a minimum value reported once the current flows, of around 400 Watts. So, the graphs jump from 0 to 400 and never show values less than 400. Is there some sort of minimum startup voltage on the A/D converters?

Retrieving real-time sensor data through hostname in Windows

I would like to access the fluksometer's real-time sensor data through WAN using the device hostname. I'm able to do it on an unix box, but doing it on windows depends on the router the device is connected to. I've opened the NetBIOS ports on OpenWRT. The only router with which I was able to connect to the device was a Technicolor TG784n v3. I also tried with a Huawei B970 and a SMC WBR14-g2, with no success. All routers were using the default configuration, and I'm able to ping other devices using the hostname on all of them, which leads me to think that it might be an OpenWRT configuration issue.

I'm unexperienced with OpenWRT, so I'm a bit clueless on what to try next. Any help would be appreciated.

Thanks!

Use the FLM's MQTT broker for further extending your home measurements

With the built-in MQTT broker the FLM provides an easy to use and easy to adapt capability to publish own sensor data beyond the FLM built in energy measurement.
With an Arduino-based MQTT publisher it is possible to add, for example, temperature gauges using the well-known Dallas/Maxim DS18x20 one-wire temperature sensors. Having access to digital as well as analog inputs on the Arduino (or derivate) this is not restricted to temperature but you may connect to any kind of sensor - accelerometers, compasses (did my house move?), humidity, water level (oh, flood again), mains frequency, you name it.
And with a convenient panel they are shown instantly without any configuration (as denoted in another thread)
Be inspired by https://github.com/gebhardm/energyhacks/tree/master/AVRNetIOduino and use your own creativity as long as the Kube is not publically available (or too expensive?).
Please note: Arduino is not only wired-ethernet, but provides also Wifi and BT, so connectivity is unlimited...
Please also note: MQTT is not only for displaying/supplying read-only messages, but may be used also for controlling; so the same means may be used for home automation purposes as well - security measures yet to be implemented!
Have fun.
Markus