I bought two Edimax SP-2102W devices, that allow measuring power usage and send the results to an android application. This works no matter if you’re at home or not, so the devices seem to store some information in the cloud. Two problems:
- I’m not sure if i want information about my power usage in the cloud somewhere
- Why android app? I want the information, along with long term data, on my PC.
A german forum had some information about the Edimax, so i decided to start from there. Here’s what i found out:
- Cloud communication is obfuscated, but not really encrypted. I was able to write a dissector for wireshark to check what’s going on an when.
- As long as you’re not using the app to access your data, it won’t send anything interesting to the cloud – it just keeps sending UDP packets to keep the firewall open.
- When the app accesses your data, it will use an edimax server as a proxy. This communication uses some information that seems to be your encrypted password, so this seems to be quite secure.
- The edimax has a mips processor and runs a linux distribution, the source of which can be downloaded at http://www.edimax-de.eu/edimax/mw/cufiles/files/download/OpenSourceCode/transfer/Wireless/Smartplug/SP-2101W/SP-2101w_GPL_v1.03.zip. Unfortunately, the source to the binary that’s handling the cloud communication (FW/srcbase/apps/prebuild/bin/agent) isn’t provided. Come in Ida-Pro, which allowed me to find out how the obfuscation works easily.
- I used wireshark to find out how the android app searches for devices on the local network, and wrote a little program edimaxfind that does the same on my linux workstation.
- The device has a web server as well, that can be accessed by curl or similar, which is (partly) documented on http://sun-watch.net/index.php/eigenverbrauch/ipschalter/edimax-protokoll/ (site in german). This allowed me to write a daemon edimaxd which queries the device once a second and writes the result to a rrd database, so i can use whatever i want to display long term information.
Unfortunately, when i run edimaxd, the device becomes unresponsive after 2 days (ping works, agent/webserver don’t) – i assume the webserver writes a log file which fills up the disk. I guess i’ll have to enhance edimaxd to allow customization of the interval, and set the default to 10 minutes or something similar.