Ramblings of an aging IT geek
← Ramblings of an aging IT geek
hardware

a weather station on a chip i can barely get hold of

Building a small WiFi weather station around an early ESP32 module, what works, what doesn't yet, and why the toolchain is the real adventure right now.

A soldering iron and electronics components on a bench

The ESP32 is the chip everyone in the maker corners of the internet has been talking about for the last few weeks. Espressif have followed up the wildly popular ESP8266 with something that adds a second core, Bluetooth, more memory and a pile of peripherals, all still at a price that feels like a mistake in your favour. I got hold of an early module, which in June 2016 mostly means I knew the right person, and I pointed it at a problem I actually had: a WiFi weather station for the garden.

It mostly works. That "mostly" is doing a lot of honest labour, so let me explain it.

the build

The hardware is unremarkable, which is the nice part. A BME280 over I2C gives me temperature, humidity and pressure from a single tiny sensor. The ESP32 reads it, connects to the house WiFi, and posts the readings over HTTP to a little collector on a server indoors. There's no display on the unit itself; the whole point is that it lives outside in a vented enclosure and I look at the numbers from my desk.

BME280  -->  ESP32 (I2C)  -->  WiFi  -->  HTTP POST  -->  collector

Wiring is four jumpers for the sensor plus power, and the BME280 is forgiving about supply voltage thanks to an on-board regulator, so there's not much to get wrong. I got clean readings on the bench within an evening, which after years of fiddly analog sensors felt almost rude.

A close-up of a circuit board and jumper wires

the part that's still rough

The chip isn't the adventure. The toolchain is.

This is brand new silicon, and the software is racing to catch up. The official SDK, esp-idf, exists and is moving fast, but "moving fast" in June 2016 means you build from a git checkout, you read the source when the docs run out (they run out often), and a tree that worked on Monday may want a different setup by Friday. There's no comfortable Arduino-style path for the ESP32 yet, the way there is for the 8266. If you want that hand-holding, give it a few months.

My WiFi reconnect logic is the bit I'm least happy with. When the access point blips, the 8266 had well-worn patterns for coming back gracefully; on the ESP32 I'm still working out the right events to hang the reconnect off, and right now it sometimes sulks until the watchdog reboots it. Which, to be fair, does get it back online. It's just not elegant, and "it reboots until it works" is not a sentence I want to write about something living in a box outside.

Power figures are another open question. Deep sleep is one of the headline features and the numbers in the datasheet are lovely, but I haven't yet got my measured sleep current anywhere near what's advertised. That's almost certainly me holding it wrong rather than the chip failing to deliver, and it's on the list to chase down properly.

the verdict, for now

For a chip this young, it's remarkable how much already works. The sensor reads cleanly, the WiFi connects, the data lands in my collector, and I can pull up a graph of garden temperature from my laptop. That's a working weather station, which is more than I expected this early.

But I wouldn't tell anyone to start an ESP32 project this month unless they enjoy the rough edges as much as the result. The hardware is ready. The software ecosystem is a building site, an exciting one, but a building site. I'll leave this unit running, keep poking at the reconnect logic and the sleep current, and come back to it once esp-idf has had a few more months to settle. Ask me again at the end of the year and I suspect the "mostly" will have quietly dropped off.