Simple driver for reading data from Phoenixtec ("Amazon Basics") UPSes written in c
Go to file
DrMaxNix 369c13f9f9 📝 migrate to git.tjdev.de 2023-03-22 20:21:49 +01:00
LICENSE Initial commit 2022-04-26 20:25:08 +02:00
README.md 📝 migrate to git.tjdev.de 2023-03-22 20:21:49 +01:00
nut-reverseengineering.md 📝 make more readable 2022-04-26 21:23:12 +02:00
phoenix-upshid.c 🎨 fix inconsistent indentation 2022-09-16 18:01:51 +02:00

README.md

phoenix-upshid

Release License Maintaner

Simple driver for reading data from Phoenixtec ("Amazon Basics") UPSes written in c

Why?

A while ago I bought a UPS (Uninterruptible power supply) from Amazon Basics. I tried multiple drivers for it, but they all had their problems:

  • NUT tended to mess up the USB connection after some days to a point where you had to unplug and re-plug the USB cable of the UPS
  • UPower had a stable connection, battery percentage was updated in real-time, but the charging state was frozen, displaying fully-charged when UPS was at 5% charge or displaying charging when UPS was already at 100%
  • ..and many more that didn't work at all.

So I tried writing dirty fixes for both of those drivers, which would reset the USB connection when detecting such problem. But it wasn't as stable as I had hoped.

At the end I reverse-engineered the USB-HID protocol of the UPS and wrote my own driver for it in c, which has the reset-capability built-in. I'm not at all into c driver development, so use this at your own risk, as the license already states: "WITHOUT WARRANTY OF ANY KIND"!

How to use

Download and extract source and compile:

$ wget https://git.tjdev.de/DrMaxNix/phoenix-upshid/archive/v1.0.2.tar.gz
$ tar xf v1.0.2.tar.gz
$ cd phoenix-upshid
$ gcc -o phoenix-upshid phoenix-upshid.c

OPTIONALLY copy to $PATH:

# cp phoenix-upshid /usr/local/bin/

Find device id:

$ lsusb
...
Bus 001 Device 005: ID 06da:ffff Phoenixtec Power Co., Ltd 
...

Print device data of device 06da:ffff (and try usb reset):

# ./phoenix-upshid -a 06da:ffff