Communicate with FX-5204PS with Python and PyUSB

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 and smart outlet

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.

Untitled.png

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

Communicate with FX-5204PS with Python and PyUSB
Communicate between Elixir and Python with gRPC
Programming with Python and Tkinter
Encryption and decryption with Python
Python and hardware-Using RS232C with Python-
python with pyenv and venv
Works with Python and R
Shining life with Python and OpenCV
Robot running with Arduino and python
Install Python 2.7.9 and Python 3.4.x with pip.
Neural network with OpenCV 3 and Python 3
AM modulation and demodulation with python
[Python] font family and font with matplotlib
Scraping with Node, Ruby and Python
Scraping with Python, Selenium and Chromedriver
Scraping with Python and Beautiful Soup
JSON encoding and decoding with python
Hadoop introduction and MapReduce with Python
[GUI with Python] PyQt5-Drag and drop-
Reading and writing NetCDF with Python
I played with PyQt5 and Python3
Reading and writing CSV with Python
Multiple integrals with Python and Sympy
Coexistence of Python2 and 3 with CircleCI (1.0)
Easy modeling with Blender and Python
Sugoroku game and addition game with python
FM modulation and demodulation with Python
Data pipeline construction with Python and Luigi
Calculate and display standard weight with python
Monitor Mojo outages with Python and Skype
FM modulation and demodulation with Python Part 3
[Automation] Manipulate mouse and keyboard with Python
Passwordless authentication with RDS and IAM (Python)
Python installation and package management with pip
Using Python and MeCab with Azure Databricks
POST variously with Python and receive with Flask
Capturing images with Pupil, python and OpenCV
Fractal to make and play with Python
A memo with Python2.7 and Python3 on CentOS
Use PIL and Pillow with Cygwin Python
Create and decrypt Caesar cipher with python
CentOS 6.4 with Python 2.7.3 with Apache with mod_wsgi and Django
Reading and writing JSON files with Python
Dealing with "years and months" in Python
I installed and used Numba with Python3.5
Tweet analysis with Python, Mecab and CaboCha
Linking python and JavaScript with jupyter notebook
Traffic monitoring with Kibana, ElasticSearch and Python
FM modulation and demodulation with Python Part 2
Encrypt with Ruby (Rails) and decrypt with Python
Easily download mp3 / mp4 with python and youtube-dl!
Operate home appliances with Python and IRKit
Clean python environment with pythonz and virtualenv
Practice web scraping with Python and Selenium
Easy web scraping with Python and Ruby
Importing and exporting GeoTiff images with Python
I'm using tox and Python 3.3 with Travis-CI
Happy GUI construction with electron and python
Use Python and MeCab with Azure Functions
Touch AWS with Serverless Framework and Python
RaspberryPi L Chika with Python and C #