10 ms·
ESP8266: A $5 microcontroller with wi-fi that runs Python
- ck2 11y agoSomewhat remotely related, I've been playing with this tiny wifi router on a usb stick for a week now with OpenWRT and it is amazing for $10 https://wiki.hackerspace.pl/projects:zsun-wifi-card-reader https://wiki.hackerspace.pl/projects:zsun-wifi-card-reader The future is filled with tiny wifi devices!
- TeMPOraL 11y agoAnd tinfoil, to isolate yourself from interference from external signals as everyone starts having 20+ Wi-Fi-connected devices in their homes ;). But yeah, I like how cheap wireless is now, it simplifies a lot of things.
- Relys 11y agoI ordered a couple of these as well but GearBest is taking their sweet time shipping...
- ck2 11y agoIt's that Chinese spring holiday I think? Though mine seems to have come from Singapore. Once you get a tracking number you can enter it into this box and see the progress until it gets on a cargo ship: http://113.105.65.70:8032/xflquery.aspx http://113.105.65.70:8032/xflquery.aspx (use chrome translate) The number they give you will also work in DHL tracking system. Mine took 48 hours to ship and then 17-18 days to get here. The tracking stops once it hits the ocean though, blind from there.
- Relys 11y agoThanks for the reply. After a month I ended up canceling my order. I'll just pay a bit extra from Amazon.
- headgasket 11y agocool chip! I can't find the SRAM size, anybody has an idea?https://nurdspace.nl/images/e/e0/ESP8266_Specifications_English.pdf https://nurdspace.nl/images/e/e0/ESP8266_Specifications_Engl... EDIT: 2015 article, maybe put that in the title?
- megous 11y agoVery little, around 60kB free if writing programs in C language.
- david-given 11y agoThat's loads. Seriously, it's a huge amount. Most other comparable microcontrollers have about 2kB. Interestingly, it looks like this is a von Neumann device! Which means that code and data live in the same address space. Memory map here: http://www.esp8266.com/wiki/doku.php?id=esp8266_memory_map http://www.esp8266.com/wiki/doku.php?id=esp8266_memory_map Looks like it's got a whopping great 512kB internal SPI ROM device too, and indications are that it's reprogrammable. You could totally run a unix on this; I've ported Alan Cox's Fuzix to the MSP430, which is substantially lower specced. Without an MMU you probably wouldn't get preemptive task-swapping, but Fuzix runs beautifully in cooperative multitasking mode. You even get the real Bourne shell (written by Bourne) and pipes. http://cowlark.com/2015-10-27-fuzix http://cowlark.com/2015-10-27-fuzix
- coaxial 11y agoHow much you get depends on the version you get. The memory is external and some come with 512kB, some come with 4096kB. cf https://gist.github.com/Coaxial/268c4198d09c2a712387 https://gist.github.com/Coaxial/268c4198d09c2a712387 for flash and RAM for mos (all?) currently available ESP8266 versions
- Solarsail 11y agoVery tangentially related, but: if FRAM on the MSP430 saves its state on power loss, my mind went straight to Smalltalk. It's like hardware support for saving an image. Tho from an efficiency standpoint, smalltalk might be pushing it more than MicroPython is. That, and a smalltalk editor on a machine too small to fit a vi clone might be even more of a stretch. lol.
- yanovskishai 11y agoI advice checking out this tutorial http://www.whatimade.today/esp8266-easiest-way-to-program-so-far/ http://www.whatimade.today/esp8266-easiest-way-to-program-so... I found it very helpful
- thechut 11y agoWhile this is a very cool chip for hobbyists, it is quite hard to do real TLS with this chip making it basically useless for commercial applications. It CAN do TLS but it leaves very little left over if you have any kind of real business logic.
- simcop2387 11y agoTLS is one of the reasons I'm really hopeful for the ESP32 that's supposed to have a good bit of hardware help for doing TLS and such. http://esp32.net/ http://esp32.net/
- robert_foss 11y agoIf you're looking for improved TLS support, have a peek at esp-open-rtos[1], which is a re-implementation of the Espressif provided rtos sdk and is aiming to be fully open source. It ships with the mbed TLS implementation, which supports TLS 1.2. [1] https://github.com/SuperHouse/esp-open-rtos https://github.com/SuperHouse/esp-open-rtos
- icebraining 11y agoAssuming you're talking to your own server (or even mobile app), why not go with something lighter than full TLS?
- ff7f00 11y agoYou can even broadcast analog NTSC with it. http://www.rtl-sdr.com/broadcasting-color-analgoue-ntsc-tv-with-an-esp8266/ http://www.rtl-sdr.com/broadcasting-color-analgoue-ntsc-tv-w...
- kickscondor 11y agoThe ESP also runs Lua (by way of NodeMCU), JavaScript (Smart.js, Espruino and JerryScript), Lisp (https://github.com/yesco/esp-lisp https://github.com/yesco/esp-lisp) and even a form of BASIC (http://www.esp8266basic.com/language-reference.html http://www.esp8266basic.com/language-reference.html). I'm sure more are out there - seems like something new pops up every few days.
- ParanoidShroom 11y agoYup, NodeMCU is really easy. I used it to make a Philipps Hue clone. https://github.com/christophesmet/ledsgetIton https://github.com/christophesmet/ledsgetIton It's surprisingly easy connect to a WiFi and get a TCP server running
- ochoseis 11y agoFWIW - There was a related project front page a few weeks back talking about this: https://news.ycombinator.com/item?id=10899798 https://news.ycombinator.com/item?id=10899798
- deleted 11y ago[deleted]
- robert_foss 11y agoI've personally built hardware[1] and software[2] around the ESP8266 and it is a wonderful little chip. The low price point ($2 including shipping from China) and the very active community around it really makes it stand out. [1] http://memcpy.io/esp8266-apa102-bulb.html http://memcpy.io/esp8266-apa102-bulb.html [2] http://memcpy.io/user-friendly-setup-of-esp8266-gadgets.html http://memcpy.io/user-friendly-setup-of-esp8266-gadgets.html
- ptspts 11y agoFYI ESP8266 doesn't run Python, but it runs MicroPython: https://github.com/micropython/micropython https://github.com/micropython/micropython
- dbcurtis 11y agoI have some experience using MicroPython on the PyBoard (not the ESP8266). MicroPython is a very nice implementation of Python 3.X. A few differences because of the need to be extremely parsimonious with RAM usage -- mostly only noticed if trying to inherit from built-in types. Nothing that is onerous to avoid. MicroPython is an outstandingly good project IMHO, with a great community.
- ntoll 11y agoDamien George, the creator of MicroPython, is an extraordinarily talented individual. He's also extraordinarily generous having volunteered a substantial block of time and effort to get MicroPython running on the upcoming BBC micro:bit (a million of which will be delivered to the UK's 11 & 12 year olds).
- zw123456 11y agoI have actually done a fair bit of dev work on this chip (a custom C++ IDE), it is a neat little device, with the emphasis on little. That is both a plus and a minus. Plus, it is cheap, minus, it is little, not a lot of processing power there. (forget Python if you are doing anything serious). The way I worked around it is put all the processing in the cloud and basically the vpn passes straight through it. Interestingly, it actually is being used in a number of consumer products, but for very basic iot apps (I believe there is a wifi enable light socket and an automobile ODB link device things like that). Fun device to mess with :)
- dbcurtis 11y agoHave you even tried MicroPython on it? Granted, you need to consider performance -- where you need it, and where you don't. But is is quite easy in MicroPython to create a C-extension module for performance critical components, and have the luxury of a Python REPL loop for debugging high-level logic.
- zw123456 11y agoInteresting idea. The client wanted C, but that could make dev work easier perhaps.
- nathancahill 11y agoGreat, but don't say "forget Python if you are doing anything serious", unless you just read the title and not the article. The article pretty clearly talks about MicroPython.
- StavrosK 11y agoThe demos look impressive, I urge everyone to back this project: https://www.kickstarter.com/projects/214379695/micropython-on-the-esp8266-beautifully-easy-iot/?ref=kicktraq https://www.kickstarter.com/projects/214379695/micropython-o...
- donpdonp 11y agoalso note that an upgraded part, the ESP32 is in the works from the same manufacturer. http://makezine.com/2015/12/09/meet-esp32-new-big-brother-to-iot-board-esp8266/ http://makezine.com/2015/12/09/meet-esp32-new-big-brother-to...
- paddi91 11y agoIf you're looking for great projects with the ESP8266 have a look at https://aisler.net/search?query=ESP8266 https://aisler.net/search?query=ESP8266
- ochoseis 11y agoI feel like the title is a misnomer given the article is called "ESP8266: This $5 Microcontroller with Wi-Fi is now Arduino-Compatible," and on that front it's really easy to get started with these [0]! ESP8266 boards abound on AliExpress, the easiest of which to get started with are NodeMCU variants. One example with seemingly good documentation is the Wemos D1 Mini [1] that comes with a USB-to-serial chip onboard. Here's another decent reference I found to getting started with them [2]. [0] GitHub repo for plugging into the Arduino IDE: https://github.com/esp8266/Arduino https://github.com/esp8266/Arduino [1] http://www.wemos.cc/wiki/doku.php?id=en:d1_mini http://www.wemos.cc/wiki/doku.php?id=en:d1_mini [2] http://www.averagemanvsraspberrypi.com/2015/11/esp8266-node-mcu-setup.html http://www.averagemanvsraspberrypi.com/2015/11/esp8266-node-...
- StavrosK 11y agoBy the way, I have to warn people who are thinking about trying this chip (as I have done in other comments): The bare chip won't be very useful to you, unless you want to design your own PCB. Instead, I would recommend a breakout board. There are two major types: Something like the WeMos D1 Mini (http://www.aliexpress.com/item/D1-mini-Mini-NodeMcu-4M-bytes-Lua-WIFI-Internet-of-Things-development-board-based-ESP8266/32529101036.html http://www.aliexpress.com/item/D1-mini-Mini-NodeMcu-4M-bytes...) or NodeMCU (http://www.ebay.com/itm/NodeMCU-LUA-WIFI-Internet-Development-Board-Based-on-ESP8266-/291505733201 http://www.ebay.com/itm/NodeMCU-LUA-WIFI-Internet-Developmen...), which are very full-featured and include onboard USB programmers and fancy things like that, but are a bit bulky. The NodeMCU I linked is solid, the WeMos is also great as it's much smaller and only includes the useful pins. The alternative is a bare breakout board, which is the minimum that you need to make the ESP breadboard-friendly and so you don't have to solder a bunch of resistors on the chip. This is best when you want to work at a lower level, and have the minimum hardware required for the ESP to work on the board, with everything else going in your circuit. There are breakout boards on ebay like this one (http://www.ebay.com/itm/1Set-ESP8266-WiFi-Module-Breakout-Board-Adapter-Plate-for-ESP-07-ESP-08-ESP-12-/181784198861 http://www.ebay.com/itm/1Set-ESP8266-WiFi-Module-Breakout-Bo...). STAY AWAY FROM THESE. They don't include all the necessary components, so the ESP won't work reliably without extra pullups, and they take up the entire breadboard space. Because I was burnt by these, I designed my own and made it open-source: https://github.com/skorokithakis/tiny-ESP8266-breakout https://github.com/skorokithakis/tiny-ESP8266-breakout It's easier to work with, leaves room on the breadboard and includes all necessary resistors/caps and an optional voltage regulator. It's also very small. There's a dirtypcbs link on the github repo so you can just order 40 of these for $14 if you like, or you can just download the KiCad schematics (KiCad is awesome and open-source) and get it fabricated at your favorite PCB house. Back to our regularly scheduled programming. Feel free to copy/paste this comment whenever there's an ESP discussion, I think it's a good primer for people who don't have ESP experience.
- gh02t 11y agoSo I agree that the WeMos Mini is definitely what you should buy, but the bare chips aren't that bad to work with. I've done quite a few and I usually just solder wires to each pad on the chip and then solder the other end(s) to a breadboard (something like this http://www.instructables.com/id/Getting-Started-with-the-ESP8266-ESP-12/ http://www.instructables.com/id/Getting-Started-with-the-ESP... ). You also have to pull up CH_PD and pull down GPIO15, plus usually include a voltage regulator and/or smoothing cap, which adds enough hassle that WeMos is definitely worthwhile, but it's not really that bad if you only have the bare modules.
- canadaduane 11y agoI'm working on an ESP8266-to-Arduino bridge much like the GrovePi project. If you're interested in driving 5V sensors or actuators, or getting more digital or analog pins, it will be useful: http://www.esproto.com/2016/02/20/esproto-iot-coming-soon/ http://www.esproto.com/2016/02/20/esproto-iot-coming-soon/
- theophrastus 11y ago"with Wi-Fi"-onna-chip always has me wonder: can it handle wireless security (WEP, WPA, WPA2, ..)? because having to dedicate an open access point is often prohibitive.
- coaxial 11y agoThere is an excellent project named PlatformIO to program this and other chips: http://platformio.org/ http://platformio.org/ A ton of work went into it and setting up the toolchain is as simple as `pip install -U platformio`.
- StavrosK 11y agoI consider PlatformIO a must have at this point. It's made code deployment so much more easier and scriptable, I love it.
- Dowwie 11y agoA related crowdfunding project to facilitate MicroPython with this chip has already passed funding goals: https://www.kickstarter.com/projects/214379695/micropython-on-the-esp8266-beautifully-easy-iot/posts/1485145 https://www.kickstarter.com/projects/214379695/micropython-o... The new ESP8266 source code will be made available on GitHub right after the crowdfunding campaign closes..
- forgotAgain 11y agoIs it possible to do real time programming in a garbage collected language?
- theatrus2 11y agoIf you don't have any cycles (and disable mark/sweep), Python's reference counting will be deterministic. However, I doubt this implementation will be able to offer real-time capability :)
- HeyLaughingBoy 11y agoSure. What latency do you need?
- julian_1 11y agoEsp8266 also runs Lua, which provides first-class co-operative co-routines and is a really nice way to do cooperative multi-tasking. I've been playing with a Esp8266 NodeMCU configuration where one co-rountine monitors and maintains the wired-access connection, another CR blinks the activity led on a timer, and another presents a telnet-like command interface listening on a tcp/ip socket. The entire OS layer has been avoided, yet there is almost no loss of functionality.
- yitchelle 11y agoNeil Kolban has written a nice book on this if you want to do some initial research before taking the plunge on this device. https://leanpub.com/ESP8266_ESP32 https://leanpub.com/ESP8266_ESP32
- deleted 11y ago[deleted]
- mmanfrin 11y agoQuestion to those who know the landscape of little microcontrollers well: if I wanted to build a small pet tracking chip (gps and cell, probably) that would work way out in the boonies (like middle-of-nowhere-Wyoming), where should I look? Am I right to be thinking gps+cell, or is this something where I could get away with just GPS (and somehow track where that GPS is pinging from)? And would something like a tumble generator provide enough power?
- HeyLaughingBoy 11y agoThat's going to be a module, or set of modules, not a single chip. Doubt you'd get cell service in middle of nowhere Wyoming.
- anyfoo 11y agoBy "tracking", do you mean being able to check remotely where your pet currently is, or simply record its current location to some kind of storage, and being able to review that once you have physical access to the device? I.e. are you concerned about your pet getting lost, or do you just want to know where it has been? If it's about remotely checking, then you will need some kind of communication, which is most likely going to be cell phone related (i.e. GSM, UMTS, LTS...). A GPS device does not send anything to the satellites, it merely (as a simplified explanation) receives time codes from multiple satellites and triangulates the current position from that. If you only want to record, then GPS alone would be fine, obviously. Though there is "Assisted GPS" that makes use of cell phone technology to increase the accuracy/decreases the triangulation time. However, I do not know whether that can be leveraged from standalone GPS modules.
- Gibbon1 11y agoI think there are dog trackers on the market that use GPS + Cell. At least there are motorcycle trackers. Generally the problem with WiFi is if it's close enough to work the dog can usually hear you. You could use a directional antenna but an extra 10db isn't going to buy you much. And at 2.4GHZ WiFi gets attenuated rapidly when not line of sight. Same is true for anything else in the 900MHz/ 2.4GHZ bands. Cellular gets around this by putting their antennas up high to clear local clutter (buildings, trees, hills, etc). Problem with Cellular is the power drain and the monthly bill. On the other hand, probably will work. Cellular coverage is pretty good everywhere now. If you want to mess about I think there are modules with Cellular and GPS. You also might be able to use a 900MHz solution[1] where you just send a ping of the GPS coordinates every so often. If you up the power to the max allowed (Like 20-30db) and drop the data rate down to a few hundred/thousand bits per second. You could probably go two to three miles. I think your current choices here are some sort of FSK radio or the newer LoRa radio. The reason is FSK radios and LoRa both allow you to turn the bandwidth way way down. The lower the bandwidth the better the signal to noise for the same transmit power. [1] The lower the transmit frequency better it will propagate through clutter on the ground. But lower frequency means a bigger antenna. PS: If you're messing with RF using module or manufactures dev board is the way to go. It's very hard to tune the RF path and antenna without experience and a spectrum analyzer. PSS: I've found the transceivers from SemTech to be pretty bulletproof. They have their own power regulators on board which makes them insensitive to being powered by crappy supplies.
- nickzoic 11y agoThere was a good talk about these at LinuxConf AU: http://mirror.linux.org.au/linux.conf.au/2016/05_Friday/Wool_Museum/Free_as_in_cheap_gadgets_the_ESP8266.webm http://mirror.linux.org.au/linux.conf.au/2016/05_Friday/Wool... ... they're a very exciting device and incredibly cheap, and the supplied SDK libs look very nice, even though they aren't quite fully open source. The NodeMCU boards are very useful even if you're not interested in Lua, they add power, USB and breadboard friendly headers in a smallish package. I've started messing around with different ways to program them for educational purposes: http://nick.zoic.org/etc/flobot-graphical-dataflow-language-for-robots/ http://nick.zoic.org/etc/flobot-graphical-dataflow-language-...
- rocketcity 11y agoNow all we need is for AWS IoT to support TLS 1.1 with symmetric keys. Currently the ESP8266 arduino libraries only support TLS 1.1 which is not compatible with the TLS 1.2 minimum for AWS IoT. I am super excited for this board and would love to be able to kick of lambda functions automatically in response to device events. If anyone from the IoT team comes across this please make this a priority, all of us makers will thank you.
- jjawssd 11y ago> Now all we need is for AWS IoT to support TLS 1.1 with symmetric keys. Making the ESP8266 libraries support TLS 1.2 is a better idea
- ecesena 11y agoDiscussion here: https://github.com/esp8266/Arduino/issues/43 https://github.com/esp8266/Arduino/issues/43
- johnnycarcin 11y agoyou could always try it on Azure assuming you haven't built a ton out in AWS already...
- ako 11y agoYes, would be nice if you could connect it to aws iot. Any chances amazon would add tls 1.1, or would that maybe jeopardize their security certifications? (https://aws.amazon.com/compliance/published-certifications/ https://aws.amazon.com/compliance/published-certifications/)