An SDK For The ESP8266 WiFi Chip

The ESP8266 is a chip that turned a lot of heads recently, stuffing a WiFi radio, TCP/IP stack, and all the required bits to get a microcontroller on the Internet into a tiny, $5 module. It’s an interesting chip, not only because it’s a UART to WiFi module, allowing nearly anything to get on the Internet for $5, but because there’s a user-programmable microcontroller in this board. If only we had an SDK or a few libraries…

The ESP8266 SDK is finally here. A complete SDK for the ESP8266 was just posted to the Expressif forums, along with a VirtualBox image with Ubuntu that includes GCC for the LX106 core used in this module.

Included in the SDK are sources for an SSL, JSON, and lwIP library, making this a solution for pretty much everything you would need to do with an Internet of Things thing. As far as LX106 core is concerned, there’s example code for using the spare pins on this board as GPIOs, I2C and SPI busses, and a UART.

This turns the ESP8266 into something much better than a UART to WiFi module; now you can create a Internet of Things thing with just $5 in hardware. We’d love to see some examples, so put those up on hackaday.io and send them in to the tip line.

70 thoughts on “An SDK For The ESP8266 WiFi Chip

  1. I must say that this is a clever move from Espressif ,and a very good news for all hackers!

    By escaping the common industry practice of ignoring small developers and preventing them access to the required information to use their chips by using NDAs, they have a big chance to target the hacker / maker / DYI community and turn their chip into a de facto standard.

      1. >it would still be the cheapest way to get WiFi into a product.

        If you’re going to make an actual product then there are modules with either a cortex m3 or m4 with 256KB or 512KB of RAM (they don’t have internal flash.. they have a ROM bootloader for SPI…) come in at ~$7 in 1000 quantities. If they weren’t under NDA then I would share more details but they come from big names in the wifi chipset market and have very extensive SDKs.

        For hobbyists this is fine but if you’re going to make an IoT product you would put down the few extra bucks to get brand name hardware that can probably implement almost all of the logic for your product.

          1. Its called bullshitting, person A says information cannot be checked because of factor B || person B. Just listen to 8-12 year olds, they do it all the time, its the age when they try to learn to lie, but really suck at it.

          2. He was right about the general price range at least ;). Squonk named the most common, though TI has had its 8051 based solution out for a while now, and now has an ARM based one. Atmel has their ARM based solution coming out any day now.

            I just think the “I know of something but won’t tell anyone” answer should be called out when you see them. They don’t do anyone any real good…

          1. I like the look of those, too. But find it strange only seed has cheap stock (possibly taobao, but google translate isnt good enough for me to figure out how much they’d actually cost and if they’re legit).
            I wonder if they got a bunch of discounted modules or something? They seem to have FCC as far as I can tell.

        1. As well echoing the comment about finding it strange the NDA restricting the company o the model of the chip (come on, spill the beans!) would ‘big bollocks inc’ be willing to sign the NDA and give the SDK to a startup looking to make 1000 internet-thingies?

          1. Ya, have you, because most people haven’t so I can bullshit people forever and they’ll never know, and I look so cooooollll. Then I can dominate the world, and no one can ever find out, (insert evil laugh here_) NDAs are bullshit, and no legitimate designer signs one on a whim, mainly because the companies that are hardcore NDA, are also the ones you don’t want to work with. They most likely are super greedy, paranoid, and downright snobbish assholes, AT&T/Apple comes to mind. For YOUR reference here is a sample NDA, http://www.hbs.edu/entrepreneurship/pdf/Sample_NDA.pdf. If an NDA is issued by a GOOD company, its because they haven’t worked with you before, or your a third party designer, and they don’t want to release information yet. If your a BAD company, its every reason in the paranoid lawyer and MBA book thrown at your face.

        2. I signed no NDA so far, and I am still part of the Free World, so I can freely cite MediatekRalink, Qualcomm/Atheros and Marvell without fear :)

          Besides its price tag, the ESP8266 features one BIG advantage over these other chips: the RF circuit is fully integrated into the chip and requires no factory calibration at all, making its integration dead simple and chip, even if you are not an RF expert and don’t have access to the required expensive test equipment.

        3. “I want to be able to do this really simple thing with wifi” “Ok, here’s this enormous module that’s got tons of horsepower, physically much larger than you would like, requires multiple chips and draws more power”

          Use the right tool for the job. To make a wifi connected tickle-me-elmo, this is the chip.

          1. >Use the right tool for the job. To make a wifi connected tickle-me-elmo, this is the chip.

            I would guess that most IoT products that require wifi connects are a bit more complicated that what you are suggesting. Why would you make something controllable over IP when it’s simple enough to use a IR remote?
            I agree with “using the right tool for the job”. I don’t agree with your “I can only imagine one possible job of limited complexity thus your suggested tool is wrong” argument.

          2. It’s definitely about the right tool for the right job. The IoT is about connecting EVERYTHING to the internet. If you have to add $50 or $100 dollars to the retail pricetag of your kettle, it’s not going to get connected, but for $5? You betcha, my kettle is going to tweet not just whistle!

        1. Those are sold on a “put them through FCC if you like, they’ve got a shield so they might pass” basis.

          ESP-07 in that pic is the only one which would pass as a module as (again, IIRC) the antenna must be integrated. I guess the others are made to be part of a product which would go for FCC as whole.

      2. The one that is FCC or says “FCC” is not don’t be fooled, many talking about it on http://www.esp8266.com you need to have a dedicated regulator on the module for FCC and it needs to either have approved antenna’s on on board antenna and it needs to be labeled with its actually FCC ID #, none of which are present, so therfore… NOT FCC.

        1. Yeah I mentioned that in one of the comments above this one!
          I think the power regulator only needs to be for the radio (which I believe there is one inside of the chip) so it probably wouldn’t need one on the module. I’ve not put a module through FCC though so can only speculate based on what I’ve read.

          1. Be careful about these cheap modules from Schenzhen: they can’t lie on the chip (unless you get a new old stock ESP8266 only vs. ESP8266EX), but you can get reworked SPI Flash chips, and more important: out of spec crystals: these are supposed to be accurate 10 ppm only, but I am sure what you get on these modules are cheaper 50 ppm parts.

  2. If someone could do all the GCC SDK thing for me and release a 10$ ESP2866 Webserver with an SD-Card Slot, that would be great.

    I can install Firmware and get bytes from my server. But having to juggle now with an SDK and the GCC is a bit to much for me yet.

  3. Anyone know of a good guide on how to use the SDK for beginners. I’ve got mine on order and do have an arduino nano to use with it but it would be great to use it without the arduino, I just need to GPIO access.

    1. If you are only making a couple for yourself. It is often cheaper to just add a dunino just for the libraries that you don’t have to port. couple of ££ for a 328p and a slightly bigger board, vs many hours of porting and debugging code.

    2. The whole point for a SDK is to write your own program on the processor. This is why the SDK is the exciting news. As for me, I can do fine with just SDK A detailed programming manual is all I ever need to code my low level libraries.

      If you *only* want to play with “arduinos”, you could already do that like a month ago with the translated Chinese datasheet. Pretty old news on that front.

      The module already has 0.1″ pitched headers, so why bother with shields when those premade “dupont” cables are all one need to hook up 6 wires? Can’t be that lazy?

      1. Why shouldn’t they have a high troughput? The actual die has the ESO8089 marking on it. And that is used in USB-WiFi sticks, tablets, etc.

        There is a second SPI port available as well. So it’s all just a matter of writing the proper firmware for it.

        Greetings,

        Chris

        1. Those are the only benchmarks I’ve seen, It would be interesting if it could get better throughput but I’ve not seen anything to suggest it can.

          Remember that its only an 80Mhz RISC CPU running the whole stack. Usually the driver on the PC handles pretty much everything with those USB sticks.

          1. True, it currently runs at 80 MHz. However, even in the case of the 8089, the data has to be pumped in/out somehow, that is, at least some read/write from the QSPI (in case of the 8089) and the internal RAM. The 8266 runs code internally, but then, it would have no need to push it through an external interface.

            Not saying that it would give the same bandwidth as a 8089 would give, But then, let’s not forget what this chip is intended for: small, cheap stuff that can be hooked up to a WiFi. And now with the SDK officially and freely available, a lot of things don’t even need to be “hooked up” to it anymore (in terms of an external MCU), since it can be done on the chip itself now. Does swithcing some lights, reading a bunch of sensors, etc., require a high bandwidth? Surely not.

            It all comes down to using the right tool for a given task. If someone needs really high bandwidth for whatever purpose, the 8266 is not the right part, since it has a different application intended. That’s like using a USB2.0 ethernet adapter and then wanting to have it make use of the full bandwidth of some gigabit ethernet. Just not the right tool for the task.

            Greetings,

            Chris

  4. Where can I find more hardware info? Like what connections to make to program, any specific problems like locking out etc which I should be aware of? Can this be done with a raspberry pi? I dont have a linux instance handy

  5. Got justtoday two ESP-05 with ESP8266EX.

    But they are not Running with 3V3. with 3V3 they are drawing around 350mA.
    so i was playing a bit around and it’s funny they are running just within the range of 2-2.5V and then drawing with correct boot with an draw of 70mA.

    1. If the module has LEDs, check the resistors on them. I bought a batch of 100 modules on Ali express only to find one of the resistors was 4.2 ohms instead of 4.2k. I’m guessing they’re being dumped rather than reworked.

    1. Very interesting question! I want to use these for a university project, but the wifi only accepts enterprise authentification.
      By hardware (datasheet) it supports Enterprise, but will the current firmware do so?

  6. Never understood why WPA3-OTP hasn’t been developed for IoT devices.
    If the devices don’t have the correct shared onetime pad then commands will do nothing, ensuring total security.

    Updating could be done using a timer so a given device updates once a day at say 12.53:17 depending on its unique key.

  7. Very interested in this! ordered 6 last night, however I have ran into a problem compiling – OS win 8 pro x64/Lubuntu Vm all as suggested above. I used the http://pan.baidu.com/s/1gd3T14n image and followed the instructions on https://drive.google.com/folderview?id=0B5bwBE9A5dBXaExvdDExVFNrUXM&usp=sharing I have followed every step to the letter when it come to compile the program using the “make” command the terminal returns these errors:- esp8266@esp8266-VirtualBox:~/Share/esp_iot_sdk_v0.9.2$ make
    make[1]: Entering directory `/mnt/Share/esp_iot_sdk_v0.9.2/app’
    make: Entering an unknown directory
    make: *** user: No such file or directory. Stop.
    make: Leaving an unknown directory
    make[1]: *** [.subdirs] Error 2
    make[1]: Leaving directory `/mnt/Share/esp_iot_sdk_v0.9.2/app’
    make: *** [.subdirs] Error 2
    esp8266@esp8266-VirtualBox:~/Share/esp_iot_sdk_v0.9.2$

    If anyone could shed some light on where I have gone wrong that would be greatly appreciated,

    Thanks in advance, clevo

      1. Hi Chris and Thanks, it was a shared folders issue fixed now. Now waiting on the boards if you know of some simple projects or even the examples with a good tutorial please feel free to point me to it cheers,

        Clevo

  8. Ok, so I grabbed the virtual machine… set it up – files were in position as in the PDF.
    I ran MAKE – and it said “make: nothing to be done for “FORCE”.
    I then ran ./gen_misc.sh as per the image in the PDF – and that said “bash: ./gen_misc.sh: no such file or directory”.

    Bearing in mind I know zilch about Linux can someone tell me where I went wrong. I grabbed 3 files in total to make the setup.

  9. Since more then a week I try to find if there is aa way to get access to Wifi OSI level 1 information via an Wifi Adaptor or a Wifi Module/Chip via firmware. Anyone willing to share a “guess” if this woudl be possible using the ESP8266 SDK?

Leave a Reply to bobfegCancel reply

Please be kind and respectful to help make the comments section excellent. (Comment Policy)

This site uses Akismet to reduce spam. Learn how your comment data is processed.