Dec 172017
 

I was having issues with one of my new tp-link HS110 smart plugs reporting >28,000 watts current power consumption (obviously not correct since that device would light on fire and explode at that point).

In the app, it reported the firmware was v1.1.1 and there were no updates available.

You can check firmware version by clicking on the device in the Kasa app then clicking on the settings icon in the top right. This will show device info including firmware version. My devices are all hardware version 1.0 although I’ve read there may be a 2.0 hw version with different firmware. I checked for updates from the main screen in the Kasa app by clicking the 3 horizontal bar menu in the top left then Settings > Firmware Update. That screen reported no updates.

I contacted tp-link support who said they’d investigate. Shortly thereafter they sent me a link to use their firmware upgrade tool

The upgrade tool is no longer available on their FAQ page like it previously was, but it’s still located at the same location. It appears the device is written in Python and contains a small HTTP server bundled with it to serve up the firmware over the local network.

When I tried to scan from inside the utility, it couldn’t find any of my outlets/plugs.

My network subnet is 172.16.0.0/22 and the devices have static DHCP addresses all set to 172.16.2.0/24. The tool appeared to be sending a UDP broadcast to 255.255.255.255:9999. I couldn’t see this anywhere in Wireshark and these devices appear to listen to TCP 9999 not UDP 9999. I found the UDP broadcast information by watching main.exe with Process Monitor.

I ended up using pyHS100 Python module which is a 3rd party interface to communicate with tp-link smart devices. The official version doesn’t have support for modifying firmware although someone has already added this and has a pending pull request. Someone has already reverse engineered and documented the API including firmware updates

To update the firmware:

  1. Download tp-link’s upgrade tool found here http://static.tp-link.com/iotUpgradeTool_V1.0.zip
    1. Extract the contents and notice there is a firmware folder with firmware for various devices inside. For my HS110 U.S. version, it has a firmware v1.2.3 file
    2. Inside the firmware/ directory there’s an application called hfs.exe–this is a light-weight HTTP server used to serve firmware on your local network
  2. Download the SmartDevice-API-Addition branch from kdschlosser’s fork of pyHS100
    1. You may want to check the official version to see if this code has been merged in/there are any updates
  3. Start a web server to serve the firmware directory. You can use hfs.exe by opening it and selecting Menu > Add folder from disk… and selecting the firmware folder. You could also use Python’s http.server or anything else. Note the URL to the correct firmware file for your device and make sure it can be successfully downloaded with the web server
  4. Start python3 and import the SmartPlug module from pyHS100
  5. Create an instance using your device’s IP
  6. Send the device the firmware URL
  7. Check firmware download status
  8. Flash the device
  9. Wait about 1-2 minutes while the device updates, power cycles, and comes back online
>>> from pyHS100 import SmartPlug
>>> plug = SmartPlug('172.16.2.6')
>>> plug.hw_info
 {'sw_ver': '1.1.1 Build 160725 Rel.164033', 'hw_ver': '1.0', 'mac': '50:C7:BF:xx:xx:xx', 'hwId': '60FF6B258734EA6880E186F8xxxxxxxx', 'fwId': '060BFEA28A8CD1E67146EBxxxxxxx', 'oemId': 'FFF22CFF774A0B89F7624BFxxxxxx', 'dev_name': 'Wi-Fi Smart Plug With Energy Monitoring'}
>>> plug.firmware_download_url('http://172.16.1.1/firmware/hs110v1_us_1.2.3_Build_171016_Rel.100427.bin')
>>> plug.firmware_download_state
 {'ratio': 100, 'flash_time': 66, 'reboot_time': 20}
>>> plug.firmware_download_flash()
>>> plug.hw_info
 {'sw_ver': '1.2.3 Build 171016 Rel.100427', 'hw_ver': '1.0',  ...}
Apr 032016
 

Google Drive API provides a way to get the MD5 checksum of uploaded files. This can be used to verify if files uploaded correctly. I’ve created a small Javascript program that uses the Google Drive API available here: Google Drive MD5 Fetcher. You’ll need to authorize access first, then put the name of the file in the search box and it will fetch MD5s from Google. You can right-click to view source and see how it works.

Jun 012014
 

I just upgraded my laptop from Windows 7 to Windows 8, and in the process, I was required to uninstall DigitalPersona since it is not compatible with Windows 8. I expected to be able to download a newer version from Dell after the upgrade completed, but that’s not the case. You may be able to apply this update before upgrading, but I didn’t try beforehand.

  1. Visit My Dell Downloads and download DigitalPersona. You may need to register your laptop using Internet Explorer to get a list of software
  2. Install DigitalPersona and restart your computer
  3. Right-click on this link and select Save File As or Save Link As
  4. After you save the file, double-click it to add the changes to the registry. This creates a key that the DigitalPersona installer looks for. If it’s not found, it throws the Dell Personal not installed error
  5. Download either the 32-bit or 64-bit DigitalPersona v6.2.1.309 installer (originally from a forum post here)
  6. Restart your computer
  7. DigitalPersona should now be working. You may need to enroll your finger prints still

Additional information:
The DigitalPersona upgrade checks the registry key HKEY_LOCAL_MACHINE\SOFTWARE\DigitalPersona\Products\Personal\OEM for the value 020. If the key is missing, which was the case on my computer and apparently other peoples, the installer stops reporting a “Dell Personal is not installed. This package can only be installed as an upgrade.” error. The above instructions add that registry key so the installer will work. Additionally, you can use Orca to remove the Dell Personal check launch condition from the installer MSI.

Oct 192012
 

If you try putting an MSDN key into Anytime Upgrade, it will get started on the upgrade process then eventually fail telling you the key you entered cannot be used for Anytime Upgrade. The trick is to use some other key for the same version. This key, though, does not have to activate. I wanted to upgrade from Home to Professional. Luckily I had my Dell Laptop came with Windows 7 Professional.

  1. Run Anytime Upgrade with any key for the version you want to upgrade to (OEM keys work)
  2. After the computer restarts and updates, run slmgr.vbs /cpky to delete the product key
    slmgr.vbs is available on the internet, on Professional machines, and is probably located somewhere on the install medium
  3. Run slmgr.vbs /ipk XXXX-PRODUCT-KEY-HERE-XXXX
  4. Now slmgr.vbs /ato to activate it

** Each command may take a few minutes to finish even though it looks like it goes through instantly. A dialogue box will open with the results when the command has actually completed.

I highly recommend making a disk image before trying this process in case something breaks in the process. You can use Clonezilla, Acronis, Norton Ghost, among many other programs. There are plenty of guides online

Aug 102012
 

Early today I was looking for a way to automatically run Disk Cleanup on multiple computers in a domain. I found the /sageset switch which allows you to define the options you want to use in conjunction with /sagerun, but none of the articles mentioned anything about saving the settings for use on multiple computers. Using Regshot 2.0 unicode on Windows XP I determined the settings are saved in:

HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Explorer\\VolumeCaches

There is a key for each category and a StateFlags dword value for each configuration made using /sageset. The StateFlags value has a number after it that corresponds to the /sageset number. By exporting a the VolumeCaches key and merging in before running cleanmgr /sagerun, you can easily deploy a Disk Cleanup policy. I won’t have time to thoroughly test this on different machines until Monday, so USE WITH CAUTION.