Cat successfully skinned!

Regular visitors may remember a mention I made of an ESP8266/433Mhz gateway project a couple of weeks back.  Well, one of the reasons I found it so interesting was that I have a (fairly long-in-the-tooth) Oregon Scientific weather station installation which has always frustrated me with its lack of connectivity.  It does have a 9-pin, D-type serial connector on the bottom, but that assumes that you have an RS232 equipped machine within cable reach of the display unit (and that HID‡ would not object to yet another trailing cable).

I had toyed with the idea of plugging an ESP8266 into that port, with the excellent serial adapter  firmware from JeeLabs, but it doesn’t really address the HID/cable/ugliness issue.

Both of these methods also suffer from a fatal design flaw with this particular model of weather station, in that data isn’t squirted out of the serial port unless all of the sensors which this model was sold with are operational (otherwise you just get an error message along the lines of “Rain sensor not detected” and nothing else).  So I concluded that, by collecting the (433Mhz) transmitted data from the actual sensors (which are remote from the display unit), I could just use the data directly and ignore the base-station/display part of my weather station completely.  Hence my interest in the 433Mhz gateway project.

The final piece of the puzzle to drop into place for one of those light-bulb moments came when I was reading through the comments to one of Pete Scargill’s recent articles on the 433Mz RFLink project.  Commenter Paul gave a link to a GitHub repository called “rtl_433”, which is a 433Mhz decoder for SDR dongles by Benjamin Larsson.  Benjamin’s project is specifically for picking up the data from remote sensors (from many, many manufacturers) which operate in that open, 433Mhz band.

I’d recently bought an SDR dongle from a vendor on Ebay which was advertised as having an R820T tuner chip, suitable for ADS-B monitoring.  It turned out to be a bogus ad, with the actual tuner chip being a 0012, which doesn’t even cover the 1090Mhz ADS-B band.  I threw the useless dongle into the drawer and ordered a decent one directly from the manufacturer (which, incidentally, has worked perfectly from the first moment it was plugged in – is the place to go), writing off the $10 Ebay one to experience.

Having seen Paul’s post, retrieved and compiled Benjamin’s “rtl_433” package and pulled out the “useless” dongle from the murky depths of the spares drawer, I had direct data from all of the Oregon Scientific sensors published to MQTT in less than five minutes after plugging it in.  One cat neatly skinned in a completely different way than that which I’d originally envisaged.

Just for your reference, here’s the simple pipe to publish your data:-

./rtl_433 -F json   |  mosquitto_pub -l -h -t sensors/rtl_433

The “-F json” argument to rtl_433 is to force the data to be output in JSON format.  It will also accept “csv” (comma separated values) and “kv” (key:value pair) format arguments.

And here are a few lines of sample data from the various sensors:-

{"time" : "2017-03-21 15:52:24", "brand" : "OS", "model" : "THGR968", "id" : 204, "channel" : 1, "battery" : "OK", "temperature_C" : 8.300, "humidity" : 49}
{"time" : "2017-03-21 15:52:24", "brand" : "OS", "model" : "BHTR968", "id" : 66, "channel" : 0, "battery" : "LOW", "temperature_C" : 19.700, "temperature_F" : 67.460, "humidity" : 30, "pressure" : 946}
{"time" : "2017-03-21 15:52:25", "brand" : "OS", "model" : "BHTR968", "id" : 66, "channel" : 0, "battery" : "LOW", "temperature_C" : 19.700, "temperature_F" : 67.460, "humidity" : 30, "pressure" : 946}
{"time" : "2017-03-21 15:52:26", "brand" : "OS", "model" : "WGR968", "id" : 183, "channel" : 0, "battery" : "OK", "gust" : 1.400, "average" : 1.400, "direction" : 860.000}

‡  “Her InDoors”

Nice little TFT screen adapter board

Johan Kanflo has an interesting site which is definitely worth browsing.  One of his ESP8266 projects which caught my eye was the “Commadorable-64”.  Although the Commodore 64 isn’t a shared experience, using a tiny TFT display connected to an ESP is.  Johan has put together a neat little carrier board for the ESP8266 which solders directly onto the pins of the TFT display board.  Instant wireless display!

Johan’s project actually covers more than just one model of display, with the ESP Johan Kanflo's TFT Adapter Boardcarrier board being available for the 2.2, 2.4 and 2.8 inch TFTs (the larger models have connections for touch control, too);  follow the links on Johan’s project page to reach the DirtyPCBs pages for the one which interests you.

Johan has a Github repository with the code for this project (and many more) available for download.

433MHz/IR MQTT Gateway Project

It’s nice to see a project that develops over time and Florian has a good example on his blog.  He started off in the middle of last year by putting together a low-cost, arduino-based sensor for his garden and things seem to have just grown from there :-).  You can follow along on his blog from the initial version of his bidirectional 433MHz, ESP8266-based, MQTT gateway, progressing to the IR enabled version by the end of the year and his OpenMQTTGateway project this year.  It’s a good read and a great little project to follow.



ITEAD Recall

Just in case you haven’t seen it already, ITEAD Studio is recalling some of their Sonoff devices.Sonoff damaged by heat

The recall covers Sonoff TH16 and Sonoff POW units, manufactured during December 2016 and January 2017, which were produced without the correct amount of tinning on the AC power traces required to carry the maximum specified current.

There doesn’t seem to be any easy way to identify affected units though and the recall Sonoff PCB damagenotice seems to infer that only Sonoffs with existing, visible damage will be exchanged.

It’s worth noting that this issue only affects units which are being used with high current loads, so it’s unlikely that you’re going to have problems if you’re only using the modules to switch on your porch lights at dusk.  However, as these units were sold specifically for their higher current handling ability over the original Sonoffs, it is probable that there are many use cases out there which will be affected by this issue.  If you’ve purchased a TH16 or POW unit recently and you’re using it with a load which draws quite a lot of current (any sort of heater, for instance), you should probably stop using it until you can verify with ITEAD Studio whether it is amongst the affected units or not.

ITEAD are asking that people who believe they have an affected TH16 or POW to open a support ticket on their site at:-

Want a new workshop? is currently hosting a competition promoting IOT2020 units, with the first prize being several thousand dollars worth of lab equipment for your electronics workshop.

The IOT2020 is an Intel Quark based controller (running Yocto Linux), packaged into an industry standard, DIN-rail mountable case, designed to enable your project to morph directly into a product by providing a unit which is already FCC approved.  The main requirement for the competition is that your entry be based around the IOT2020, but the nice thing is that they are actually giving away ten of the units in the opening round, so all you need to do is submit an idea and you could win an IOT2020 to play with and also have a chance at the grand prize.

Peter Oakes (who is promoting the competition) does specifically mention ESP8266-based projects as being a prime example of where this unit might be used (as, for instance, a gateway between a local network of ESP8266 modules and the internet).

Currently there are only about seventy entries registered, so those are pretty good odds.  If you have an idea for an IOT device that you think would sell as a product, you’re not going to lose anything (other than the element of surprise) by entering.



How to do a Sonoff memory upgrade

Jonathan Oxer, over at SuperHouseTV, has been running a series of video episodes on the Sonoff product line recently and I really recommend his latest.  The theme of the video is Sonoff-specific hints and hint #1 is how to upgrade the memory chip in a Sonoff.  Jonathan does a great job of demonstrating how to remove the chip with nothing more than “a big, old, clunky soldering iron” and a screwdriver.  A picture is worth a thousand words, so you need to multiply that by whatever the frame rate of a YouTube video is.  Watch it!  It’s worth it.

Olimex ESP32 Development Board

Just in case you haven’t seen it elsewhere already, the good news for ESP aficionados today is that Olimex have announced an ESP32-based (WROOM-32) development board with a couple of novel features.

Olimex ESP32 Dev Board

The most obvious is that prominent ethernet connector.  According to the specs it’s a “fast” ethernet port, so 10/100Mbs.  The two relays are rated at 10A/250V and it’s worth noting that, from the photograph of the bottom of the board, both the N/O (normally open) and N/C (normally closed) contacts are broken out to the screw terminals.

Olimex ESP32 Dev Board (bottom)

What makes that more useful than N/O only?  Well with two relays, you now have complete control over a switched device and the existing wall switch still works as normal if your ESP32 board is powered off:-

  • The N/C relay is in series with the existing wall switch and the N/O relay is in parallel.
  • If the light is switched on at the wall switch, you can switch it off remotely by activating the N/C relay to open the series contacts.
  • If the light is off at the wall switch, you can activate the N/O relay to close the parallel contacts, switching the light on.
  • Fail-safe operation. If the power to the ESP32 board fails, your wall switch still works as normal.
  • If the light isn’t being controlled by the ESP32 board, the relays are both off, so the relays don’t draw current and your wall switch, as above, still works normally.

This isn’t by any means novel, but a lot of the low-cost ESP relay control boards out there only have a single, normally-open relay contact pair available.

Moving on from the relays, there is also a micro-SD card slot available for on-board storage, two buttons, a decently sized barrel connector for an external +5V supply and a connector for a LiPo battery, with an on-board charger and step-up converter to enable battery powered operation.

There’s a 40-pin connector, which apparently gives access to all of the available GPIO pins (the pin map for the connector is silk-screened onto the bottom of the board) and, finally, a “UEXT” connector (the ten pin socket, next to the 40-pin connector).  If you’re not familiar with the UEXT connector (and I certainly wasn’t), it turns out that it’s something which Olimex developed, are already using on many of their boards and have made available to the community as an Open-Source (as in royalty-free) standard.  It consists of 3V3 and GND power pins, TX and RX serial pins, SDA and SCL I2C pins and MISO, MOSI, SCK and SSEL SPI pins.  Now before you get too excited and start pulling all of those 30-year-old floppy disk cables out of your junk box, you should note that there’s no special magic used here; the I2C and SPI busses are still basically short-haul, on-board interconnects and you won’t be connecting remote devices over miles of (ancient) ribbon cable.  On the other hand, it is quite a neat idea to be able to plug (for instance) an LCD display directly onto the board.  You can check Olimex’s UEXT documentation for a (surprisingly long) list of their boards which already have this connector built in.

Unfortunately, although they’ve announced the price, at €22, the board isn’t actually available for sale quite yet.  According to the Olimex blog, the prototypes are in and as soon as they’ve been tested and some example code has been written, it’ll be going into full production.

Thanks to CNXSoft for breaking the news on this one.