Dev corner

Calling all engineers, tinkerers, hackers and geeks.

IP address discovery?

When the FLM is operating in wireless mode, does it support IP address discovery in some way? It doesn't seem to support WINS.

If its address gets reset due to DHCP, it would be nice to have some software I wrote that's running on my local network auto-update, rather than having to do it by hand.

Virtual Sensors via MQTT Publishers

Hi,

Are there any plans or is there an easy way to publish additional sensors via MQTT
e.g. Using an Arduino MQTT to publish a sensor value to the Mosquitto Daemon on the Flukso,... ?

MQTT: Nicely designed gauges

In another forum post (https://www.flukso.net/content/first-time-install-problems) user "jgysenbergs" raised following question "Do you know if there exists a fancy web interface with nicely designed gauges?"
On this behalf (and on Bart's request :-)) I'd like to introduce this dedicated thread, reposting my reply for an open and fruitful discussion:

"Nicely designed gauges" are like "electronics in cases"; it takes an hour to solder a solution and weeks (if not years) to finally pack it into a nice box... Yesterday I actually started to get into the MQTT stuff again (the actual data collector runs smoothly on a RaspPi for some while) - I experimented with http://www.flotcharts.org/ but am not convinced yet; Jean-Claude Wippler (please continue your blog on www.jeelabs.org) proposes http://dygraphs.com/ - I am looking forward to continuing during winter vacation starting Friday... There "should" be some MQTT ready solutions that generically display readings, but I did not do any research yet.
I think, I will report progress in https://github.com/gebhardm/energyhacks/tree/master/RaspberryPi - there my "quickly hacked" python-to-html solution is available that has a lot of room for improvement...
All you hackers, tinkerers, nerds, and freaks out there - share your insights, as I am getting too old (means too lazy) to again and again and again program stuff that should be already feasibly solved in the 21st century ;-) (I know why I studied math and not computer science)

Best regards
Markus

Triggering on leading and trailing edge of a pulse. Possible?

I just checked my water meter and it has a magnet on the least significant digit which will switch on a reed relay twice per rotation.
The least significant digit is single litres, 10 litres per rotation.
With the relay switching on and of twice per rotation i get a resolution of 5 litres per pulse logged by the FLM.
If the FLM could trigger on both the leading and trailing edge then this would double the resolution to 2.5 litres per pulse.

Would this be possible?
Would it be a software only change or would hardware changes be required?

If this could be done i imagine it would provide the same doubling of resolution to gas meters that have magnets on the dials.

Here is a crude diagram of what happens to the reed relay as the magnet rotates.

  1.       ______         ______         ______         ______
  2. _____|      |_______|      |_______|      |_______|      |
  3. 1  2  3  4  5  6  7  8  9  0  1  2  3  4  5  6  7  8  9  0
  4.      on    off      on    off      on    off      on    off

Is this set up similar to other users?
Would many other FLM water and gas loggers benefit from this resolution doubling?

If this is not possible then i imagine i could cobble together some sort of frequency doubling pre conditioning circuit to process the pulses before they reached the FLM.
Something like the attached image.

Getting a working AJAX example.

Hello Fluksonians,

My name is Roan and I'm a newcommer to the community.
We are using a Fluksometer for our school project and don't have it employed yet.
However, we do want to start developing our mobile wepapplication.
Using the information of this post: https://www.flukso.net/content/jsonrest-api-released (it seems a bit outdated to me) we are trying to create a working AJAX example.

This is our code:
// Create request
var xhr = new XMLHttpRequest();
var interval = 'interval=hour';
var unit = '&unit=watt'
var url = 'https://api.flukso.net/sensor/c1411c6b4f9910bbbab09f145f8533b9?' + interval + unit;
xhr.open('GET',url,true);

//Set headers
xhr.setRequestHeader('Accept','application/json');
xhr.setRequestHeader('X-Version','1.0');
xhr.setRequestHeader('X-Token','d8a8ab8893ea73f768b66b45234b5c3a');

//Send request
xhr.send();

The error I am recieving in my console is: "NetworkError: 405 Method Not Allowed - https://api.flukso.net/sensor/c1411c6b4f9910bbbab09f145f8533b9?interval=hour&unit=watt"
Also the URL visited at https://api.flukso.net/sensor/c1411c6b4f9910bbbab09f145f8533b9?interval=... is perfectly blank. Shouldn't I get data? I Googled the error and it says 'Method not allowed' is only ever seen when using a POST where POST is not alllowed.

The token and sensor id are directly copied from the 'working' example. The headers seem okay too. Is the working example still valid? Is there any other test server I can connect to trough the API? To be clear again: I do not currently have acces to a own Fluksometer yet, so There is no way for me to get my own sensor id or token.

Is there anybody that can help me further setting up my AJAX example on a Flukso test server?

Have a great day,
Roan.