HomeIO Articles about real life tech solution and HomeIO - an universal system for remote monitor and control

Addons

Addons

I’ve started new very big feature - addons. If someone want to add funcionality dedicated for various systems like:

  • statistics
  • custome Overseer
  • regular actions

It will be best to create addon and add it to array.

Addon array is implemented using polymorphic vector.

Measurement groups

What is measurement group?

It’s set of array of names to define measurements which are similar to themself in any way. You are free to set your own groups in main.cpp file, like in example below:

h->measGroup->addGroup("name_of_group", "meas1,meas2,meas3");

Example:

h->measGroup->addGroup("temperature", "int_temperature,ext_temperature");

All of them describe temperature and are stored in identical unit - degrees. But it’s not required. You can create group with measurements related only by nature of the system.

h->measGroup->addGroup("battery_state", "batt_u,i_gen_batt");

In example above battery voltage is related to current which charge them.

h->measGroup->addGroup("generator_state", "coil1,i_gen_batt");

In example above charging current is related to coil voltage.

You can safely press CTRL+C

Till this day pressing CTRL+C had some bad effects, now it’s safe* to restart backend.

it *should be :)

First was fixing locked TCP socket issue, which I’ve done it a few months ago. About month ago I had an idea that it’s not nice to kill backend process while it write measurements. As you know (or now) backend store two versions: stored CSV (name, time from, time to, value) and buffer (all data fetched from uC, but not more than million of raw values per measurment type). Image pressing CTRL+C while backend does it. It would be not nice - data loss (keep in mind HomeIO is not intended to enforce persistence).

For about 3 weeks if you press CTRL+C signal execute close procedure which close all subsystems in a proper order. Good, but not awesome. It won’t stop storing data. Since today measurements are stored after stop is initialized, so all measurements that are in memory should be read after you restart.

New sensors in local instance!

Hardware

Some time ago I bought a few sensors. Two of them were:

  • analog temperature senson LM35,
  • digital humidty and temperature senson AM2302

A few days ago I had time to use them in local HomeIO instance.

Digital sensor is much more accurate than analog. Digital sensor has 0.1°C resolution, while analog one has 0.5°C effective resolution when using ADC converter. You can change reference voltage to increase resolution, but it’s not recommended in present situation, when there are other analog sensors.

Outcome

I bought another digital one and installed it outside few moments ago. I hope this will result in interesting conclusions over time.

Measurements:

  • internal temperature - 21.4 °C
  • internal humidity - 45.2 %
  • external temperature - 13.3 °C
  • external humidity - 69.5 %

Proper HTTP requests in C++, makefile and small portion of fame on Nukomeet blog

Fame

Nukomeet featured my article about HomeIO and plant monitoring system. Thanks! :)

Makefile

I used script files to run backend cleaning, compilation and run it to various systems. Now it’s the makefile !

If you want to run just type:

make run SITE=dev

SITE variable tells which instance to run. Instance is defined by proper main file in /src/mains.

Proper HTTP requests

I’ve integrated libcurlpp and now all spy requests are done in a good way. The bad thing is that you need to install more dependencies on your system.

For Debian users you can

make debian-deps

or

sudo apt-get install libcurl4-openssl-dev git g++-4.9 cpp-4.9 libcurlpp0 libcurlpp-dev

The libcurlpp0 libcurlpp-dev Debian packages are required from now additionaly.