diary at Telent Netowrks

Haskell and you shall receive#

Sun, 13 Dec 2020 22:30:15 +0000

Last winter I embarked on a project to replace my annoying wireless thermostat with something less annoying: started out sticking together MQTT and ESP8266 devices and then found myself trying to decode the thermostat's radio transmissions using SDR and then suddenly it was springtime and there was no need to heat the house anyway.

I spent a little while today trying to put it back together, because it's assuredly not springtime any longer. So far I have succeeded in reflashing one of the ESP8266 devices with a slightly newer version of the mqtt-sending software, and rebuilding the Haskell glue that subscribes to all the sensor messages and writes them into InfluxDB.

Whinge of the day: you picked MQTT because it's a simple fast low-overhead protocol ideally suited to MCUs, why are you[1] encoding the payload as JSON objects? It's only one notch less verbose than XML, for goodness sake.

[1] I wasn't quite doing this, but I was formatting floats to strings to send them over the wire. The newer version multiplies the temperature by 100 and sends a little-endian integer instead: I'm sure in the grand scheme of things it makes sod-all difference to anything but it makes me feel happier.