Compare commits
4 Commits
Author | SHA1 | Date |
---|---|---|
DrMaxNix | 369c13f9f9 | |
DrMaxNix | 66f207399f | |
DrMaxNix | f624a2ed7e | |
DrMaxNix | e37b471763 |
12
README.md
12
README.md
|
@ -1,6 +1,6 @@
|
|||
# phoenix-upshid
|
||||
[![GitHub release](https://img.shields.io/badge/release-v1.0.1-orange)](https://github.com/DrMaxNix/phoenix-upshid/releases/tag/1.0.1)
|
||||
[![License](https://img.shields.io/badge/license-MIT-green)](https://github.com/DrMaxNix/phoenix-upshid/blob/main/LICENSE)
|
||||
[![Release](https://img.shields.io/badge/release-v1.0.2-orange)](https://git.tjdev.de/DrMaxNix/phoenix-upshid/releases/tag/v1.0.2)
|
||||
[![License](https://img.shields.io/badge/license-MIT-green)](https://git.tjdev.de/DrMaxNix/phoenix-upshid/src/branch/main/LICENSE)
|
||||
[![Maintaner](https://img.shields.io/badge/maintainer-DrMaxNix-blue)](https://www.drmaxnix.de)
|
||||
|
||||
Simple driver for reading data from Phoenixtec ("Amazon Basics") UPSes written in c
|
||||
|
@ -14,16 +14,16 @@ I tried multiple drivers for it, but they all had their problems:
|
|||
|
||||
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](https://github.com/DrMaxNix/phoenix-upshid/blob/main/nut-reverseengineering.md) 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"!
|
||||
At the end I [reverse-engineered](https://git.tjdev.de/DrMaxNix/phoenix-upshid/src/branch/main/nut-reverseengineering.md) 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:
|
||||
```console
|
||||
$ wget https://github.com/DrMaxNix/phoenix-upshid/archive/refs/tags/v1.0.1.tar.gz
|
||||
$ tar xf v1.0.1.tar.gz
|
||||
$ cd phoenix-upshid-1.0.1
|
||||
$ 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
|
||||
```
|
||||
|
||||
|
|
|
@ -482,15 +482,15 @@ void usbreset(){
|
|||
// DO RESET //
|
||||
// send command
|
||||
if(ioctl(bus, USBDEVFS_RESET, 0) < 0){
|
||||
fprintf(stderr, "[WARN ] Unable to do usbreset\n");
|
||||
fprintf(stderr, "[WARN ] Unable to do usbreset\n");
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
// success!
|
||||
fprintf(stderr, "[INFO ] Usbreset successful\n");
|
||||
fprintf(stderr, "[INFO ] Usbreset successful\n");
|
||||
|
||||
// close file
|
||||
close(bus);
|
||||
close(bus);
|
||||
}
|
||||
|
||||
/*
|
||||
|
|
Loading…
Reference in New Issue