I'd like to start a forum Discussion on using the ESP8266. I was able to create a simple http server with it using the Mega (for extra serial ports), and I had to make sure it had its own 3.3V power supply. I created a github repo that has the source code, and will follow with some diagrams to show how it was connected.: https://github.com/Paulware/ESP8266
What is the ESP8266? Have a link to a datasheet or other info?
Datasheets for the ESP8266 are quite poor, but basically it's a microcontroller with WiFi with default firmware that will respond to "AT" style commands over serial. Modules are cheap ($5) and the range is fantastic -- hundreds of meters -- and of course that can be improved with better antennas.
I recently bought a couple from here, but not had a chance to try as yet. Scroll down the page for links to tech info,
I added a UDP example: https://github.com/Paulware/ESP8266. It is written for the mega since the ESP8166 needs commands over a fast serial port.
Basic theory of UDP operation: ESP8266 logs onto your local network (it will need SSID and password) Android device also logs on to local network and sends out a UDP broadcast (to 192.168.0.255 for example). The message is "findkey" where key is a unique name of the device (i.e. garageDoor).
All other ESP8266 on the local network will receive this message but only the unit with the matching key will respond. This matching unit will respond: "CTS" (clear to send) to the android device.
When the android device receives this message it now also has the ip address of the device. All further commands will be point to point from the android device to the specific ip address of the specific ESP8266 unit with the matching key.
The unit can now process and respond to commands, like "open" or "readTemp".
In the ESP8266UDP directory is also a udpServer.py file which can be used to simulate and android device (if you don't yet have one - The Kyocera Event can be purchased at Best Buy for $40) to command the ESP8266.
Also, in this directory is an Android project written in .java/Eclipse which demonstrates basic connectivity. You can use this project as a skeleton to create your own Android App.
I added a schematic and gerber .zip files for a shield. It has not yet been verified, and I will not probably order it for a few weeks, but feel free to use it for your own purposes.
I added the testing android app in the google play store as a free app, the name is: ESP8266 UDP COMMANDER
Thanks alot for the demo files, I will try them as soon as I receive my radino WiFi.
did you hear about radino? They already merged the ESP8266 and an Arduino Micro into one single module. (www.radino.cc) and the whole thing runs on 3.3V.
They also provide a Arduino-support package on their website, e.g. containing a simple webserver example for the ESP8266. Maybe this will help someone with their first steps on ESP8266.
Radino looks good, this will be a DIY version at a fraction of the cost.
I just found out there is an AT+CIOBAUD command which allows you to change the baud rate. This will change the pcb design because previous posts I had read on this subject assumed a baud rate of 115200. This forced me to connect D0 (Arduino RX) to ESP8266 TX (using a transistor) and D1 (Arduino Tx) to ESP8266 Rx (using a transistor).
But now with the reduced baud rate we can use softserial to connect to ESP8266 rx/tx and save standard serial (D0,D1) for debugging. I think this will make the final solution much more user friendly.
The Electrodragon Wiki on the ESP8266 mentions that the ability to change the baud rate is firmware dependent. FYI, YMMV, etc.
Another interesting thing:
A new firmvare acting like a LUA interpreter. It makes it very easy to make for example a webserver on the ESP8266 itself. And that is by the way the only way I have had any succes with this board.
That link doesn’t work. I initialize my ESP8266 as a UDP server. I’ll post a video soon
The esp8266 forum has been restructered
The LUA implementation is here:
I have tried to use the LUA webserver with an ATtiny85. The t85 does all the sensor reading and sends it to the esp8266 via seriel. It works very well and very covenient because the t85 can run on the same 3.3V as the esp8266.
There is still a problem with the RAM usage but working on it @Paulware Which firmware do you use on the esp8266 ?
I don't modify the firmware on the esp8266, I just use them as I get them from the vendor. I believe that vendors ship them with firmware that allows them to respond to AT commands.
I created an Arduino program to store the SSID/Password in EEPROM on the atmega. That way other users can use it without needing to change the source code. My Arduino program allows me to set the SSID and password for my home network. by typing in the Serial monitor: ssid mySSID, where mySSID is the ssid of my home router. My Arduino program also allows me to set the password by typing in the Serial monitor: password myPassword, where myPassword is the password on your home router.
The first step when I get an ESP8266 is to determine what baud rate the device is set to. I do this by sending "AT" commands at various baud rates until it responds with "OK". Once it responds with "OK", I know I have the correct baud rate, and I will be able to set its parameters. First I set the baud rate to 19200. Then I set the other parameters to configure it as a UDP server. At that point I will be able to use it to fulfill a variety of functions such as a motor controller or a sensor. After setting the baud rate, I also set:
AT+CWMODE=3 AT+CIPMUX=1 AT+CIPSERVER=1,3333 AT+CIPSTO=120
once this is done, the esp8266 will get an ip address assigned by my home router and listen to port 3333 for a command. In this manner it can be used as a sensor or a device controller.
Here is a video of a rc car commanded by an android device, using the esp8266 http://youtu.be/Go8Tyr9nKlo
Coming late to the party....
I now have 3 of these, and I have downloaded and installed the sdk etc into a Linux VM etc.
But I find the documentation is really thin on the ground and I'm not sure how I even upload the results of the SDK compile into the device.
Are there any good tutorials about how you upload things like the LUA binaries. And also compiling modified versions of the main source code.
I,e I'd like a version that has a lower default baud rate, as I'd need to use software serial, so 115200 is too fast.
I also think that this, thread is would be better off in the Microcontrollers section, as this device is a fully fledged Microcontroller as it supports SPI, etc.
I think it would get more exposure if it was moved.
My ESP8266's came with a 9600bps default speed (which took me a while to find!) and firmware that supports a new "AT+CIOBAUD" command for permanently changing the speed, as described here: http://www.electrodragon.com/w/Wi07c#Updates
I'm also a bit frustrated by the state of the documentation (and I guess the implementation as well.) It feels ... primitive. Not that that's necessarily bad, since my general impression of most wireless modules is that they're horribly over-specified and bloated. It will be interesting to see what happens.
Mine came working at 115200, but I udpated to the newer firmware just now and it seems OK
However one thing that went very wrong was the CPUpdate command, it ended up spitting out reems of jibberish characters and the only way to reset it seemed to be to upload the firmware again
I have installed a VM with Lununtu preconfigued with the toolchain and SDK, but I'm not entirely sure where to start writing my own firmware, as information is thin on the ground.
If I understand it correctly, It seems that its possible to upload the system software separately from the application software.
The builds that I did in the VM using the SDK example, seems to generate 2 files, both of which, (I think) need to be uploaded.
However I've not got as far as that yet
Are there any good tutorials about how you upload things like the LUA binaries.
This is how I did it:
Grab the binari here
Upload to the esp8266 (GPI00 connected to ground),
Rx/tx connected to a 3.3V FTDI serial/usb converter
I used ESP Flash Download Tool, see the picture
A Lua webserver rtunning on the Esp8266 (Thanks to gerardwr from esp8266.com)
if(t==nil) then t=12 end srv=net.createServer(net.TCP) srv:listen(80,function(conn) conn:on("receive",function(conn,payload) print(payload) conn:send("HTTP/1.1 200 OK\n\n") conn:send("") conn:send("
Erni's ESP8266") conn:send("TEMP : " .. t .. " ") conn:send("NODE.HEAP : " .. node.heap() .. " ") conn:send("TMR.NOW : " .. tmr.now() .. " ") conn:send("") conn:on("sent",function(conn) conn:close() end) end) end)
The idea is to test an update of the variable t, that is shown in the page. I do this from an ATtiny 85 via Serial:
FYI There are lots of info on the ESP8266 forum: http://www.esp8266.com/ Among other things a new SDK released friday