Adding an Ethernet Port to your ESP32

Frank Sautter has an interesting post on his blog on adding a physical ethernet connector to an ESP32 development board.  The board he chose was the Waveshare LAN8720 and, apart from Frank Sautter's LAN8720 Adapter Boardone gotcha with GPIO0 during resets, it appears to be a fairly simple build.  The LAN8720 already has (some!) support from Espressif, so this seems like a nice, easy and relatively cheap way to build yourself a WiFi-to-Ethernet gateway.

Frank has detailed the connections for his adapter board and included a nice bottom view (left), so that it should be fairly easy to duplicate his build.  The LAN8720 boards themselves are currently available on eBay for about $3 each.

 

Olimex Updates

Back in February I wrote about the Olimex ESP32-EVB board, which looked like an exciting development in the ESP32 world.  Well, Olimex have posted a remarkably frank update on the progress of the EVB on their own blog, saying of the initial revision that “[it had] too many errors” and that they had “decided to trash it and just move forward to revision B”.  Olimex ESP32 Dev BoardThe problems apparently included non-functional ethernet and missing pull-ups (Olimex assumed they were already included on the ESP32 module, when in fact they weren’t).

The updated, rev-B version is well underway and the aforementioned blog has some interesting back-and-forth in the comments section regarding the choice of ethernet controller and other design issues.

The latest news on rev-B is that it has automatic programming mode via the USB connector (ala NodeMCU), a new IR transmitter/receiver and an additional CAN bus.  One of the “user” buttons has been removed, as there’s now no free GPIO to handle it due to the new features just mentioned.

All in all, an interesting insight into the evolution of a new product.

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 – Nooelec.com 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 to 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 hazeltonrig.throgmortons-bottom.org -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" : 902.000}

Note that the “direction” readings are meant to be in degrees, so 902.000 (last line) doesn’t make much sense. Looking at the code and at the actual weather station display, it seems like there’s a nibble ordering issue with the decoding of the raw data and that should actually read “290”, instead (the fix is tested here and is now working its way backup the line).


‡  “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:-  https://www.itead.cc/contact-us

Want a new workshop?

Hackster.io 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.