I wanted to easily measure the amount of power used, so I looked around and found that Fujitsu Component Smart Power Outlet FX-5204PS -strip / smart-power-strip / index.html) was down. It was released a long time ago, but it seems that it is still in production.
The FX-5204PS has a USB B female port. I wondered if the usage was being discharged by serial or something, and it turned out that a dedicated device driver was needed. I thought I'd stop using it for a moment, but when I searched for it, there was a person who had already written a device driver in 2011 (more than 5 years ago from this article).
OpenBSD ... Moreover, the person who knows it seems to be the author.
If you search elsewhere,
SEIL ... It seems to be a port from OpenBSD.
But what I want to use is Linux or Mac. Considering that it is difficult to create an OS-dependent driver and maintain it continuously, I decided that it would be better to use it easily in the user space USB library. I asked the person who wrote the OpenBSD version driver about the contents of the source code and wrote it in PyUSB [FX5204PS module](https://github. It is com / keiichishima / FX5204PS /). Since it is Python, it works on various platforms. Even OS X (macOS has not been tested).
The original purpose was achieved, although it was a little omission, such as not considering the case where two or more devices were connected at the same time.
If you display the status with the visualizer that you made loosely with pygame
, it will look like the following.
The information that can be obtained with the FX5204PS module is almost the same as the OpenBSD driver, voltage, frequency, temperature, power consumption for each outlet (instantaneous value, average value (default reset in 5 seconds), maximum value (default 5 seconds reset) ).
If you find any bugs, please report them via github and we will deal with them as much as possible.
Recommended Posts