The idea is simple. Many devices use the same chip or chipset to accomplish connecting to wireless network and monitoring / controlling devices through General Purpose Input Output (GPIO) pins. The folks at Tasmota https://tasmota.github.io/docs/
wrote some open source firmware for ESP8266 based devices. The process to flash it to different devices varies, depending on the device.
For the wireless smart outlet, I chose to do it Over the Air (OTA), meaning I used a raspberry pi, my laptop, and my smart phone. The steps I followed were pretty much what is documented on this page: https://github.com/ct-Open-Source/tuya-convert
- Installed Tuyaconvert on my Raspberry Pi
- Flashed the included Tasmota firmware file
- Connected to the tasmota-xxxx access point (AP) using my cellphone, and went to newly flashed device's IP address using phone's web browser to enter my home's Wi-Fi credentials into the device.
- The wireless smart outlet shows up on my home networks list of connected devices, and I go to it's IP address on my laptop to continue configuring the device.
Once the smart outlet is on my home network, I moved on to the next device, the Sonoff TH16. This one required a bit more work, and I wound up following instructions laid out in this excellent video https://youtu.be/JgHr5z33xlA
A couple of things to note about the Sonoff TH16:
- Once you open it, you will see a spot for some standard .1 " header pins to be soldered. In my case, there were 5. You only use four. But I soldered in a 1x5 header. The 4 you use are TX, RX, VCC, and GND. a photo of which pin is which is nicely seen here:
- As pointed out in my earlier post, you will need to make sure the USB to serial adapter you use is set for 3.3 volts out, otherwise you will damage the Sonoff TH16. On mine, there is a jumper to set the voltage of the VCC out and data levels.
- Remember that the TX from your USB to serial adapter goes to the RX on the Sonoff TH16. The RX from the USB to serial adapter goes to the TX on the TH16
Once the firmware gets loaded on the TH16, you do a similar "dance" with the cell phone connecting to the device's wifi AP, setting your home wireless network's credentials, and connecting the device to your home network.
Next steps: installing Home Assistant, configuring it (and MQTT Broker), then configuring both the smart plug and the TH16 to connect to MQTT. More in upcoming post.