I was looking for a remotely controlled power strip. Actually, I was originally thinking about wired/Ethernet connected ones as I had seen in some data center setups. But eventually, I found those very cheap WiFi-controlled strips at Amazon (Cheap is always relative and try to compare those to their wired counterparts). But those WiFi-connected strips have one big problem:-( They normally require a specific smart phone app and accounts/connections to some random cloud somewhere:-( You can find many different sellers on Amazon and while the actual devices look very similar, the apps/clouds seem to be different for most:-( That was something, I did not really like.
So next stop: Google – trying to find out if any of those cheap devices were actually hackable in a way,so that I could control them how I wanted. I found some which reportedly were running OpenWrt and some which are running a ESP8266 and seem to be more or less easy to flash with new firmware. Especially the https://github.com/arendst/Sonoff-Tasmota looked promising because it reportedly supports many different devices.
That sounded promising enough that I decided to gamble a bit and buy a power strip which might do, what I want. So I decided to get a “DIWUER Smart Multi Outlets with 3 Plug and 2 USB Ports” and before I plugged it in, I took it apart;-) Warning: Do not play with the open strip while it is connected to the mains-power!! Be careful!!
I was lucky;-) I found, what I was looking for, a pre-packaged ESP8266 and even better, a complete programming port right next to it;-) The little board is a TYWE3S board. I did not play much with the ESP8266 before, just because I did not have any real need for it. But I play with all kinds of little micro-controllers, so what’s one more;-) So, setting up another isolated Arduino-IDE for the ESP8266 setup, cloning the repository and compiling the sketch were really straight-forward;-)
Next step, following the traces and trying to figure out, which IO pin controls what was not that hard either. The little image to the left shows the assignments for my version of the strip, but that might be different for others!
I did not want to solder real pins into the programming header since I was not sure, if there is enough space. Maybe right-angled pins might work. But since the programming is supposed to be a one-time affair, I opted for a press-fitting made out of a dual-row header. That worked surprisingly well;-)
Flashing the new firmware worked as expected and the strip came up. Eventually, it started an WiFi access point and I was able to edit my SSID and password. After that, the strip connected to the home network just fine.
Since I did not find a pre-defined modul for my strip, I used the “Generic Modul” and defined the IO pins as I had found out before. I don’t run a MQTT or anything like that [permanently] yet. So I did not play with that part of the firmware yet. But turning the different mains & USB sockets On/Off works as expected;-)
I’m happy with my little excursion;-)