Outlook for Android – Can’t use it for Gmail account!

I used to have a Microsoft Lumia 550 phone, which although basic just worked and really well. Unfortunately I’m a little clumsey and managed to drop it around a dozen times when getting out of the car at work (yeah, you’d think I’d learn). It managed to survive those drops, but only just and ended up with a lovely set of cracks across the screen which I superglued to stop them completely distroying the screen and to prevent getting glass shards in my fingers.

Anyway, it’s got to the point where I needed to get a replacement phone and I would have gone for another Windows phone, but there haven’t been any new releases for a while and I refuse to pay £600+ for the HP one. So, I’ve reluctantly bought an Android…

Why reluctantly? Well I believe Google is getting a little scary in it’s acquisitions (Boston Dynamics) and the recent purchases of a couple of certificate authorities concerns me about personal privacy.

Anyway, I’ve set up my phone to remove a lot of the Android pre-installed crap from Google and set my default browser to Firefox. I thought nothing of doing this until just last week when Outlook refused to connect to my Gmail account and prompting to re-authenticate. I’d click ok, re-authenticate and get a 403 error from Google. After a couple of tries, I remove my Gmail account and tried to re-add it.

Much to my suprise, I can’t re-add my account unless I set Chrome as my default browser!!! Talk about anti-competitive behaviour from Google!

I absolutely refuse to use Chrome as my default Android browser just so that I can use my Gmail account from Outlook!

Home Monitoring Upgrade (Part 2) – HSQLDB to MySQL

As mentioned in my previous post (see http://blog.v-s-f.co.uk/2017/04/home-monitoring-upgrade/), the first task I have is to migrate from HSQLDB to MySQL.

Because the system logs data every minute while I have power in the house and I want to minimise downtime when I actually have a fully working upgrade, I’ve experimented with a copy of the live HSQL database.

Once I’d copied it from my server to my laptop I then attempted to view the data in notepad++ – yeah, not a particularly smart move! NP++ cannot handle files over about 100M. It also turns out (having more’d the .data file) that the data is not in a readable state. I had a performance issue with a select query a long time back and changed the table to cached.

So, luckily at work a colleague had introduced us all to a great database tool called SQL Workbench. It can work with most databases and unlike SQuirreL, it doesn’t crash when looking at the work DB2 database.

Using SQL Workbench, I’ve then created a script file which creates the new consolidated table and loads data from the old tables in to the new + drops the old tables. The end result is a 122,398KB HSQLDB script file which is human readable.

Next step was to get MySQL running on my server. Instead of installing it directly though, there’s a Docker image available.

My first few attempts at inserting the data from the HSQLDB file in to the MySQL database were less than impressive! One of the attempts had the server running flat out (100% cpu) for over an hour when I finally decided that it was probably not going to complete the import this year and nuked it!

So having learnt a few lessons about not using single row inserts(!), but batching them in to multi-row inserts of 100,000 and a few MySQL deafult parameter increases (although I’m not sure if these are necessary as the batch inserts seemed to make most difference), I was finally able to import the data. It still took a few minutes from running the MySQL container to it being available – but that’s significantly better than running for hours importing the data!!

Now that I have the necessary scripts and knowledge to migrate the data, the next part is re-writing the application that receives the Arduino data, uploads to PVOutput and serves the hot water display Arduino.

Home Monitoring Upgrade

I’ve been monitoring stats from my meter, weather and hotwater tank for over two years now (see http://blog.v-s-f.co.uk/2015/04/home-monitoring-home-made-reborn/) and the application now needs an upgrade.

I now want to log more data from the weather station (temperature and humidity). This should be as simple as adding two new columns to the HSQLDB, changing the application to write in to the two new fields and adding two new fields to the service definition, but it’s not quite that straight forward…

The old app uses an out dated version of Mule on Tomcat in Docker and it’s far too heavy weight for what it needs to be. Therefore it’s time to give it a revamp.

It’s also occured to me recently that instead of storing the data in five separate tables (one for generation, upload info, hotwater, meter and weather data), why not store it in one table. This saves a significant amount of space as there are four less records per minute and it makes adding new columns for additional data sources relatively quick. The HSQLDB that I’ve been using for a while now is over 400M!

So the first task, which is possibly the biggest, is to migrate the data from the five tables in HSQLDB to a single table and then stop using HSQLDB and migrate to MySQL. Why MySQL – it’s actually quite a performant database, it’s free and easy to get running.