Low cost wifi module ESP8266

$5 wifi module ESP8266
Some email chatter today among the Aussie forum members about this new module. All very new, not sure if anyone has one yet, several on order and on the way.
Hackaday have covered it http://hackaday.com/2014/08/26/new-chip-alert-the-esp8266-wifi-module-its-5/
More specs here https://nurdspace.nl/ESP8266
Hardware looks like SPI. Software is a work in progress - it seems people are writing code before even getting hold of the module.
I've got one on order (search ESP8266 on ebay). Possible to interface with a Propeller? Or impossible...
Some email chatter today among the Aussie forum members about this new module. All very new, not sure if anyone has one yet, several on order and on the way.
Hackaday have covered it http://hackaday.com/2014/08/26/new-chip-alert-the-esp8266-wifi-module-its-5/
More specs here https://nurdspace.nl/ESP8266
Hardware looks like SPI. Software is a work in progress - it seems people are writing code before even getting hold of the module.
I've got one on order (search ESP8266 on ebay). Possible to interface with a Propeller? Or impossible...
Comments
http://www.seeedstudio.com/depot/WiFi-Serial-Transceiver-Module-w-ESP8266-p-1994.html
very interesting device at that price point.
I have been using the TI CC3000 (I have been producing breakout boards for $24.95, photo attached) with the prop, . Considering the firmware updates that the CC3000 has gone through (a lot) to make it somewhat reliable, I can imagine the ESP8266 may have some growing pains before it or some future iteration is off-the-shelf-functional. But it does look like we will get to the ~$5 WiFI module in the not too distant future.
Nate
Here's some help with the BASIC commands.
AT+RST Reset AT+CWMODE=3 Set as Client and Access Point AT+CWLAP List Access Points AT+CWJAP="ssid","password" Join Access Point AT+CIFSR Display Current Assigned IP Address (Unit it PINGable at this point) AT+CIPMUX=1 Set Single Connection AT+CIPSERVER=1,{port} Open Socket Server (A telnet connection can be opened at the specified port) AT+CIPSEND=0,{number of bytes} >Send number of bytes
I created a simple webserver using one of these this evening for my MMC project.
I double anyone here would have ANY problem converting it over to use Spin using the FullDuplexSerial object.
The biggest tip I can give is don't bother creating proper "HTML" headers. It'll actually cause things not work.
They are a bit power hungry. I had to find a 1amp power supply for my board instead of the 500ma unit I was using.
Jeff
AT+CWLAP +CWLAP:(0,"",0) +CWLAP:(2,"KERUBINHD",-85) +CWLAP:(0,"[URL="http://AP.INDTOW.Dasia.Net"]AP.INDTOW.Dasia.Net[/URL] 704.225.1776",-88) +CWLAP:(3,"Bright",-93) +CWLAP:(4,"rosenet",-74) +CWLAP:(4,"Rosenet_Guest",-75) +CWLAP:(4,"ATTejDGSVS",-80) +CWLAP:(4,"buifamily",-90) +CWLAP:(4,"2WIRE958",-91) +CWLAP:(1,"SKIP53",-91) +CWLAP:(3,"teasea5G",-47) +CWLAP:(4,"Loyola Home",-87) << Red entering his Wifi Passowrd here >> AT+CIFSR 192.168.1.6 AT+CIPSTART="TCP","192.241.248.6",80 OK Linked AT+CIPSEND=7 > GET / SEND OK +IPD,185:<html> <head><title>301 Moved Permanently</title></head> <body bgcolor="white"> <center><h1>301 Moved Permanently</h1></center> <hr><center>nginx/1.5.12</center> </body> </html> OK OK Unlink
Yes, they work perfectly... :-D
Argh. More toys to order.
https://onedrive.live.com/?cid=C4DDF72E6EEA3826&id=C4DDF72E6EEA3826!631
I'm thinking more along the lines of interfacing with the propeller - I'm hoping to incorporate it into my Chicken Coop controller to interface with the Spinneret.
Doc
I can say however, that I'm rather pleased with the idea that I managed to create an entire IRC client in 5k of BASIC.. Beat that Spin!
Jeff
Think I need to just walk away for a spell.
Second: What are the chances this module coupled with a Prop could accept xLights E131 data for a Christmas light controller driving the WS2811 LED strips?
1). Can this module accept incoming udp/ip data packets? (I would be surprised if it couldn't)
2). What is the fastest baud rate/spi speed this module can be set to? This may be a limiting factor in the number of pixels you can drive.
Also, these modules are limited to the 2.4 ghz wifi band. This means you will have interference from other 2.4 ghz devices which will cause periodic "glitches" in your rgb display (I know this from my own personal experience using an rn-xv wifi module).
1) Agreed, it sure should be able to accept udp/ip
2) valid points. I believe I would be looking @ 400kbaud (approx). Living in a rural area, I would mostly be concerned with my own generated interference which I could control to some extent, like my Microwave will pause my printer.
Contact me if you would like to contribute to the document.
BTW, I've contacted the manufacturer about making this document available.
Darn, wouldn't you know it, the very moment I do an English version then they release one! I will still update mine from this though as I have put in the pinout signals and will be adding more.
some english documents.
The datasheet seems to be from the manufacturer - not a community translated one.
ESP8266.com is an active forum for this chip
I have some half-working code, as in I get half of a response from the module, half of the time.
I once got it to list the IP address with this.
Usually, I'll get a response from the AT+RST, and the AT+CWMODE=1, but the AT+CWJAP usually doesn't print out anything.
{ESP8266 } CON _clkmode = xtal1 + pll16x 'Standard clock mode * crystal frequency = 80 MHz _xinfreq = 5_000_000 baud = 115200 RXPIN = 1 TXPIN = 0 var byte buffer[10] OBJ serial : "FullDuplexSerialPlus" term : "FullDuplexSerialPlus" PUB main | i,j serial.start(RXPIN, TXPIN, 00, baud) term.start(31,30,00,115200) waitcnt(clkfreq*4+cnt) term.str(string("Starting Up Terminal",13)) sendCommand(string("AT+RST")) getResponse sendCommand(string("AT+CWMODE=1")) getResponse repeat 5 term.str(string("AT+CWJAP=",34,"SSID",34,",",34,"PASS",34, 13)) sendCommand(string("AT+CWJAP=",34,"SSID",34,",",34,"PASS",34)) getResponse waitcnt(clkfreq+cnt) waitcnt(clkfreq+cnt) sendCommand(string("AT+CIFSR")) getResponse repeat PRI getResponse | i, a repeat a from 0 to 9 buffer[a]:=0 i:= serial.rxtime(5000) repeat while i <> -1 term.tx(i) i:= serial.rxtime(5000) return false PRI sendCommand(strng) | i serial.str(strng) serial.tx(13) 'serial.tx(10) ' not needed
That should be enough, right?
I'm now getting responses from everything but AT+CIFSR.
AT+RST OK ets Jan 8 2 boot mode:(3,6load 0x40100000m 16 tail 12 chksum 12 room 4 loan 3168, room 12 tail 4 chksum e8c60, len 4956, room 4 tail 8 chksum ready AT+CWMOD AT+CWJAP="SSID","PASS" ID","PASS" OK AT+CIFSR
Thanks,
Marcus
Ahh, I didn't see this little note on the bottom of the page stating the following:
command input end use \ r \ n;
I updated my serial repeater to add the ASCII 10 character after the PST sends the 13 character. (BTW, I now know you can hit CTRL-enter to send both CR/LF?)
source: http://blog.electrodragon.com/cloud-updating-your-wi07c-esp8266-now/
Thanks,
Marcus
Now to find some time to test this out
I'm trying to condense the code for the server and client into reusable objects for other projects.
{ESP8266 Wrapper} CON _clkmode = xtal1 + pll16x 'Standard clock mode * crystal frequency = 80 MHz _xinfreq = 5_000_000 rx_pin = 0 tx_pin = 1 mbaud = 115200 OBJ serial : "FullDuplexSerial_2k" term : "FullDuplexSerial_2k" VAR byte buffer[15] PUB main ' Connect to the ESP Module serial.start(tx_pin,rx_pin,%0000,mbaud) term.start(31,30,%0000,115200) waitcnt(clkfreq*4+cnt) serial.rxflush if !checkForConnection term.str(string("Error: Module did not respond")) abort else term.str(string("Module is responding.",13)) SendCommand(@RST, @READY) ' Join the AP str(@CWJAP) tx(34) str(string("SSID")) tx(34) tx(",") tx(34) str(string("PASSWD")) tx(34) tx(13) tx(10) lookForSuccess(@OK) 'str(string("AT+CWJAP?")) 'tx(13) 'tx(10) 'lookForSuccess(@OK) 'str(string("AT+CIFSR")) 'tx(13) 'tx(10) 'lookForSuccess(@OK) ' Setup Multiple Connections str(@CIPMUX) tx("1") tx(13) tx(10) lookForSuccess(@OK) ' Setup the Server str(@CIPSERVER) tx("1") tx(",") str(string("80")) tx(13) tx(10) lookForSuccess(@OK) ' Go to the Main ServerLoop ServerLoop PUB ServerLoop | char, conn repeat char := serial.rx if char <> -1 term.tx(char) if char == "+" serial.rx serial.rx serial.rx serial.rx conn := serial.rx if conn <> "L" 'lookForSuccess(@OK) serial.rxflush str(@CIPSEND) tx(conn) tx(",") dec(strsize(@HTML)) tx(13) tx(10) waitForPrompt str(@HTML) lookForSuccess(@OK) waitcnt(clkfreq/2+cnt) str(@CIPCLOSE) tx(conn) tx(13) tx(10) PUB SendCommand(strr,end) str(strr) tx(13) tx(10) if lookForSuccess(end) return true return false PUB waitForPrompt | i repeat i := serial.rxtime(5000) term.tx(i) if i == -1 term.str(string("Timed Out")) return false if i == ">" return true PRI str(strin) term.str(strin) serial.str(strin) PRI tx(char) term.tx(char) serial.tx(char) PRI dec(amt) term.dec(amt) serial.dec(amt) PRI lookForSuccess(end) | char, tmp, bufferpos bufferpos := 0 repeat char := serial.rxtime(5000) if char == -1 quit term.tx(char) ' Add to the listen buffer if bufferpos == strsize(end)-1 repeat tmp from 0 to strsize(end)-1 buffer[tmp] := buffer[tmp+1] buffer[bufferpos] := char buffer[strsize(end)]:=0 else buffer[bufferpos++]:=char if strcomp(@buffer, end) return true return false PRI checkForConnection return SendCommand(@AT,@OK) DAT HTML byte "HTTP/1.0 200 OK",13,10,13,10,"<body style=",34,"background:red;",34,">",0 OK byte "OK",13,10,0 READY byte "ready",13,10,0 nochange byte "no change", 13,10,0 ' Simple Commands AT byte "AT",0 ' Check whether the module is there or not RST byte "AT+RST",0 ' Restart the Module CWLAP byte "AT+CWLAP",0 ' List nearby APs CWQAP byte "AT+CWQAP",0 ' Disconnect from the current AP CIPSTATUS byte "AT+CIPSTATUS",0 ' Display current connection status CIFSR byte "AT+CIFSR", 0 ' Display the IP address ' Complex Commands CWMODE byte "AT+CWMODE=",0 ' Set the Wifi mode CWJAP byte "AT+CWJAP=",0 ' Join the AP CWSAP byte "AT+CWSAP=",0 ' Set Parameters of AP (Not usually necessary) CIPMUX byte "AT+CIPMUX=",0 ' Setup Single or Multiple Connections CIPSTART byte "AT+CIPSTART=",0 ' Setup TCP or UDP Connection 1)single connection (+CIPMUX=0) AT+CIPSTART= <type>,<addr>,<port>; 2) multiple connection (+CIPMUX=1) AT+CIPSTART= <id><type>,<addr>, <port> CIPSEND byte "AT+CIPSEND=",0 ' Send data on TCP or UDP Connection 1)single connection(+CIPMUX=0) AT+CIPSEND=<length>; 2) multiple connection (+CIPMUX=1) AT+CIPSEND= <id>,<length> CIPCLOSE byte "AT+CIPCLOSE=",0 ' Close the specified connection AT+CIPCLOSE=<id> or AT+CIPCLOSE CIPSERVER byte "AT+CIPSERVER=",0 ' Setup a listening server of the specified port AT+ CIPSERVER= <mode>[,<port> ]
Hey localroger,
Can you share your method for sending UDP packets? I would find that rather useful.
Thanks,
Marcus
What connections other than TXD, RXD, 3v3 and GND did you use? ie were connections to RST and/or CH_PD required?
Is TXD an input on the ESP8266 board? ie it is the data to be sent over wifi (or the data received and sent to the prop/etc)
Must get this going
UTXD is the output to the Prop, URXD is the input from the Prop.
There is currently no "transparent" mode with these modules. I'm making progress with a high level object to get the basic functionality available on the Prop, but it's been a very difficult process. The communications protocol implemented in the module is very kludgy from a programmatic view. It seems to be mainly designed for a human user. And there is no "API" that I know of
Currently I'm having an issue connecting to an AP. Sometimes it will succeed with an "OK", other times it will fail with a "FAIL", and still other times it will just restart itself in the process.
I am not seeing this unit as a viable solution to any reliable non-trivial wireless network system.
Thanks,
Marcus
I'll post more details Monday, as I left it all at work a couple of hours ago. I'm knocking together some functions to sensibly deal with the echo and manage return messages and I'll put that up too.
For hookup, I just have CH_PD jumped to 3v3 other than TX, RX, 3v3, and GND. TXD on the ESP8266 is transmit FROM The ESP8266 to RX on another device. It's very easy to set up with a PropPlug since the plug is so well labeled.
P.S. Marcus, where did you get your modules? My 9600 baud units have been extremely reliable; I've set two of them up and never had a failed message or network connect. UDP even recovers gracefully when the router is power cycled. (I suspect UDP might be more reliable than TCP for a lot of reasons, which is why I use it.)