WiFi Teardown – arVin Light Swtich

WiFi Teardown – arVin Light Switch


This post is the first in what I hope will be a very fun and informative series. Lately there has been a huge influx of cheap wifi enabled IOT/SmartHome devices flooding the market. Each with their own (usually questionable) app.

I have embarked on an exciting journey to find out how many of these devices contain friendly micro controllers, and write basic “snoop-free” firmware replacements!

Source: Amazon
Price (at time of post): $25.99

Device Features

Dual color LED (Red and Green)
Button
15A Relay

Components

Relay: Golden brand 15A @ 120V
MCU: ESP8266EX
Flash Size: 1MiB

Pinout

Relay/Red LED: Pin 12
Green LED: Pin 13 (inverted)
Button: Pin 0 (inverted)

platformio.ini

[env:arvin]
platform = espressif8266
board = esp01_1m
framework = arduino
board_build.flash_mode = dio

PCB Front

PCB Rear

Flashing Instructions

This device is actually very easy to reprogram, hook up the exposed programming header labeled to a USB -> TTL Serial converter using the following table.

Serial -> Device
GND -> GND
3V3 -> 3V3
RX -> TX
TX -> RX

Put the device into boot mode by holding down the button while powering up the device, then you can use esptool or arduino uploader as normal.

I have included a basic firmware that includes ArduinoOTA and WiFiManager for your hacking pleasure on Github

These are the http endpoints of this basic firmware
http://<device ip>/ will show the name of this device and status of device
http://<device ip>/led/on will turn the Green LED on
http://<device ip>/led/off will turn the Green LED off
http://<device ip>/relay/on will turn the Red LED and Relay on
http://<device ip>/relay/off will turn the Red LED and Relay off

Note: Pressing the button on with this firmware will not work until you connect to the wifi labeled “esp_<chipid>” and set up the wifi

Note: Pressing and holding the button for 5 seconds will clear the stored wifi credentials and restart the device.

Happy Hacking!

If you have any suggestions of what I should tear down next let me know in the comments!
Please let me know if this format is informative enough for you!