If you’ve read any of our posts in the last couple years, you’ll have noted that our community is stoked about bringing the Internet to their devices on the cheap with the ESP8266 modules. Why? This forum post that details making a WiFi thermostat really brings the point home: it’s so easy and cheap to build Internet-enabled devices that you almost can’t resist.
When the ESP8266 first came out, there very little documentation, much less code support. Since then Espressif’s SDK has improved, the NodeMCU project brought Lua support, and there’s even Arduino support. Most recently, BASIC has been added to the ESP stable, and that really lowers the barriers to creating a simple WiFi widget, like the thermostat example here that uses a Dallas DS18B20 temperature sensor and an LED as a stand-in for the heater element.
The hardware for this project, a re-build of this demo code from the ESP8266 BASIC docs, is nothing more than a few off-the-shelf parts soldered together. No schematic required.
What makes the project work behind the scenes is some clever code-reuse by [Rotohammer] on the ESP8266 forums. Essentially, he wrapped the Arduino’s one-wire library, giving it simple BASIC bindings. Then all that’s left for the BASIC coder is to read the value and print it out to a webpage.
There’s all sorts of details swept under the rug here, and those of you out there who are used to bare-metal programming will surely huff and puff. But there’s a time for building your own injection-molder to make DIY Lego bricks, and there’s a time to just put blocks together. This project, and the BASIC interpreter that made it possible, demonstrate how much joy someone can get from just putting the parts together.
Colour me a tad confused, why shove basic on this little beast?
Surely Arduino is simple enough?
If the answer is “cus I can”, then I applaud your effort though…
all the old farts (me included) probably knew basic first, apple IIe etc all used it, ti-81 and up use it. Its actually pretty brilliant of a move and should theoretically make a bunch of useful things be made.
With BASIC or Lua or the SDK, you don’t need the Arduino. The ESP8266 is a lot cheaper than an Arduino.
What he means is that you can now use the Arduino IDE to put code on the thing. The ESP8266 essentially becomes an Arduino.
It’s cheaper than an official arduino. I’ve been buying china grey market Arduino Pro Micros for $1.98 each off of ebay in packs of 20 for years now.
By arduino, he didn’t mean an arduino board, rather using the arduino software to program the module.
The basic interpreter allows for code to be typed in the browser, supports several html gui widgets out of the box such as textbox, listbox, dropdown, button and slider. Also has some simple capabilities for generating graphics. If you look at the examples on the site and what they do you might be amazed at the simplicity of things that would otherwise be complex to implement in any other language with so few lines of human readable code.
This doesn’t seem to bee a thermostat, as i don’t see anything that would allow an external device to switched on and off when the temperature is above/below some value.
Neat project anyways, but title should be “IoT Temp sensor”.
The LED is controlled as a heat element output. An optoisolator could stand in as a load driver.
The LED on GPIO 0 is showing the on/off output.
yeah… what RP said. I should have refreshed my screen before hitting the post button.
A remote temperature thingy seems to be the “Hello World” of wifi IoT projects.
Not a BASIC fan, and I’ve become comfortable with programming ESP8266 in C/C++… but most IoT remote applications aren’t rocket science, so if BASIC allows more people to realize their IoT ideas… it’s a good thing.
I have a Honeywell wifi thermostat. I’m very happy with.
I loaded this up on an ESP8266-12 and tried a couple examples and they work. I tried the Clock example but didn’t know how to update the clock on the page except running the program again. So does this generate code that can be run on a regular web page? I can’t run this from my wired computer. If I type in 192.168.4.1 I get page not found. I have to run from my wireless laptop then I have to keep switching back and forth between my wireless router and the ESP8266
I tried loading ESP8266 basic on two devices now and it looks like they are now bricked. Both of them (esp8266-01) started to get very hot after the upload. Tried on a nodeMCU (esp8266-12e) and now it won’t see wifi.
I’d like to see basic on the esp but so far it’s expensive and no output :(