Dev corner

Calling all engineers, tinkerers, hackers and geeks.

Conky script

Hi Jason,
Like you see, i made a new topic for the Conky stuff...

I used only a part of your script, conky_normal that i named .conkyrc
I changed the sensor ID from 1 sensor (PV panels)
I changed the Flukso lan IP adres
I installed Curl and Gawk
I installed of course Conky
I made a textfile with name: flukso-usage.sh and changed it rights in preferences to made it executable

Now i'm a bit stuck, how do i start it on a laptop desktop in Ubuntu 10.04 ?
Do i have to use also the first script (i use only conkyrc, not conkyrc_normal, conkyrc_bigflukso, and not conky_ups) ?
Sorry, i am a bit new on making bash scripts LOL

Graph values with comma of gas and water using pulses and TCRT5000

Hi,

I have a problem with reading my gas and water values on the flukso graphs.
They both get their pulses from this sensor: TCRT5000 Infrared Reflective IR Photoelectric Switch Barrier Line Track Sensor
As far as I know they are both working well and creating pulses each time I use water/gas.

When reading the values from the graph (Gas) I see each time values going from "22,235" -> "8,563"
The sensor is reading number 6 of the last red digit after the comma. So everytime it measure a pulse I used 10 liter of gas.
Why do I see values after the comma and even they change with each pulse. I should expect values like 22 -> 15 -> 8 -> 0
Even when I'm not getting pulses it says values like 76 or 36 on the graph where I should expect 0 or at least values like: 0,076 or 0,036
Gas constant: 10
Type gas meter: BK-G6M

The same story with my water pulse:
Water constant: 1
Each silver pulse = 1 liter
Type water water: v200

Thanks to clear this out.

Current situation:
Fluksometer v2b
5 sensors:
- 3 x 50mamp clamps are connected to S1+- S2+- S3+- (configured as 3 phases)
- 1 x TCRT5000 (GAS) getting power of 6a ; 2x DATA connected to S4+- (without using 100ohm 1/4watt resistor)
- 1 x TCRT5000 (WATER) getting power of 6a ; 2x DATA connected to S5+- (without using 100ohm 1/4watt resistor)

Kind Regards,
Frederikvv

Update Flukso firmware

Hi,

I have customized my Fluksometer by installing additional packages on it from the OpenWRT repository. For instance I have bridged the wired LAN and wireless LAN interfaces of the Fluksometer to make the device a wireless access point, and created an NFS mount from the Fluksometer to my NAS to increase its storage capacity (CIFS doesn't work). Now I don't want to miss the new functions and bug fixes of the new Flukso software, but I also don't want to have all my customizations overwritten everytime I update the device with new Flukso software. Is there a way to have only the Flukso packages updated (together with their prerequisites) rather than flash the entire firmware image?

Greetings,

SergeDV

looking for r241 alpha testers

I've compiled an alpha version of the upcoming r24x release. There's quite some new functionality in the pipeline with this release. Getting feedback on the fix for the non-integer fractional meter constants bug would be very helpful right now. Leave a comment if you'd like to be at the cutting edge and migrate to r241. I'll then upgrade your FLM remotely. Please do not sign up if you lack basic ssh and linux command line skills as this alpha version might still have some rough edges.

Cheers
/Bart

How To: MQTT: Nicely designed gauges

Edit: 29 June 2014: This guide is slightly out of date. There is now a combined method. However this How-To is still relevant if you would like to run the scripts separately/or just one or two. (for instance, I am mostly interested in the database logging). If you want to run the combined method on Ubuntu, please follow the new instructions in the ReadMe file on GitHub

This guide below should get the multiple scripts that do not need configuration by Markus Gebhard up and running on you server. Pieces are pulled from his readme files on github and others are specific to a clean installation of ubuntu-14.04-server. You should still read all those files and forum topics because there is a lot of explanation and information in them. It may look like i know what I'm doing but don't let that fool you.

This guide is written with the intent that you can just copy and paste as you read through. From personal experience I know this is an easy way to get in over your head. I said above that this is based on a clean install, and what I mean is that once you have ubuntu installed and you are looking at a command prompt this is the first thing you do. If you have other services listening at port 1080 or 8080 these scripts will not work. (you can of course modify them to run on whatever port you desire)

With the hopes that maybe this guide will help get this project installed on more devices and more folks hacking on it.

Environment:
Set up the environment/Get all the pieces in place
Update-

  • sudo apt-get update
  • sudo apt-get upgrade

Git-

  • sudo apt-get install git

mySQL-

  • sudo apt-get install mysql-server You will be prompted to set a root password

Tell MySQL to generate the directory structure it needs to store its databases and information

  • sudo mysql_install_db

Run a simple security script. You can change your root password for mySQL here or say no to the first question and answer the rest of the questions yes.

  • sudo mysql_secure_installation

Set up the mySQL db to have all the tables and settings that the scripts will expect

  • mysql -u root -p
    • create database flm;
    • use flm;
    • create user 'pi'@'localhost' identified by 'raspberry';
    • grant all privileges on flm.* to 'pi'@'localhost';
    • flush privileges;
    • set password for 'pi'@'localhost' = password('raspberry');
    • quit

node.js-
You may need to sudo apt-get install software-properties-common if the add-apt-repository below fails.

  • sudo add-apt-repository ppa:chris-lea/node.js
  • sudo apt-get update
  • sudo apt-get install nodejs build-essential libavahi-compat-libdnssd-dev

The scripts-
Install the scripts from Markus Gebhard using git below or download them as a zip file directly from github

  • cd ~
  • git clone git://github.com/gebhardm/flmdisplay/

Panel:

  • cd ~/flmdisplay/panel
  • npm install mqtt socket.io mdns
  • ./panel.sh

Persist:

  • cd ~/flmdisplay/persist
  • npm install mqtt mysql mdns
  • ./persist.sh

Chart:

  • cd ~/flmdisplay/chart
  • npm install socket.io mysql
  • ./chart.sh

If you have gotten through without errors then everything should be up and running. If you want to double check try pgrep -a node This will list the process ID of each node instance and what the script name is at that pid. (useful if you want to kill -9 a specific process.)

You will want to know what the local IP address of your machine is. Try this if you are using wired ethernet (wlan0 if wireless)ifconfig eth0 | grep 'inet addr:' | cut -d: -f2 | awk '{ print $1}' or just type ifconfig and read it yourself.

On another computer you should then go to the local address of your server to access the chart and panel.

Panel:
http://"local IP address":1080
Chart:
http://"locall IP address":8080

Remember the persist node is dumping data every second into the database. (even in the case of 0 data) Lots of info in there to manipulate. There are plenty of ways to get the data out if you want to do some presentation. Tab separated files can be dumped directly from mySQL. PHPmyAdmin can pop the data out in a spreadsheet readable file... etc some assembly required...

Size:
With 3 FLM and therefor 9 sensors recording data every second I am seeing the database become 97MB in about a day. I'd love some feed back regarding your experience with the speed of drive space consumption in your set up. (I plan on making more precise measurements) But just a heads up, you should plan accordingly, whether it be large enough drives or clean up scripts...

feedback and corrections appreciated.