Category Archives: Linux

Yet another Freeboard widget plugin

freeboard-widget-plugins

Two new widget plugins are available for Freeboard.io

  1. Slider widget plugin
  2. Switch widget plugin

Freeboard

A damn-sexy, open source real-time dashboard builder for IOT and other web mashups.

What is It?

Freeboard is a turn-key HTML-based “engine” for dashboards. Besides a nice looking layout engine, it provides a plugin architecture for creating datasources (which fetch data) and widgets (which display data)— freeboard then does all the work to connect the two together. Another feature of freeboard is its ability to run entirely in the browser as a single-page static web app without the need for a server. The feature makes it extremely attractive as a front-end for embedded devices which may have limited ability to serve complex and dynamic web pages.

See it in action @ https://goo.gl/hbAXXU

All plugins are available for download from the following Github repository: https://github.com/onlinux/freeboard-plugins

Slider widget plugin for freeboard.io

slider

 

 

slider-settings

At each value change, a request is sent with the argument pattern %VALUE% replaced with the value set by the slider.

 

Switch widget plugin for freeboard.io

switch

 

switch-settings

Freeboard INSTALLATION

Follow the instructions from Freeboard github site

Freeboard can be run entirely from a local hard drive. Simply download/clone the repository and open index.html. When using Chrome, you may run into issues with CORS when accessing JSON based APIs if you load from your local hard-drive— in this case you can switch to using JSONP or load index.html and run from a local or remote web server.

 

  1. git clone https://github.com/Freeboard/freeboard.git
  2. npm install
  3. grunt

Then run a index.html or index-dev.html through a webserver.

 

PLUGIN INSTALLATION

Copy the plugin file  to your freeboard installation, for example:

$ cp ./slider.js /var/www/freeboard/plugins/

Edit the freeboard index.html file and add a link to the plugin near the end of the head.js script loader, like:

head.js(
  'js/freeboard_plugins.min.js',
  'plugins/slider.js',
  'plugins/switch.js',
  $(function() {
    //DOM Ready
    freeboard.initialize(true);
  })

 

How to control your Domoticz SmartVirtualThermostat (SVT) from your linux desktop or your Raspberry Pi with python and pygame

Smart Virtual Thermostat Plugin for domoticz is provided by Logread 999LV (SVT Domoticz repository : https://github.com/999LV/SmartVirtualThermostat.git ). Many thanks to him!

This utility  will help you to control from internet your domoticz virtual thermostat from a Raspberry Pi equipped with a TFT screen or from any linux PC.

Screenshot_20181229_155406 Screenshot_20181229_155153 Screenshot_20181229_155611

Screenshot_20181229_155515

 

Install libraries:

$ git clone https://github.com/onlinux/thermostat-domoticz.git

run:

$ cd thermostat-domoticz
$ sh setup.sh

Configuration

Modify config.ini

[secret]
server= # Enter your domoticz server name
ip_domoticz=
port= 
username=  # Enter username if exists
password=  # Enter password to access your domoticz server

Start Thermostat Domoticz

$ source venv/bin/activate

Start  linux desktop script:

$ python z.py

Or start  raspberryPi with TFT script

$ python z-pi.py

‘Alt-PageDown’ key or ‘n’ key to roll over the 4 available displays Click to change Meteo Station when displaying forecasts. Meteo Stations are defined within z.py

tlocations = (
				{'code': 'FRXX0099' , 'color': BLACK},
				{'code': 'FRXX4269' , 'color': BLACK},
				{'code': 'FRXX3651' , 'color': BLACK},
				{'code': 'BRXX3505' , 'color': DARKGREEN}
)

Zibase-thermostat

Accéder au thermostat zibase depuis un pc linux ou raspberryPi avec python

Screenshot_20181229_155406

Bien que le futur de notre bonne vieille zibase soit peut être compromis très bientôt, je voulais vous faire partager une application que j’ai développée il y a déjà presque cinq ans (2014), et que je viens de remettre à jour et déposer sur github.

C’est une version wan qui peut-être accédée depuis l’internet ou le réseau local.

Sur le raspberrypi, l’application s’affiche sur un écran TFT tactile dans mon salon. La version RaspberryPi  TFT avec accès aux boutons GPIO n’est pas encore publiée.

La version présentée aujourd’hui et disponible sur le dépot Github , est une version qui tourne sous linux sous environnement X. Tous les commentaires et ‘issues’ sont bienvenues sur github.

Il est peut être possible de l’adapter aux plateformes Windows.

Screenshot_20181229_155515 Screenshot_20181229_155611 Screenshot_20181229_155153

Installation des bibliothèque :

$ git clone https://github.com/onlinux/zibase-thermostat.git
$ cd zibase-thermostat

Installer  python-pip s’il n’est pas déjà installé:

$ sudo apt-get install python-pip

Installation de pywapi

Télécharger la dernière version de la bibliothèque pywapi depuis : <https://launchpad.net/python-weather-api/trunk/0.3.8/+download/pywapi-0.3.8.tar.gz>

Untar les sources et installer :

$ tar xvfz pywapi-0.3.8.tar.gz

$ cd pywapi-0.3.8

$ python setup.py build

$ sudo python setup.py install

$ cd ../zibase-thermostat/

# Installation de la bibliothèque pygame

$ sudo apt-get install python-pygame

Configuration

 

thermostat_variables

Set [global] thermostat variables as specified within zibase interface

Modifier le fichier  config.ini

L’exemple du thermostat zibase ci-dessus devrait donner un fichier config.ini ainsi:

[secret]
 zibaseid = ZiBASE00xxxx
 tokenid  = 00xxxxxx
 [global]
 tempvariable= 28
 setpointdayvariable= 29
 setpointnightvariable= 30
 modevariable= 31
 statevariable= 13
 thermostatscenario= 32

# Lancer Thermostat Zibase

python z.py

Alt-PageDown key to roll over the 4 available displays

Click to change Meteo Station when displaying forecasts.

Meteo Stations are defined within z.py

tlocations = (
				{'code': 'FRXX0099' , 'color': BLACK},
				{'code': 'FRXX4269' , 'color': BLACK},
				{'code': 'FRXX3651' , 'color': BLACK},
				{'code': 'BRXX3505' , 'color': DARKGREEN}
)

Dynamic Highcharts plugin for freeboard.io

Freeboard

A damn-sexy, open source real-time dashboard builder for IOT and other web mashups.

What is It?

Freeboard is a turn-key HTML-based “engine” for dashboards. Besides a nice looking layout engine, it provides a plugin architecture for creating datasources (which fetch data) and widgets (which display data)— freeboard then does all the work to connect the two together. Another feature of freeboard is its ability to run entirely in the browser as a single-page static web app without the need for a server. The feature makes it extremely attractive as a front-end for embedded devices which may have limited ability to serve complex and dynamic web pages.

Dynamic Highcharts widget plugin for freeboard.io

This widget plugin is  based on the highcharts widget plugin created by Hugo Sequeira.

Github repository: https://github.com/onlinux/freeboard-dynamic-highcharts-plugin

See it in action @ https://goo.gl/hbAXXU

dynamic-highcharts-plugin-4

dynamic-highcharts-plugin-1

dynamic-highcharts-plugin-2

INSTALLATION

Copy the file (plugin_highcharts.js from https://github.com/onlinux/freeboard-dynamic-highcharts-plugin) to your freeboard installation, for example:

$ cp ./plugin_highcharts.js /freeboard/plugins/thirdparty

Edit the freeboard index.html file and add a link to the plugin near the end of the head.js script loader, like:

head.js(
  'js/freeboard_plugins.min.js',
  'plugins/thirdparty/plugin_highcharts.js',
  $(function() {
    //DOM Ready
    freeboard.initialize(true);
  })

 

Actuator widget plugin for freeboard.io

Freeboard

A damn-sexy, open source real-time dashboard builder for IOT and other web mashups.

What is It?

Freeboard is a turn-key HTML-based “engine” for dashboards. Besides a nice looking layout engine, it provides a plugin architecture for creating datasources (which fetch data) and widgets (which display data)— freeboard then does all the work to connect the two together. Another feature of freeboard is its ability to run entirely in the browser as a single-page static web app without the need for a server. The feature makes it extremely attractive as a front-end for embedded devices which may have limited ability to serve complex and dynamic web pages.

Actuator widget plugin for freeboard.io

This widget plugin is based on the interactive-indicator created by Stufisher.

See it in action @ https://goo.gl/hbAXXU

Actuator Widget

Actuator Widget

 

Github repository: https://github.com/onlinux/freeboard-plugins

 

I modified it  mainly to fit my needs. It merely links the states ON and OFF to URLs.

actuator-2A click on the indicator switches the state ON/OFF of the actuator which is bound to a http request.

INSTALLATION

Copy the plugin (actuator.js  from https://github.com/onlinux/freeboard-actuator-plugin) to your freeboard installation, for example:

$ cp ./actuator.js /freeboard/plugins/

Edit the freeboard index.html file and add a link to the plugin near the end of the head.js script loader, like:

head.js(
  'js/freeboard_plugins.min.js',
  'plugins/actuator.js',
  $(function() {
    //DOM Ready
    freeboard.initialize(true);
  })

 

Réception 433.92MHz du compteur de consommation électrique OWL Micro+ ou CM180 avec un dongle Realtek RTL2832 DVB.

 

20150127

rtl-sdr dongle + Owl Micro+ CM180

Le programme rtl_433 permet de convertir un dongle RTL2832 initialement prévu pour la réception TV TNT hd en  récepteur 433,92MHz.  Ce dongle est disponible à l’achat sur internet pour une vingtaine d’euros. (Une recherche google sur  “sdr rtl” vous fournira une multitude de renseignements ainsi que des liens sur des boutiques de vente en  ligne proposant ce dongle).

L’acronyme SDR signifie Software Defined Radio, et RTL c’est la puce (RTL2832) qui équipe le dongle .

J’ai acheté le mien chez Passion Radio Shop

Tout nouveau possesseur d’un de ces dongles miraculeux, j’ai ajouté rapidement le support du OWL micro+ au programme rtl_433.  Le projet initial rtl_433 peut être téléchargé ici: https://github.com/merbanan/rtl_433 (depuis février 2015 mes modifications y ont été intégrées. Désormais le programme rtl_433 reconnaît  les trames envoyées par OWL CMR180)

Je l’ai adapté afin de supporter le transmetteur OWL CMR180 qui accompagne le récepteur OWL CM180. Vous pouvez télécharger un fichier zip disponible  sur le repository github https://github.com/onlinux/rtl_433 ou bien cloner le projet en local sur votre pc

git clone https://github.com/onlinux/rtl_433.git
cd rtl_433/
mkdir build
cd build
cmake ../
make
make install

20150127-zoom

@I7:~/rtl_433/build$ rtl_433 
Registering protocol[01] Rubicson Temperature Sensor 
Registering protocol[02] Prologue Temperature Sensor 
Registering protocol[03] Silvercrest Remote Control 
Registering protocol[04] ELV EM 1000 
Registering protocol[05] ELV WS 2000 
Registering protocol[06] Waveman Switch Transmitter 
Registering protocol[07] Steffen Switch Transmitter
Registering protocol[08] Acurite 5n1 Weather Station
Registering protocol[09] Acurite Temperature and Humidity Sensor
Registering protocol[10] Acurite 896 Rain Gauge
Registering protocol[11] LaCrosse TX Temperature / Humidity Sensor
Registering protocol[12] Oregon Scientific Weather Sensor
Registering protocol[13] KlikAanKlikUit Wireless Switch
Registering protocol[14] AlectoV1 Weather Sensor
Registering protocol[15] Intertechno 433
Registering protocol[16] Mebus 433
Max number of protocols reached 15
Found 1 device(s):
 0: Generic, RTL2832U, SN: 77771111153705777
Using device 0: Generic RTL2832U
Found Rafael Micro R820T tuner
Exact sample rate is: 250000.000414 Hz
Sample rate set to 250000.
Sample rate decimation set to 0. 250000->250000
Bit detection level set to 10000.
Tuner gain set to Auto.
Reading samples in async mode...
Tuned to 433920000 Hz.

Energy Sensor CMR180 Id 6280 power: 240W, total: 508308384W, Total Energy: 141.196kWh
Weather Sensor THGR122N RC 86 Channel 1 Temp: 19.5°C 67.1°F Humidity: 46%
Energy Sensor cmr180 Id 6282 power: 272W
Sensor temperature event:
protocol = Rubicson/Auriol, 36 bits
rid = 1d
temp = 7.5
1d 80 4b f0 00 
Energy Sensor CMR180 Id 6280 power: 272W, total: 508323744W, Total Energy: 141.201kWh

Pour la réception à l’aide d’un arduino ou d’un raspberry pi, se reporter à mon post précédent https://blog.onlinux.fr/decode-and-parse-the-oregon-scientific-v3-radio-data-transmitted-by-owl-cm180-energy-sensor-433-92mhz-2/.

Decode and parse the Oregon Scientific V3 radio data transmitted by OWL CM180 Energy sensor (433.92MHz)

Owl micro+ Wireless electricity monitor runs on Oregon Scientific V3 protocol.

After buying one of those wonderful little devices to study the energy consumed at home, i browsed the internet to find a way to decode frames sent by the transmitter (CMR180) but I have not found any application describing the coding system of the data within  the radio frames. So I decided to study the radio packets to decode the system.

20150117_142540

Please visit the Github repository (https://github.com/onlinux/OWL-CMR180) to get all information about how to decode the packets.

Code available for RaspberryPi and Arduino.

Load arduino sketch to run a mini Owl Micro+ energy monitor as shown on the picture above.(https://raw.github.com/onlinux/OWLCMR180/master/arduino/oregon_owl.ino)

 

 

Monter une partition d’un fichier .img sur un périphérique de rebouclage

eric@I7:~/raspi-bck$ fdisk -u -l raspidev.img 

Disque raspidev.img : 7892 Mo, 7892631552 octets
255 têtes, 63 secteurs/piste, 959 cylindres, total 15415296 secteurs
Unités = secteurs de 1 * 512 = 512 octets
Taille de secteur (logique / physique) : 512 octets / 512 octets
taille d'E/S (minimale / optimale) : 512 octets / 512 octets
Identifiant de disque : 0x000b5098

Périphérique Amorçage Début       Fin   Blocs Id. Système
raspidev.img1          8192    122879   57344  c  W95 FAT32 (LBA)
raspidev.img2        122880  15415295 7646208 83  Linux

Prendre le numéro du premier secteur de la partition qui nous intéresse et multiplier ce nombre par la taille d’un secteur (ici 512 octets). Si l’on veut monter la deuxième partition, par exemple, on obtiendra 122880 * 512 = 69914560

Maintenant créer un répertoire et y monter la partition:

mkdir /tmp/raspidev
sudo mount -o loop,offset=62914560 raspidev.img /tmp/raspidev/

Une fois terminer , démonter la partion :

sudo umount /tmp/raspidev/
rm -r /tmp/raspidev/