Estacion Meteorologica EM
This project consist of:
- temperature and humidity sensors prototype based or arduino UNO and dht22. See thsUNO chapter
- temperature and humidity device battery powered. See thsnano chapter
- sensors collector software system for raspberry pi raspbian based. See scsem chapter
Prototype to learn and play
The real used sensor low power consumption device up to 2 DHT-22 sensors and one HC-05 device
It consists of some scripts and nice docker to run influxdb and grafana so that store and show fancy graphs in a web interface Main script collectorMain launch several threads one per device or local dht onboard on gpi in raspberrys. Sensors home layout is in global dict easy to understand. It logs for debugging to 2 files, one per traces an other only for exceptions.
NOTE: to review with several peers BT arrives... Setup bt devs in rpi and or ubuntu
sudo rfcomm release all sudo rfcomm bind hci0 1 // this creates /dev/rfcomm0 dev, and when any program open it, it connects automatically, e.g minicom -D /dev/xxx
in /etc/bluetooth/rfcomm.conf can be setup binding too
Alternative working in ubuntu sudo hcitool cc 98:D3:32:20:FB:90 //connect sudo hcitool cc 98:D3:32:20:FB:90 //disconnect
If you have problems with setting up the pin, you can force in: sudo su, echo "zzzzzz 1234" >/var/lib/bluetooth/xxxxx/pincodes xxxx is host mac bt address and zzzz mac bt address of dht https://myraspberryandme.wordpress.com/2013/11/20/bluetooth-serial-communication-with-hc-05/
In this project, bindBTmac.sh is used to setup. It is launched by collectorMain.py.
Search raspberry images as armhf architecture in docker hub. It isn't the same that your tipically x86 laptop. For an easy hack compatibility check docker_influxdb or docker_grafana launcher script in this repo. Fortunately comunity is great, however there is some concern about security...
Some of the best links used during this learning journey. Thanks to all
- Maybe i should create a docker image for thscollector dividing it in two part one per bt access and other pure ip and process so that deploy will be smarter and out of python deps
- rotate logs and make it configurable ? or input args?
- mostfed stuff
- battery stuff, hw and battery life show up in graphana
- other approach for dababase more generic not only one temperature item but
- logfile names configurable, put in tmpfs
- ports of containers configurable
- database and grafana var lib out of repo path and maybe in tmpfs