A new ESP8266 Day

ESP-01Updated mid-afternoon: Got up this morning to see I had a new email from Espressif – with a set of test files for me to try. I eagerly loaded them up, set up the access point and… it seemed to work – I started and stopped and started and stopped the App over and over, no problem.. I was getting excited and then…. “busy s…”. I changed my timeout to 2 seconds and ok, the timeout still occurs, BUT (fingers crossed, touch wood etc) up to now the NETIO App seems to recover gracefully… in other words, I can now create the “busy s…” condition.. but I can’t absolutely kill the app – yet.   Espressif are aware of this and as I was replying anyway, I’ve asked them if they can change that pesky “no is fun” message to “Error” or something sensible. So it MAY BE that the AT command set is useful after all. Right now it’s the only thing that I can fall back on.

Meanwhile my temperature monitor test rig was still working fine – it looked rock solid (aside from the fact that as an ESP-01 user with no DHT-22 temperature chips handy I can’t actually DO anything with it). I noticed a Skype message from a pal who had trouble setting it up, he’d had to revert to other software to define the IP address so I thought I’d just check using a virgin ESP-01.

You know when something is working and you REALLY don’t want to disconnect it.. well, that’s me. Anyway… I blew the firmware into the virgin board. The light came on… and… it turns out the three boards I have already have the IP address setup from initially testing them – so I can’t progress that for now – they all work. In the process I noted the ORIGINAL HTTP server before Martin modified it – controls GPIO2 – which is what I actually want for test purposes (recall that on the ESP-01, GPIO2 is the only pin you actually have easy access to unless you want to solder onto the actual chip – and I don’t want to push my luck, though another pal managed it last night).

The source code for the original HTTP server is here. The only problem with THAT is… no binaries! (However if you look at the comments you will see that reader Jim has sent the link for the binaries). The actual repository is here. People looking in who have cracked this will wonder what the fuss is about – but I have been utterly unable, up to now to set up a working compile rig that generates usable binaries. I’m a Windows user with LOTS of knowledge of programming and almost no knowledge of (or interest in) Linux and for once it’s biting me.  It certainly would be worthwhile getting a setup to edit and compile this code. Here’s what I’d like to do… after getting it to work reliably, I’d like to make that one pin programmable via the web interface to be an input for various temperature reading units, OR an output for a LED OR an output for serial LEDs, hence making it possible to control a whole batch of serial LEDs from the one pin.

That of course is just the beginning, the next stage would be to understand how to fire commands to the web page as parameters and have it fire stuff back in the form usable by the likes of NETIO which then turns it into a regular client for NETIO – which means instant Android Apps… but with that added advantage of the web page setup.

Looking for info here, anyone got this code compiling under Windows? Do you want to send some instructions?

HOWEVER – I have to say that the web server software has a MAJOR bug… unless your board has already been used with other firmware and has an IP address, it won’t see a list of routers – which kind of defeats the object..  I could not see any of my routers when this board was acting as a router itself… and there is no manual option.  I wrote to Jeroen who wrote the software – his response..

Unfortunately, that’s a known issue I haven’t had the chance to take a look at yet. For now, you should be able top join a network using the AT firmware, then reflash the httpd stuff.
Cheers,
Jeroen

So while this has great promise – for now, no – again unless someone wants to get in there and fix it and has the necessary knowledge and skill. If you do – Please DO let us know in here.  Jeroen says he will have a go at fixing this – and post updates here – I suggest that link is worth checking as that little web server has great potential….

I was just thinking of some other applications for this web server when I noted an article on solar panels. Someone had put together an Arduino solar panel tracker… and it occurred to me that this board if initially setup as as web client could go get the time from a time server before becoming a web server… and armed with that could do all sorts of things – for example, the one output pin could be used as a pulse width controller to a servo and hence depending on the time of day, point the solar panel at the sun. With just one more input pin it could also measure solar panel output and graph all of that on one of it’s web pages – all for a mere £3. Add a simple, cheap lithium battery charger that would run off the solar panel and one cheap lithium rechargeable….   So many possibilities…

Advertisements

10 thoughts on “A new ESP8266 Day

  1. I need to clarify… both versions of the web server seem to have an issue if the board does not already know about your router. So I grabbed the original web server binaries and the board powered up, no-where to be found. As per the documentation, the board became a router – I hooked my Samsung phone into it and went to the right page – magic – a lovely sign on page…. but when I went to the page that should show you my routers….. it said “scanning” and nothing was there…. it just sat there saying “scanning”. I put the board on my serial line so I could see what was happening – and there is a fatal exception in there. Here’s some of the output…

    Ready
    mode : softAP(1a:fe:34:98:e3:30)
    add if1
    dhcp server start:(ip:192.168.4.1,mask:255.255.255.0,gw:192.168.4.1)
    bcn 100
    add 1
    aid 1
    pm close 0 0 0/309439
    station: cc:3a:61:44:e3:bd join, AID = 1
    Con req, conn=0x3fff3eb0, pool slot 0
    URL = /wifi/wifiscan.cgi
    Is url index 7
    Fatal exception (28):
    epc1=0x402411a9, epc2=0x00000000, epc3=0x00000000, excvaddr=0x000000aa, depc=0x00000000

    ets Jan 8 2013,rst cause:4, boot mode:(3,7)

    wdt reset
    load 0x40100000, len 25492, room 16
    tail 4
    chksum 0xea
    load 0x3ffe8000, len 2784, room 4
    tail 12
    chksum 0xa7
    ho 0 tail 12 room 4
    load 0x3ffe8ae0, len 5188, room 12
    tail 8
    chksum 0x7d
    csum 0x7d
    Httpd init, conn=0x3ffea198

  2. Sounds like a bit of good luck there with the busy update ….. if you would care to share, I could give them a bash with my setup, web xml and Netio. Promising at last. Just been looking at the Ackme AMW006. eval board and module coming – mouser.com. ok. not as cheap, but lowest cost modules I’ve seen so far.

  3. Hi, I am glad to see that you are still pursuing this busy s… pain in the a$$. I hope that your persistence with Espressif pays off soon. I am implementing this in some projects and this error keeps popping up here and there and it truly is a pain. Keeping my fingers crossed….

    • Hi Jimbo – nice to see you in here and yes I am keeping on top of this.. I’ve just had some test code today and though the message still appears, I’m not entirely sure what they’ve done yet, but it very quickly recovers, so much so that my NETIO stuff handles it (I’ll clarify that – up to now, there have been many disappointments with the ESP-01 as you’ll know)… my conversations with them ended a while ago – I have NO IDEA what time China do so they may well have gone to bed now. The code I’m playing with works, it has some silly control characters appearing at power up and reset but other than that it does look like a step forward. I’ve also asked them if they’ll get shot of that “no is fun” message. I’m sure we’d all be happier with “ERROR” 🙂 Hopefully we’ll resolve this and we can all get on with doing something useful with the board.

  4. O.K. loaded up, and adjusted down to 115K again. Pretty sweet so far. Out of range, and back in.. no prob. I’ve got an up counter being sent, variable a/d being requested at 330mS intervals, two sliders and switch back. Going potty with them would normally give me my reset refresh, ( I took that out..) and still no issues. Interesting scoping the Tx and Rx …. far less synchronous somehow. Couldn’t use my reset technique anyway. It’s looking like a definite positive step.
    I’ll check out the web page format next, lots of communication data there.

    Have to thank you for getting something done …. mine requests fell on deaf ears….

  5. Ok. put some breaks in the assembly code in the cipsend. In the command, in the data etc. Sure, it didn’t complete the required data response, but neither did it halt anything. Letting it jump through the code, then run normally, then back to breaks, held up well. Certainly far more impressive than anything else so far. Sure there will need to be more in the way of fixed ip’s etc, but nice there is a more solid base to move on from.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s