Friday Morning ESP8266

div class=”mycode” style=”color:blue; margin-left: 40px;”>

ESP8266This morning I saw a note from a Mr Steve Brown who pointed out this link for a little add-on board for the ESP-01. Our friends in America might be interested at $1.59 but sadly for the rest of the world the postage kills this one – $13+ to the UK – what WERE they thinking? I think this suffers in a couple of ways, firstly I don’t understand why 2 boards and also while it’s great to see a meaty 800ma regulator, there isn’t enough copper to let you run that at 800ma unless the input voltage is quite low..  what I would REALLY like to see is a low cost motherboard that contains a 3v3 regulator and level shifters on serial in and reset so that the ESP-01 board becomes usable on 5v systems without bodging. A little further down the line I can see a session with EAGLE PCB coming on.

10:38AM – Updates for you: Nothing new on the Frankenstein front, I asked Espressif about Windows based development and they just sent me a one-liner pointing me to the VM version – which unless you’re a Linux hack is a real nightmare and throws out error messages which mean nothing to most of us. As for the original web server, nothing new there to report, it’s still not picking up routers. 

On the LUA front – this wonderful high level language is coming along, the board will now perform trivial tasks like adding two numbers together – however the example of running a Telnet session falls over immediately and the web page example resets the ESP-01 board after 5 or 6 retries… so we’ve a little way to go.  He’s even put up a new version of the Telnet code and that won’t even load in without killing the interpreter.

However the latest attempt at a web server DOES work. Here’s the code – I loaded it in – pointed a web browser to it and it does work. Someone more advanced with LUA might want to offer a suggestion as to how to alter this so it ONLY returns any GET information – and only once as browsers tend to send several attempts..

srv=net.createServer(net.TCP)
srv:listen(80,function(conn)
conn:on(“receive”,function(conn,payload)
   print(payload) print(node.heap())
   conn:send(“<h1> Hello there</h1>This is a test”)
   end)
conn:on(“sent”,function(conn) conn:close() end)
end)

 

No other updates for that this morning and I did write into here to detail what’s going wrong with the LUA code. I’m hoping we might see a fix over the weekend – but that’s just a hope. I guess what really excites me about the LUA option is the possibility to develop code for the board without having to worry about that whole convoluted compile/link/Linux/GCC process – maybe I’m dreaming…

I think part of the problem is that some of the developers, Expressif etc are Chinese and while that’s not a problem in itself it is really hard for some of us to get a dialog going with them – I get very short answers from Espressif and get the distinct feeling no-one understands my emails – though they are trying to improve the firmware.

Daver Allan's hacked ESP-01Hacks: A friend of mine, Dave Allan (who has been helping me with testing) has been working on hacking the ESP-01 to get back some valuable pins – oh yes, you can!! Mind you we’re talking accurate soldering but if you’re desperate for some I/O, just to prove it can be done.. here’s the picture. Please DON’T write in if you burn up your board!

When I find out more – I’ll be sure to write in here. For now… it’s winter in the UK and one of my little radio boards which controls the heating has given up and died. I was hoping by now to have a WIFI alternative – but I think we’re a little way off that. Time to get the soldering iron out (elsewhere on this blogsite I have details my home control efforts spanning quite some time now).

08:54AM – Got some feedback this morning indicating that there is a new tool (Python) for uploading scripts to the LUA interpreter… not used it as I find Cool Terminal does that easily for me – but it’s probably worth making a note of for those of you for whatever reason can’t or don’t want to use the latter.

Just to be clear on the pins – a zoom below..

Pete.

Comments from Dave:   For those of you with good soldering skills and a steady hand I’ve developed a system to give you 4 extra gpio pins that are on a firm socket rather than hanging wires off the pins. It consists of removing the existing pins (pcb), replacing the 2 rows of 4 pins with 2 rows of 7 pins. Remove the 5th pin on both rows and solder the 2 rows in with the extra pins to the left.
Next solder fine wire from these extra pins to pins 9,10,12,13.

The extra pins are GPIO14, GPIO12, GPIO13 and GPIO15.

You can now plug this into a 14 pin IDC socket or any other of your choosing.

See the attached photo.

I accept no responsibility for your lack of skill if you screw the board 😆

Zoomed ESP-01

Advertisements

ESP8266 Current State of Affairs

As the weekend begins, here’s where we are as far as I can tell with the ESP8266 WIFI board. The LUA-based software I refer to elsewhere is showing promise. I could not get the web client to work (first thing I tried) but I’ll try again this weekend. I have questions.. Why only 9600 baud, how much space is available for programs in there, how much space for variables?  I’d be happy to put a board together to expose the remaining pins on a 0.1” header if I thought this was viable.  Then there is the “Frankenstein” firmware also referred to in another blog item here. I get all manner of strange control characters appearing when I use that (as well as valid data) and I can’t get it to connect to my routers. I’ve commented twice but the author either isn’t getting my comments or figures I’m too thick to respond to. And then there is the original v9.2.2 software from the designers. That is the ONLY software to date that to my knowledge actually works, BARRING the “busy…s” problem, which may or may not be less prevalent at really high speeds but really does need fixing – and of course, “Chinglish” messages like “no is fun” etc.

So with the original software I can make a simple on-off light app but I would not want to rely on it – using a simple TCP socket. With the other two sets of firmware I’m not yet able to make a decent application. It’s so frustrating as the little boards have so much potential (not to mention any boards we may make ourselves). I have a Windows-based compile setup but the last part of it will not work – I finally figured out that you have to set the path THEN open a DOSBOX… and so now my computer knows about the ESPTOOL but..

Before I twigged..

Dodgy ESPTOOL

And now..

ESPTOOL SAYS NO

I’m hoping the weekend brings more improvements and will report back if I spot any. Meanwhile if anyone has any idea what’s wrong with the above image… do let me know.

Logging the Internet of Things

Updated 18/9/2014: I’ve been making gadgets for “the Internet of Things” since before the phrase was invented.. one of the issues I’ve always had was displaying data. Oh sure you  can set up a website and talk to it but now you have to maintain that site etc and one-man-band graphics are rarely up with the best.

I’ve been looking lately at services that will consume data from my gadgets and display it on mobile phones, PC, laptop etc.

Oh sure you could also send the data serially to your PC and use the power of that machine to process it – but ideally one would want to have each gadget send regular updates all on it’s own. And thanks to the services appearing out there and Arduino – now you can.

This is where I’m up to – having dismissed several blind alleys…(and thanks to all of you for the feedback).

So I have a controller in the house that talks to various sub-controllers – collates the information and makes it available to me on my phone – temperature, humidity etc and lets me control lights etc… what’s missing is logging – the chips I use don’t have a lot of storage and getting that out onto the Internet at speed would not be trivial even if they did – and I can’t be leaving the phone on 24/7 to log stuff – so instead I’ve been looking for services whereby I can send data out at regular intervals, a small package at a time – and have some server somewhere process that data.

For my first stop we’ll look at Grovestreams – https://www.grovestreams.com

Here you use a simple Ethernet client on the Arduino or similar and send a PUT request with some data – seriously – a simple command-line job on a PC which is hardly more complicated on an embedded machine. I send data every 10 minutes on internal, external temperatures and overall humidity from our home in Spain. Been doing that for weeks now. The result?

tmp86C8

As you can see, it’s all been operating flawlessly since the back end of August – when we left it was dry and very hot – today the humidity is a lot higher (green), internal temperatures slowly falling and external temperatures going as low as 14c.  All of that on a free service (as long as you don’t overdo it – check their site for cost details).

What’s nice is the web-based zoom – see the last couple of days above – and the sliders the bottom of the image.. Also they handle the averaging and there are tons of options.

tmp25C6

Neat – so next I tried Carriots – https://cpanel.carriots.com  and this has a free option – I’ve yet to get that working but the day I asked for help they came straight back to confirm they’d tried my code and it works – so I’m sure it’s something minor – more on that later but the site is worth a look.

Right now I’m playing with http://dweet.io and http://freeboard.io

So Dweet is a service that again your micro can call directly without major overhead – it will store your data for up to a day and is an intermediate service. Freeboard consumes that data and…..

tmp8B5C

So this is not in the same league as Grovestreams BUT it’s a dashboard… imagine you had a bunch of gadgets all connected to the Internet and you wanted to see data from them all on one screen – if that’s the case then Freeboard and Carriots might be for you.

And now onto EXOSITES (www.exosites.com) – they have a very nice interface – when I originally wrote this article I was having lots of problems connecting to them – their examples for Arduino used STRINGS which I’ve never trusted (it is SAID that in Arduino string library for 1.5 (beta) they are improved but for now I’m sticking with the official release) and their examples would not send data to their server reliably.  I wrote to technical support – who agreed with me about strings – and they’d also made available a version using character arrays to send string data. I tried that, it still didn’t work – however I have to say after a series of email conversations, last night they put up a version of their code that works! It has the STRANGEST issue in that sending data to them fails every 100th attempt – at this point I’ve no idea if it is their end or mine but I’m more than happy with the technical support up to now and I’ve just sent the entire evening’s logs off to them to look at – with absolutely reliable failure every 100th send… here’s the current library. https://github.com/exosite-garage/arduino_exosite_library

So – what do you do and what do you get with Exosites-  they provide a REALLY simple to use library – basically you have a KEY  – and you send data sets along the lines of X=Y – that’s it really. A mere few lines of simple code – it’s all done in the library. It’s fast and efficient and you get back a copy of what you sent for confirmation!

tmpE5DD

The graphs are not in the same league as Grovestreams nor is the control – BUT there again they don’t put a limit on the amount of data in the free account and the dashboard is nice – and works on mobile phones and tablets – you’ll need to decide for yourself what is best for you. Right now I have high hopes that last tiny niggle of data failing will be resolved and I’ll be more than happy with this.

More as I go on. Someone suggested this morning I take a look at PLOTLY.. at first sight I could not make head nor tail of this – it’s in BETA and no-where near as simple or straightforward as above – but you might want to take a look. https://plot.ly

Oh, along the way, another kind co-respondent pointed out that one of my images (I think Freeboards) uses something called high-charts… now, if you need charts for personal use – this looks THE BUSINESS – http://www.highcharts.com/products/highcharts I had a quick look at you download the library with a TON of examples.. and they really look GOOD. Indeed – all I needed was for some kind soul to put Highcharts together with an Arduino – and SD card.. and VOILA.. http://everettsprojects.com/2012/12/31/arduino-super-graphing-data-logger/  I MUST STRESS I have not tested this (give it time) – I have the sketch in front of me – it looks reasonable – but that doesn’t mean it will work.

Pete.