Compare commits

...

4 Commits
v1.0.2 ... main

Author SHA1 Message Date
DrMaxNix 369c13f9f9 📝 migrate to git.tjdev.de 2023-03-22 20:21:49 +01:00
DrMaxNix 66f207399f 🎨 fix inconsistent indentation 2022-09-16 18:01:51 +02:00
DrMaxNix f624a2ed7e
🔖 bump version badge to v1.0.2 2022-04-29 19:23:20 +02:00
DrMaxNix e37b471763
🔖 bump version to v1.0.2 2022-04-29 19:22:34 +02:00
2 changed files with 10 additions and 10 deletions

View File

@ -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
```

View File

@ -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);
}
/*