Encouraged by my success with barometric data logging I decided to improve it a bit by logging to a remote database rather than simply writing tab separated text to a local file.That involved adding a wee USB wi-fi dongle (TP-Link TL-WN725N) to pixie, which has not had permanent Internet connectivity since dixie took over. I struggled with that, and Raspbian (which pixie now runs because it was recommended for piface) – but eventually I succeeeded.
Then things went more smoothly. I created a new MySQL database called metdb at dalriada.org.uk, my main ‘home’ site hosted by eukhost. It has just one table, named metrecord but, crucially, it is accessible remotely from dalriada8eepa.plus.com – where pixie runs. Then it’s a simple matter of:
cursor.execute("INSERT INTO metrecord SELECT '%s', %s, %s" % (tnow,pressure,temp)
instead of the previous print to file. Then I can leave pixie to get on with it, headless, and inserting a row into metdb.metrecord at dalriada.org.uk every 15 minutes.
After that I can query the database any time I like, from wherever I like, by whatever means I prefer. I am most likely to generate a report via Jaspersoft’s iReport Designer from my regular desktop PC, running Arch Linux: