When we first heard about it a few weeks ago, we knew the ESP8266 UART to WiFi module was a special beast. It was cheap, gave every microcontroller the ability to connect to a WiFi network, and could – possibly – be programmed itself, turning this little module into a complete Internet of Things solution. The only thing preventing the last feature from being realized was the lack of compiler support. This has now changed. The officially unofficial ESP8266 community forums now has a working GCC for the ESP8266.
The ESP8266 most people are getting from China features a Tensilica Xtensa LX3 32-bit SOC clocked at 80 MHz. There’s an SPI flash on the board, containing a few dozen kilobytes of data. Most of this, of course, is the code to run the TCP/IP stack and manage the radio. There are a few k left over – and a few pins – for anyone to add some code and some extended functionality to this module. With the work on GCC for this module, it’ll be just a few days until someone manages to get the most basic project running on this module. By next week, someone will have a video of this module connected to a battery, with a web-enabled blinking LED.
Of course that’s not the only thing this module can do; at less than $5, it will only be a matter of time until sensors are wired in, code written, and a truly affordable IoT sensor platform is created.
If you have a few of these modules sitting around and you’d like to give the new compiler a go, the git is right here.
Whoa, nice. Now that it has GCC, the next step is FCC.
How far-reaching is an FCC certification? If one design gets certified does it cover all boards that use the same layout and components? I ask because I always wonder if modules like this are all coming from the same factory of if there is a slew of knockoffs mixed in.
If the copycat mafia is even able to knockoff chips like this… http://i.imgur.com/ah5aYHx.png
I don’t know that much about it…like you, I suspect it may be tied to the manufacturer. But perhaps it could be tied to an importer…
FCC Certification is tied to a specific product. FCC is only authorized for ITU region 2. Other regions, governments, and countries have their own compliance testing rules and regulations
Sounds good but I’ll still waiting for mine, ordered more than a month ago …
I guess I’m not the only one, seeing how few project are posted related to this piece of kit.
Mine just left customs, it seems as if there was a flood of these that just smacked the vendors and they were running a bit behind.
it’s a greate module. Mine is already there…
You can create a socket connection with the java program SocketTest on my computer running. It works simple as this:
Connect to wifi network: AT+CWJAP=”SSID”,”PASS”
Check if connection: AT+CWJAP?
Check ip adress: AT+CIFSR
Connect to socket AT+CIPSTART=”TCP”,”185.31.192.132″,8001
Send data
AT+CIPSEND=
> SocketTest
I think that nc is easier.
not only easier but cleaner, smaller, faster and more portable.
Awesome! Thanks for sharing. Getting really exciting. There are so many applications for wifi connectivity.
There are already videos of the modules being used to switch LEDs and relays:
https://www.youtube.com/watch?v=l_n_N4wxvr8
And running a minecraft server that can be used to switch an LED from inside the game:
https://www.youtube.com/watch?v=R1zx0xV0pWw
The point of GCC being able to build images for the esp8266 is that you don’t need to connect to it in AT mode, you can write stuff to run directly on the chip – it would only need power
Both of those videos show things running directly on the chip. The first has a demo using the AT mode at the start but after that it shows it running in a standalone mode
Reading a little bit about the chip, it appears to have a bunch of dsp capabilities and also an i2s output. This tiny form factor and low price just demands that I turn it into some kind of wifi-controlled synth :D
“and a truly affordable IoT sensor platform is created.” I don’t think this module was the missing piece. Any other simpler radio module (nrf24L01, RFM12, RFM69 etc) coupled with a gateway makes more sense for sensor platform. This things burns a lot more power when you just want to post some simple data somewhere, it’s not good for coincell powered temperature sensor that works for years. On the other hand, plenty of stuff with permanent power to use it for.
the radio only draws power when it’s on
if it’s periodically updating a remote server with data then the radio only needs to be on for a few seconds every day
If you upload some data to the server, you will have to wait some 50-200ms for a reply, assuming a decent internet connection to the server, during which time you are looking at close to 100mA consumed. Not to mention the transmission.
Compare this to a small module based on a NRF24L01 which consumes 5-6X less in receive and 10X less in TX and gets a confirmation from a gateway in <1ms.
In both cases I exclude any form of unreliable data delivery(UPD or broadcast).
This is why you can make a coin cell powered temperature sensor that has a decent life with one of these modules but not with the ESP8266.
I am not saying other things don't make sense, whatever you do you will require a much larger battery for the same life.
Just checked out your stockie project. Nice to see someone else using the tiny88’s.
You could shave another 10-15c off the cost of the nodes by using plastic instead of the metal battery holders.
http://www.taydaelectronics.com/coin-battery-holder-cr2025-and-cr2032.html
There are ways, indeed. It may be that a smaller micro is enough as well. I started with the ’88 because you can go down to a 44 or higher with megas in the same board area. at the moment the project does not have to be perfectly optimized for cost, but it is just a proof of concept that even making 10 of them they still cost about 3 each.
It would be difficult to power it from a coin cell like you can with a nrf24l01 since it needs 100-200mA when transmitting. Maybe if you add a 4700uF capacitor…
I think there are reasonable workarounds… it all depends on the application. If you set up a system that waits for the sensor to decide it’s time to call home, and have a return message queue waiting for it, this can be implemented to work on a pair of coin cells that will last a very long time. You use the power saving modes of the SoC and you don’t ever have it listen for incoming data; you only wake it up when it has sensor data to push up to the network.
The problem is that you increase the distance and thus the resopnse time. If it is a server, it takes a long time to send a message to it across the country/globe and then have it confirm reception. I would not trust UDP and send the message out there and hope it reaches, I would like something reliable. If we are talking about a local server I don’t see the reason for wifi instead of simpler modules.
I think a CR2032 cell might be able to handle the 200mA current for some ms, but the usage has to be something really occasional. Garage door checker that reports a few times a day – sure. Temperature sensor that reports every 5 minutes, not so much.
What i want from the IoT devices is years of battery life, like a clock for example. Putting tens of modules in your house and expecting to randomly change the battery of each every 3-6 months is too much of a hassle.
Even a good qualty CR2032 like Panasonic won’t do much over 100mA even for a millisecond. TI published a paper on CR2032 current draw with microcontrollers:
http://www.ti.com/lit/wp/swra349/swra349.pdf
The big deal about this chip is that it’s 802.11, fits into an existing network infrastructure, completely self-contained, less than $5 and has range 5x that of an nrf24l01
I agree it’s an impressive chip. Wifi just takes too much power for operation on a coin cell. Even at its lowest power setting the the esp draws about 60ma, while a decent cr2032 can only do 25mA. Cheap no name cr2032s can only sustain around 10mA, so even an nrf module needs a ~30uF cap for brief transmissions at 0dB.
There’s still lots of potential for the esp modules; they’ll just need a larger power source like a couple AA cells or a single LiFePO4.
screw gpio, it has SPI that most likely can be reused after it boots
spi = at least couple of megabytes/s bus = usable beyond wanky led blinky
you could probably even turn one into a network camera :), or thermo vision security camera using flir LEPTON
I am sure soon we’ll get better modules with more flash to store webpages and more GPIO.
If you want to hack together a web camera the best way is to use a router with openwrt and a regular webcam.
Now, here’s a security problem: say you have your encrypted wifi and a bunch of these devices around, simple things like wifi light switches, no display, nothing. But you want to change your home’s wifi password periodically(because of reasons), without using WPS.
What would be a good way to do that to all the devices?
Push the new password to the devices before changing the wifi password?
yes, that could work, assuming your wifi password has not been cracked yet, otherwise the new password will probably be visible.
Use some sort of encryption scheme to push the new wifi password.
Indeed! All traffic can be plaintext, DH + AES = safe seas.
Code it to go into AP mode if it can’t connect to an AP. Then use a phone to connect to the temporary AP to set the password for the AP you want the module to connect to.
First, this would be a big security. Second, I am assuming a scenario where you have tens of these around, so it would be too much waste of time to do that for each.
Why would it be a security issue? AP mode with WPA2 and have the randomly generated password printed on the device somewhere.
Hm, maybe using a time-based one-time password for login?
Would require a realtime clock in every node, though.
Personally, I would run a separate wifi network. Once you have a large number of these types of things deployed security breaches will be inevitable. By isolating them behind a 2nd firewall gives the best of both worlds.
This is what I do now, using extra router since it does not want to connect to my main one. But this does not solve the problem, if that wifi is compromised… what can you do? For now I have MAC based DHCP and bandwidth limiting, but that is not worth it…
Well, you probably have to reprogram them again. It is like changing batteries and is the reason why I do not think that this would be an ideal solution for most of the home automation problems.
i find it curious that you trust these devices LESS than you trust any other devices on your network.
“Once you have a large number of these types of things deployed security breaches will be inevitable”
apparently they will develop some sort of spontaneous group intelligence and rebel against their master
Separate WiFi networks would be my choice, hidden SSID for the IoTs.
You don’t. The effort to have effective security would defeat all the benefits brought by connected devices on the Internet. Just think how cellphones would become unusable if manufacturers forced people to implement at least a decent level of security and behave accordingly.
All mobile OSes are complete crap security-wise because otherwise nobody but a few techies would want to use them, certainly not the average teen constituting their biggest market.
The next logical step in the whole IoT craze is the development of a level of security that does not hinder devices functionality and ease of use. It will likely involve the use of VPNs and possibly the separation between networks for devices and networks for people.
Cool.
WiFi Artnet Node for $5, anybody?
There’s a lot of work to be done.
Right now, as I see there’s only the compiler and blobs. libc is a blob, lwIP is a blob, wireless part is a blob. The first two are quite easy to compile from open source, the last one may get pretty difficult.
lwIP has a _shitload_ of configuration compile-time parameters worth tuning, including ipv6.
Nevertheless, we will see “everything with WiFi” from China, soon.
Retrofit LED lamps with WiFi, RGB LED chains with WiFi, wall outlets with WiFi, toy helicopters with WiFi, (cyber)sex toys with WiFi. Everything that now has an infrared or rf remote control, will soon be controlled by your smartphone.
Maybe on the black market. Probably too expensive to get FCC certification for the silly stuff.
> Everything that now has an infrared or rf remote control,
> will soon be controlled by your smartphone.
Or by your neighbor’s phone. That’s the point.
I really dig the ESP-05 Model (select from dropdown) with the external u.FL Connector in this offer:
http://www.ebay.com/itm/New-ESP8266-Serial-WIFI-Module-Wireless-Transceiver-send-receive-Antenna-board-/231332787963?pt=LH_DefaultDomain_0&var=&hash=item35dc8236fb
http://www.electrodragon.com/product/esp8266-wifi-board-full-ios-smd/
As I said: I dig the u.FL Connector. My Spark Core had u.FL as well.
My main resource is ebay (because of the free shipping and the paypal payment option).
But thanks for the link. I like to know more pages for this kind of stuff.
I bought a couple ESP-05 modules but you can’t update the firmware as the pin to put the chip into firmware update mode isn’t broken out on the module.. Also the firmware they came with was old and it doesn’t support cloud update either. DOH!
Solder very carefully?
“at less than $5”
On Aliexpress they’re now under $4, and under $3 for qty 10.
Come early 2015, you’ll be able to by 2 of these for $5.
I would assume that by early 1015 there will be already a superior version of this device.
you are right that you can then pick up two for the price of one, but I think my money would be then out for a bit more advanced edition of this device (More Capacity, integrated RTC circuit, integrated SD Element for basic webserver functionality, selectable antenna – u.FL as I mentioned above, better dial in functionality – currently it is very basic stuff that was deciphert by someone from a chinese spec PDF)… so yeah, they will get cheaper, of course, but I would love to pay 10$ for a module that is more mature.
I think you mean 2015? B^)
So is the code stored on the spi flash? Does that make the module potentially upgradable if you need more space?
yes and yes.
And yes, having a GCC backend for this we still don’t have decent GCC distribution for the STM8…
This is getting cheap enough for me to consider a longterm idea. I want to attach a garage keyfob to the home network (I’m in a rental and can’t access the control box) so that I can operate it by phone.
http://www.banggood.com/ESP8266-Remote-Serial-Port-WIFI-Transceiver-Wireless-Module-p-947259.html?p=T10119124688201302XC
Still waiting for mine.Free shipping to me.
The future will be cool with these embedded everywhere.
Wifi kettle anyone?
We’ve already got a mini webserver and IRC server running on this from BASIC using a Micromite at forums.propellerpowered.com. These things are silly easy to use once you wrap your head around how to format outgoing data.
How did you turn it into a server? I can connect from the module to a server on my machine, but not the other way around..
I issue this command: AT+CIPSERVER=1,9999 and then try to connect to it using telnet, but it’s connection refused for me..
What about the EMW3162 WiFi Module? Is it better or worse? Has anyone used them? They are over at Seeedstudio.
Can 2 of this module do peer to peer communication without a router in the middle.
Yes. This module may be access point itself.
there is apparently a way to increase the UART speed to 4Mbps.
From http://tomeko.net/other/ESP8266/index.php :
AT+CIOBAUD? //Query
AT+CIOBAUD=115200 //Set
FYI there is a virtual box image of this toolchain too: http://www.esp8266.com/viewtopic.php?f=9&t=430