Please note – this blog is WELL out of date and all of my blog items and much, much more have now been moved to http://tech.scargill.netI
’m now getting dangerously near the point where I have to DO something with all of this ESP8266 control stuff. We’re at the cave and I’ve a watering system to sort – a simple example – so one of the ESP012 boards has a relay on it and another has an ADC input. By the use a simple Node-red function combining timing and reading the ADC convertor (which is attached to a cheap Chines moisture sensor) and looking at the value coming out (already tongue-tested) I should be able to arrange to turn the watering system on and off twice a day – but also taking into account extreme levels of moisture either way (i.e. don’t’ bother watering the plants when it is pouring with rain… and give them a little extra when it is bone dry out there. If I really trusted the moisture sensor I could do away with the timings – but I don’t – I am convinced the PCB-based sensor will corrode and die as the units are only £1 a time – they work incidentally from 3v3 to 5v and have 2 outputs – one is simply digital – you adjust the pot onboard to get a change of level from 0-1 etc at a certain level of humidity – the other output is analog – I think I prefer the latter. Anyway, one must try these things as they are cheap enough to put all over the place.
Yesterday however I came up with a problem. My wife, trying to fit a bulb in the dark, blew the fuses and of course the mains went off as did my broadband. On reconnect, it took the router a little while to get it’s act together – and I realised – the Raspberry Pi does NOT recover from no WIFI which means no controllers talking to each other.
This link to an article about using cron jobs and a script to reboot the PI I’ve just implemented –very easy to do – just takes a minute or so… checks the router address every 5 minutes – and if it does not get a response – reboots the Pi. Hopefully that’s that problem out of the way. I already know that the little ESP boards with MQTT have a watchdog timer and so they reboot until they get a connection. Here’s hoping that is sufficient to guarantee operation under real-life circumstances.
Please note – this blog is WELL out of date and all of my blog items and much, much more have now been moved to http://tech.scargill.net
7am here in Bedrock as we start our second full day in Andalucía.
It’s starting to look good already and this morning Maureen is off with some of the ladies to have fun while I sort out some tech work I have to complete via Skype with my friend Aidan in the UK.
My jobs for this weekend include getting the watering system back up and tested this time using an ESP8266 board with the Raspberry Pi controller which I’ve just spent several hours getting working thanks to a router that amazingly by default isolated users from each other (believe me that took some finding).. I’ve brought much more meaty power supplies (12v 6amp) with me to Spain this time to handle the rather unpredictable power here – though I suspect I’ve not brought enough. As an experiment I brought another solar regulator along with an alarm 12v battery and panel –I want to see if I can run the router and Raspberry Pi controller off the sun entirely. I suspect that’ll have to wait for our June/July run in which we’re bringing the car from the UK as I just could not fit my largest (40w) solar panel into the travel case!!
I’m quite excited today as the tech Facebook page just tipped 1000 likes… but first, we need to get into that lake and enjoy the fine weather Andalucía is having right now, t was a little misty at 7am but already as 9am approaches, the sky is clear blue and will typically sail past 30c in the afternoon with peaks around 40c which might sound a bit much to Brits starved of sunshine but trust me – you get used to it if you’re neck-deep in a lake.
As you see below, my Arduino/NRF24L01 network has been working reliably over here, tracking temperature and humidity as well as giving me remote access to lighting etc. I have been logging temperature and humidity for a some time now) and the humidity is finally dropping rapidly – we picked a good time to arrive.
Just put the latest “Esp8266 unofficial” development kit on my laptop, developed a MYSQL logging protocol for the little ESP boards and just about ready to start populating the place with controllers. I just need a little clearer understanding of the MQSQL “Insert into… on Duplicate” code I’m playing around with here http://sqlfiddle.com/#!9/04c6c/1
For now I’m off with my OWNCLOUD-backed-up mobile phone, thanks to THREE network I have access to my unlimited data while abroad so no problem syncing up with servers. Nice.