ESP8266 Christmas Goodness

Have I been struggling today. We decided a good idea might be to use NETIO on the Android phones, have them talk to a PHP web page – which would then have the power to talk to TCP/IP listeners using ESP-01s and either Lua or the AT command set.. can we HELL get PHP CURL code to talk to NETIO. We can call our PHP page from a browser and it responds…. from NETIO – not a bean – so clearly we’re missing the point here.  if anyone has done this a simple example would be good… PHP page accepting a command from NETIO – and sending a number back would do… once that works we can look at using PHP and sockets to talk to ESP-01 socket listeners – or an ESP-01 web server (I figured the former would produce quicker replies).

On the plus side of the day, new updates for Lua, he’s added support for replacement FLASH chips up to 4 meg!!!  Which sets me wondering – where is the boot code – in the FLASH or in the main chip – so if in the latter could you just simply replace the FLASH chip with a larger one?? Could be good for data logging though I’d like to see a better way to save variables to FLASH…  OH and more LUA goodness – updated today but I’ll just send you over to the Lua website for more information on that.

On the AT command set I’ve spent so much time worrying about timeouts I asked the question about handshaking and if you look in the comments in the previous item you’ll see there is a possibility of using 2 GPIO pins to to this – I’m not sure however if that can be enabled (or even needs to be enabled) from the AT command set or in fact Lua!! If anyone knows the answer to this please comment.  I ALSO note a new SDK – great for some – for those not keen or unable to make use of that with a compiler I guess we’ll have to wait and see how long it takes to get the AT Command set compiled with the new SDK and indeed Lua…. but also as you may have noted one gentleman has implemented an internal serial buffer (you have to wonder why that was not done in the first place) for the AT command set but notes occasional bugs – reading the latest blog on the SDK it appears there are still a couple of unanswered questions – indeed, one of them makes me feel a little happier as I simply could NOT get a TCP listener to talk to 2 phone apps at high speed – looking at the link elsewhere in the blog for the new SDK – it seems that this is known as a problem – I will be looking in regularly for fixes.

So a good start to the Christmas – hopefully we’ll see more updates offering more possibilities with these wonderful boards. My ESP-12 hasn’t turned up yet – when I does I’ll detail it – neither have my interface boards from China which I’ll also detail… got a few days over the Christmas to get stuck into this stuff.

Meanwhile I would like to say, I’m really impressed by the feedback I’ve had recently in this blog and the helpful comments – to all of you who have been in here regularly as well as newcomers… a VERY MERRY CHRISTMAS to you all.

Regards

Pete.

Advertisements

5 thoughts on “ESP8266 Christmas Goodness

  1. Hi Peter, what functionality do you need from the Android control app? NetIO looks very cool, but might be overkill, when a basic mobile webpage could do, at least for proof of concept.

    Merry Christmas to you and your family.

  2. Peter,

    I’m not sure at what point your php is not responding, or what host your php code is running on, but I discovered that php code running on my ISP won’t be invoked unless the GET command includes a recognizable User-Agent: Mozilla/4.0 (compatible… line. Trying without a User-Agent, or with a funny one like ESP8266 did not work and returned a 500 error from Apache. In the end, I use: User-Agent: Mozilla/4.0 (compatible; esp8266 Lua; Windows NT 5.1)\r\n now. May not be your problem, but worth knowing as I tore my non-existent hair out for a while trying to track that quirk down.

    Happy Christmas!

    — Peter

  3. Worth trying – and thank you for that.

    In the meantime we’ve come the conclusion (after hours of back and forth) that the best way forward is a master unit hooked to an Ethernet card, talking to the remote app and sending JSON back and forward from the app – to the master and through to a bunch of TCP/IP slave units – which may be ESP-01 with LUA or ESP-01+Arduino+AT command set – watch this space as I enroll in more self-inflicted disappointment… Hence the PHP side will be restricted to offering a time server (why not use a time server? Because this way I can get lighting up times etc in a JSON package with very little overhead).

  4. geonomad brings up a great point about the HTTP header. To learn the AT library, I’ve been working on some python apps to communicate with the AT version of the ESP8266, and just yesterday I found out I needed to construct a more complete ‘legitimate’ looking HTTP request header before most websites would respond with the desired webpage (instead of a 404 or some sort of error page)

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