Pi display

Dragelec did at one time update via socketio to a flask based website showing the temperatures, electricity usage etc rather than leaving the display on all the time i added a PIR to turn it on/off whenever a presence was detected, the following is the complete code;

[Read More]

adding epoch time

Not pretty but it works…

After a power cut had stopped the data recording I decided to follow up on my post of storing the date in epoch format and not date/time converting the existing db to add an epoch column, what follows is not pretty probably not something anyone should follow. It's cobbled together from my beginners knowledge and of course internet searches…

I added an extra column manually using DB Browser for SQLite and then programmatically converted the combined date and time into epoch

[Read More]

Poor choice at db creation

OK i've been ignoring brexit and the fact our politicians were granted a delay and promptly went on holiday….

So its been a little journey into utilising the data i've recorded for the last 9 months in an sqlite db and its at this point i realise that perhaps whilst my data is readable to me without parsing i should have stored dates/times in a different format.

[Read More]

Cold!

Brrr … ok we dont have the snow yet here and we definitely do not have the polar vortex weather being experienced in the States but it got pretty cold this morning.

[Read More]
python 

dragelec - monitoring the home

[2018-08-28 Tue 11:45] this was totally re-written during a 2hr flight; finally i achieved something useful on a plane. What is dragelec? Well it was a project initially started to alert me when there was a light or temperature issue with my bearded dragons enclosure and play a Polish radio station, it relied on; - one of the first raspberry pi's - a DS18B20 wired temperature sensor - an LDR - MPD - the commandline music player - some python code for monitoring and emailing Then when someone i know started to take 45-90min showers on a daily basis (strangely something i objected to) i decided to re-write it to monitor electricity so that i could confront said individual with evidence and when that didn't work it was again expanded to automatically shut off the internet if the usage was >5. [Read More]

sql learning and poor decode routine

Since converting to storing the data in sqlite form i've been learning how to extract specific sections of data ready to then learn how to graph it and serve on the home dashboard and during these experiments i can see my decode routine is not quite as efficient as i originally thought as it lets through non-numeric data so lets look at the sql extraction code and then the decode issue;

[Read More]

python2 > 3, network drives, sql

I finally have some 'free' time :) so i upgraded a few things on the pi server but not without issues… From jessie to stretch - network drive For some reason the old command for mounting a network drive on the pi which worked on jessie did not work under stretch. I kept getting a host is down fault yet it was clearly not. The line i had in fstab before was; //192. [Read More]

shortened code

The module i wrote for decoding the sensor data stream bugged me it was too repetitive with multiple if statements ie;

[Read More]
python 

Decoding employee RFID tags, let the fun commence

Plant Engineering wanted to include RFID scanners on new equipment but no one had looked at the feasibility of doing this so I saw a small chance for a side project and a play with Python. All employee passes are embedded with RFID and this is used for clocking in and also door access across the sites. Using a relatively cheap ID-12SLA RFID reader and a python script i was able to not only read the hex string contained in the card but also decode the unique number which is printed on the card. [Read More]
python  rfid