Nextion WIFI Touch Display

tmpAE8DPlease note ALL of this information is now dated – the blog http://tech.scargill.net is now the place to see this and MUCH more tech info, thanks. The blog has thousands of followers and covers ESP8266, Raspberry Pi, reviews of many single board computers, Node-Red development and much, much more. Please visit the new blog.

Continue reading

Advertisements

The Boston Trip

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

beerSome time ago, the CEO of Espressif, makers of the lowest cost WIFI-enabled processor on the planet and one I’ve blogged about frequently in here, invited me over to MIT at Boston to the FAB11 conference. As it turns out this was a rather small affair featuring things like 3D printers and other fabrication equipment. However the main point was to run a series of workshops on the ESP8266 and along with me were employees of Espressif including Jeroen Domburg (ES_-HTTPD) and Ivan Grokhotkov (Esp8266/Arduino).

Continue reading

Deployment Beckons

moisture sensorPlease 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

’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.

Continue reading

A fine day for playing with solar panels

Galera

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.

Continue reading

So Many Things to Do Video

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

I’ve been meaning to update the blog – and I just keep getting sidetracked with the many interesting possibilities of Node-Red….  so – I put a short video together here. Should be something of interest in it.

https://www.youtube.com/watch?v=xoQ_Fs31xtM

Pete

Node-Red on The Raspberry Pi

Solid State Relays

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 – visit the site – sign up for much more.

SSRYesterday I published a blog about some little DIP solid state relays – and was reminded by a friend that these… http://www.ebay.co.uk/itm/351198840167?_trksid=p2059210.m2749.l2649&ssPageName=STRK%3AMEBIDX%3AIT are cheaper and higher power if not so tiny – and he’s right – I have some and they work a treat. If you try them from GPIO0 on the ESP8266 however, make them + based not – based.. ie connect – to the output and + to the 3v3 supply of the ESP8266 which means you have to reverse your on/off logic.

I have one attached to a compact fluorescent light and it’s working a treat.

ESP8266 and Lost WIFI Connection

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 – many of the blog entries have been brought up to date – please visit the new site and register for much more.

Something those of you planning to use your ESP8266 units in remote installations might want to be aware of.  I’ve been working with TUAN who developed the MQTT software – now, I’m sure it has nothing to do with his code… but essentially, I’m using his latest software as the basis of a controller.

I’ve added a simple interrupt driven real time clock, refreshed by occasional MQTT message, I control output 0……GPIO0 – and I have a temperature sensor on GPIO2.

All of this works VERY nicely (some new updates from last night you might want to get from the GIT repository) – when the temperature drops below a certain level the output comes on etc, or I can manually turn the output on and off.  I can even store settings in FLASH having added a little section to the area that normally holds WIFI settings – all of this works perfectly.

BUT.. has anyone tried turning off the WIFI for a while…. and then turning it back on? Does your little board reconnect every time, reliably? Because in the real world of remote control that will happen.  I am finding that this is not always the case, that the code sits and tries to connect, maybe even seems to but ultimately fails. If the ESP SDK comes back with “STATION_CONNECT_FAIL” just what exactly should yo do about it?

Most of the time, simply disconnecting the ESP8266 board sorts the problem – if not the first time, the second time (and that in itself is a worry) – but that is no good if the board is actually controlling something – you can’t just reboot the board, you need to somehow reboot the WIFI while maintaining control over whatever it was you were doing…. or find another way to ensure that the WIFI reconnects every time.

The alternative is to use the board with an Arduino and have the Arduino reset the ESP8266 in the event of communication failure – but that’s really a bit of a cop out.

Thoughts?  (this is for C programmers, we’re not talking about LUA though I’m sure that is also worth testing).

Thanks to input here I’ve asked Tuan if it’s possible to update the code using the new 0.9.5 SDK + patch… and we’ll try again!

ESP8266 and JSON

Has anyone using the ESP8266 with the SDK had a go at using the JSON routines yet? I ask because I need to pass several MQTT messages to the board in a string.  I can of course do this the hard way, comma delimiter or similar, but it would be nice to try to use the JSON routines already in there. Anyone up for a simple example of use with 3 or 4 values passed to a string?

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 – visit the site – sign up for much more. There is a search facility in the new blog – and you can find all of these old items usually with a similar name.

For example…

http://tech.scargill.net/esp8266-and-json-2/

SOLID STATE MINI-RELAY FOR ESP8266

This is my original blog – all of the material in here has been moved to the now very popular http://tech.scargill.net – you can find all the older material, some of it updated – and a whole load of new stuff – at http://tech.scargill.net

8-pin chipOne of the guys who looks in here re-blogged something of mine and I thought I’d take a look at his site – and discovered these:

The PR26MF22NSZ and it’s larger cousin the PR39MF22NSZ  are miniature 8-pin devices which look for all the world like any other 8-pin chip – but are able to switch mains power at up to 0.9amps – i.e. up to 200w. Seems unbelievable but that’s the claim – sensible you could certainly run a typical mains light.

Given the very small size of our ESP-01 boards and the equally small size of the mains power supplies I found earlier, these would appear to be an ideal companion. Right now they are marginally more expensive than the cheapest Chinese relays and even very slightly more expensive than some solid state relays – but the size has to make it all worthwhile?

Digikey have the larger one at 1.18 but the postage kills that option – you have to wonder what their marketing people are thinking about – 1.18 for the chip – 12.00 for postage – come on guys – it’ll fit in an envelope!!!

http://www.digikey.co.uk/product-detail/en/PR39MF22NSZF/425-2375-5-ND/720413

The best I’ve seen up to now is £1.97 with free postage here..

http://www.ebay.co.uk/itm/PR39MF51YIPF-Sharp-Relay-Solid-State-/141500293514?pt=UK_BOI_Electrical_Components_Supplies_ET&hash=item20f213218a

I’ve ordered one just to see what size it is – I’m hoping this surface mount version is the same size as the normal DIP… time will tell. If it is at works I could see a board coming on! Here is some more info and a diagram.

ESP8266 GPIO

Has anyone had a go at making a set of macros or defines in C to make the programming of the GPIO pins easier?

(Please note this blog is now very old – for FAR more up to date information, visit http://tech.scargill.net)

For people used to:

setMode(1,OUTPUT);

a cold sweat appears when confronted with

PIN_FUNC_SELECT(PERIPHS_IO_MUX_MTDI_U, FUNC_GPIO12);

And if you’re only dealing with GPIO0 and GPIO2 then that’s not too hard, but we have commands to pull up pins, disable pull up, pull down, disable pull down, set as outputs etc…

Personally I’ve no idea which commands can be used on which pins and outside of GPIO0 and 2 I’m not even sure what commands CAN be used on which pins.

Is anyone aware of a simple concise set of documentation with examples for all the pins? Or has anyone done their own thing which would make life easier for others?

The nearest I’ve been able to find is this

http://g-lab.ca/esp8266ex-gpio-application-programming-interface/

and there are also some snippets of useful info here..

http://www.esp8266.com/viewtopic.php?f=13&t=273

However I’m still not clear in my head what can and cannot be done with each pin.