Using The ESP8266 As A Web-enabled Sensor

A few months ago, the ESP8266 came onto the scene as a cheap way to add WiFi to just about any project that had a spare UART. Since then, a few people have figured out how to get this neat chip running custom firmware, opening the doors to an Internet of Things based around an ESP8266. [Marc] and [Xavi] just wrote up a quick tutorial on how to turn the ESP8266 into a WiFi sensor platform that will relay the state of a GPIO pin to the Internet.

If you’re going to replicate this project, you won’t be using the stock firmware on the ESP. Instead of the stock firmware, [Marc] and [Xavi] are using the Lua-based firmware that allows for access to a few GPIOs on the device and scripting support to make application development easy. To upload this firmware to the ESP, [Marc] and [Xavi] needed a standard FTDI USB to serial converter, a few AT commands through a terminal program, and a few bits of wire.

The circuit [Marc] and [Xavi] ended up demoing for this tutorial is a simple webpage that’s updated every time a button is pressed. This will be installed in the door of their hackerspace in Barcelona, but already they have a great example of the ESP8266 in use.

34 thoughts on “Using The ESP8266 As A Web-enabled Sensor

    1. Will it come with a pain-free library or will it be yet another ESP8266 breakout board? (I currently got 4 different boards, but the software part is where this modules is crippled)

          1. It isn’t the chip that has to be FCC certified, but the actual circuit implementation on the PCB. A reference design might be FCC certified, but if you change the board layout then you have to re-certify.

    1. Good day V
      Thanks for the Link!

      Given the range I really wonder what the transmitted power levels are… I hope someone does a quick radiated emission test, as most likely the TX power levels are really high. From the FCC certified modules I have seen the manufacturer actually have a warning that the device/antenna cannot be located within 20cm of people…

  1. Does anyone know of a bluetooth LE equivalent to ESP8266? There are plenty of cheap bluetooth LE modules out there, but using them means having 3 chips in total: my own microcontroller, the module’s microcontroller, and the module’s bluetooth transceiver. I’m looking a single chip solution like the ESP8266.

  2. I’ve never been able to find a good answer, but does anybody know if these will connect to APs that use RADIUS?

    I’ve blanketed my property with wifi and use a FreeRADIUS server to manage authentication. My goal is to use an ESP8266, a small microcontroller, and a GPS module to interface with my dogs’ training collars to make a cheap geo-fencing system. I’ve got a prototype running where it displays the realtime position on a Google map from a Raspberry Pi, but I would like to use an ATtiny or something so it will all fit in the existing training collar. The only thing I can’t find is whether these little modules work with 802.1x. I can tweak the encryption options to work with the ESP’s, but not being able to use RADIUS isn’t an option. In addition to keeping a digital eye on my dogs, it would also allow me to attach tracking tags to the heavy equipment.

      1. Battery life with the RasPi/GPS/Wifi setup? A little over 8 hours on a bench using an 18,000 mAh battery pack; while that would long enough for my purposes, I never put it into use with the dogs since it was too bulky to mount as a collar, though I did consider buying a doggy-vest and mounting the gear in that. Ultimately, I decided to do more R&D and use the ESP to interface with an Adafruit GPS unit directly and transmit position information over WiFi. That should still leave me with enough GPIOs to interface with the training collar’s circuitry and a use a smaller battery. Project is in Development Hell right now, but I hope to post a write-up as I go when I do get started.

    1. In general one would just match the Calling-Station-Id to the ESP8266’s MAC address since its really up to one’s AP and the RADIUS server to care about the support or not. This is because, on a specification level at lease, wireless clients would send a association packet. The base station(one’s access point) would receive this packet and then handle the authorization portion with your RADIUS server. If the RADIUS server allows the device then the AP sends an association response and then both devices begin to handle basic IP networking.

      However, if you have a pastebin of your configuration file(s) then I could give a better answer.

Leave a 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.