raspi-poe-mon


Nameraspi-poe-mon JSON
Version 1.0.0 PyPI version JSON
download
home_pagehttps://github.com/klamann/raspi-poe-mon
SummaryA controller for the display and fan of the Raspberry Pi Power Over Ethernet HAT (Type B), compatible with Raspberry Pi 3B+/4B
upload_time2024-09-23 18:18:40
maintainerNone
docs_urlNone
authorSebastian Straub
requires_python<4.0,>=3.9
licenseMIT
keywords raspberry-pi oled-display monitoring waveshare power-over-ethernet
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            # Raspi PoE HAT Monitor

[![build](https://github.com/klamann/raspi-poe-mon/actions/workflows/build.yml/badge.svg?branch=main&event=push)](https://github.com/klamann/raspi-poe-mon/actions/workflows/build.yml)
[![PyPI](https://img.shields.io/pypi/v/raspi-poe-mon)](https://pypi.org/project/raspi-poe-mon/)
[![PyPI - License](https://img.shields.io/pypi/l/raspi-poe-mon)](https://github.com/klamann/raspi-poe-mon/blob/main/LICENSE)
![Raspi](https://img.shields.io/badge/Raspberry%20Pi-A22846?logo=Raspberry%20Pi&logoColor=white)
![Python](https://img.shields.io/badge/python-3670A0?logo=python&logoColor=ffdd54)

A controller for the display and fan of the Raspberry Pi Power Over Ethernet HAT (Type B), compatible with Raspberry Pi 3B+/4B.

![](https://raw.githubusercontent.com/klamann/raspi-poe-mon/main/docs/raspi-poe-hat-2k.webp)

The PoE HAT ([Waveshare SKU 18014](https://www.waveshare.com/wiki/PoE_HAT_(B))) allows you to deliver gigabit ethernet connectivity and power supply to your Raspi using a single connection (if you have a PoE capable switch/router). While PoE works without additional drivers, there is also a fan and a 128x32 pixel monochrome display on the HAT, both of which can be controlled with this software.

Warning: The OLED display is susceptible to burn-in, pixel brightness will deteriorate over time - refer to section [Handling OLED burn-in](#handling-oled-burn-in) for more information.

## Features

* automatic fan control to reach your desired temperature target
* show status information on the display: IP address, CPU usage, CPU temperature, RAM usage, disk usage.
* manual fan control via CLI
* show custom text via CLI (wip)

## Getting Started

If you are running the latest [Raspberry Pi OS](https://www.raspberrypi.com/software/), everything should already be set up the way we need it and you can run

    pip install raspi-poe-mon --break-system-packages

The scary `--break-system-packages` flag just tells Python that you want to install this package globally rather than in a virtualenv. I don't agree with the framing here, in my opinion it's fine to install Python packages globally on your Raspi.

After installation finished, you can call

    raspi-poe-mon run

and the OLED disply should show you some info. Learn more about the available options with `raspi-poe-mon --help`. Each command has its own help section, e.g. `raspi-poe-mon run --help`.

### Install Guide

If you want to install `raspi-poe-mon` on older Raspberry Pi OS or on a different OS, this section is for you.

The OLED display and fan controls of the PoE HAT are accessed through the [I²C interface](https://de.wikipedia.org/wiki/I%C2%B2C), which may be deactivated by default on your Raspi. To activate it on Raspberry Pi OS, run

    sudo raspi-config nonint do_i2c 0

or call `raspi-config` without params and use the menu (`Interface Options` -> `I2C` -> `Yes`). You may need to reboot your Raspi to apply the change.

Next we install required packages: Python and pip are needed; the remaining packages are dependencies of the Pillow graphics library.

    sudo apt install python3 python3-pip libjpeg-dev zlib1g-dev libfreetype6-dev liblcms2-dev libopenjp2-7 libtiff5 libsdl2-image-2.0-0

Now we are ready to install `raspi-poe-mon` from PyPI:

    pip install raspi-poe-mon

If you are using Python 3.11 or higher, you may be greeted by `error: externally-managed-environment`. You can install raspi-poe-mon in a virtual environment to avoid this message, but then you can only use the `raspi-poe-mon` CLI when you enable this virtualenv first. If you want to ignore this annoyance, you can just add the `--break-system-packages` flag and go on with your day.

### Troubleshooting

* the `raspi-poe-mon` command is not available after installation? Make sure that `$HOME/.local/bin` is on your `PATH`! On Raspi OS, this is already the case, but when this folder was just created, you might have to open a new terminal session first.
* if you try to install Python packages via pip on Raspberry Pi OS, you may get stuck due to [issues with gnome-keyring](https://github.com/pypa/pip/issues/7883). If this is the case, please `export PYTHON_KEYRING_BACKEND=keyring.backends.null.Keyring` and try again. You may want to add this to your `.profile` if the issue persists.
* `pip install raspi-poe-mon` is still hangig or really slow? I can confirm that sometimes, downloading packages from PyPI on Raspi OS can take quite a while and I have no idea why... Try `pip install raspi-poe-mon -vvv` to get some status info and let it do it's thing for a couple of minutes.
* the `pip` command is not available, even after installing `python3-pip`? try `pip3` instead.

### Handling OLED burn-in

The light output of pixels in OLED displays generally decreases over time when used. Modern OLED panels in TVs and computer monitors can compensate for this kind of degradation, but the cheap monochrome display that comes with the PoE HAT does not. If usage patterns on displays are unevenly distributed, you can see pixels that are weaker than others, and over time ghost images may appear.

After a year, the display can look like this (all pixels were set to 100% brightness for this effect):

![](https://raw.githubusercontent.com/klamann/raspi-poe-mon/main/docs/oled-burn-in.webp)

*Can you guess my local IP address?*

With this display model, there's not much we can do to slow this process, except *not* using the display. [This video](https://youtu.be/GWOFF5tMv_A?t=670) shows the burn-in effect for monochrome OLED displays over the duration of a year.

The good news is: The OLED display usually does not break, even when lots of pixels are affected by burn-in. The bad news: We can't control the voltage for individual pixels and things like screensavers don't work for the kind of panel we're dealing with.

So what can we do?

* decrease display brightness. With the `--brightness` flag, we can set the brightness level from 0 to 100%, the default is 50%. The 100% setting is probably more than you need when indoors; try to find the optimal setting for your environment.
* only turn the display on every so often. Use the `--frame-time` and `--blank-time` parameters to do so, e.g. `--frame-time 5 --blank-time 10` will turn on the display for 5 seconds and then turn it off for 10 seconds.
* turn off the display when you don't need it with the `--no-display` flag. Of course, doing this manually would be impractical, but you can set up cron jobs in combination with the `--timeout` flag to schedule times when the display is on.

None of these options are a silver bullet and some may be too annoying for you to consider, but that's all I was able to come up with to improve the lifetime of these displays. If all else fails, you can buy a compatible OLED display and replace the one affected by burn-in. Any monochrome I2C display with 128x32 pixels should work, some soldering might be required.

## User Guide

After installation, the `raspi-poe-mon` command should be available on your terminal. Get usage instructions with

    raspi-poe-mon --help

To activate the display and fan controller, use

    raspi-poe-mon run

This will show live system information and control the fan on the PoE HAT based on chip temperature. Each command has its own help section that lists all avilable options, e.g. `raspi-poe-mon run --help`. This will tell you how to change the fan controller settings

    raspi-poe-mon run --fan-off-temp 50 --fan-on-temp 60 --brightness 80

With this setting, the fan will turn on when the CPU reaches 60°C and turn off after it has cooled down to 50°C. The display's brightness level is set to 80%.

### Start on Boot

The display and fan controller will only stay active as long as the process is running. To have it start automatically on boot and keep it running in the background, we can create a system service. On Raspi OS, create a new file `/etc/systemd/system/raspi-poe-mon.service` with this content:

```
[Unit]
Description=Raspi PoE HAT Monitor
After=network.target

[Service]
ExecStart=/home/raspi/.local/bin/raspi-poe-mon run --fan-off-temp 50 --fan-on-temp 60
User=raspi
Restart=always
RestartSec=30

[Install]
WantedBy=multi-user.target
```

You may have to change `User=` and adjust the path to the executable in `ExecStart=` (find it with `which raspi-poe-mon`). Here you can also change the fan control settings to your liking. Now you can activate the service with

    sudo systemctl daemon-reload
    sudo systemctl enable raspi-poe-mon
    sudo service raspi-poe-mon start

Enjoy!

### Command Line Options

**Usage**:

```console
$ raspi-poe-mon [OPTIONS] COMMAND [ARGS]...
```

**Options**:

* `-v, --version`: print the program version and exit
* `--install-completion`: Install completion for the current shell.
* `--show-completion`: Show completion for the current shell, to copy it or customize the installation.
* `--help`: Show this message and exit.

**Commands**:

* `display`: turn the display of the PoE HAT on or off...
* `fan`: control the fan of the PoE HAT; no speed...
* `run`: activate the display and fan controller.
* `text`: show some text of your own choosing on the...

#### `raspi-poe-mon run`

activate the display and fan controller.

the display will show system information (IP address, CPU, RAM, disk, temperature).
the fan will turn on when CPU temperature gets above a certain threshold.

**Usage**:

```console
$ raspi-poe-mon run [OPTIONS]
```

**Options**:

* `--fan-on-temp FLOAT`: turn on the fan when CPU temperature rises above this value (in °C)  [default: 60]
* `--fan-off-temp FLOAT`: turn off the fan when CPU temperature drops below this value (in °C)  [default: 50]
* `--frame-time FLOAT`: show a new frame on the display every n seconds (excluding blank time)  [default: 2.0]
* `--blank-time FLOAT`: bank time (seconds) between frames where the display is turned off  [default: 0.0]
* `--brightness INTEGER RANGE`: brightness level of the display in percent  [default: 50; 0<=x<=100]
* `--timeout FLOAT RANGE`: terminate after n seconds; 0 means run until interrupted  [default: 0.0; x>=0]
* `--display / --no-display`: show system information on the display  [default: display]
* `--fan / --no-fan`: control fan speed based on temperature  [default: fan]
* `--verbose`: log detailed status information
* `--dry`: dry run - simulate commands without accessing the PoE HAT
* `--profiling`: log profiling information, very verbose
* `--help`: Show this message and exit.

#### `raspi-poe-mon display`

turn the display of the PoE HAT on or off (on means all white, useful to detect pixel failures)

turning the display OFF with this command should usually not be necessary, since raspi-poe-mon
will always turn off the display when it terminates. But if your display is stuck in the 'on'
state for some reason, you can explicitly turn it off with this command.

turning the display ON will not show any information, but it will light up all pixels, which
can be useful to detect pixel failures. Unfortunately, pixel burn-in is a known issue with
these cheap OLED displays.

**Usage**:

```console
$ raspi-poe-mon display [OPTIONS] SWITCH:{off|on}
```

**Arguments**:

* `SWITCH:{off|on}`: turn the display OFF or ON  [required]

**Options**:

* `--help`: Show this message and exit.

#### `raspi-poe-mon fan`

control the fan of the PoE HAT; no speed control, just on and off

**Usage**:

```console
$ raspi-poe-mon fan [OPTIONS] SWITCH:{off|on}
```

**Arguments**:

* `SWITCH:{off|on}`: turn the fan OFF or ON  [required]

**Options**:

* `--help`: Show this message and exit.

## Development

To set up your local development environment, please make sure that [poetry](https://python-poetry.org/docs/#installation) is installed and updated. Then clone this repo and install the package with

    poetry install

This will create a new virtualenv in the `.venv` folder, install all dependencies and then the `raspi-poe-mon` package. You should now be able to access the CLI with `poetry run raspi-poe-mon`.

We use `pytest` as test framework:

    poetry run pytest

To build a distribution package (wheel), please use

    poetry build

Before contributing code, please set up the pre-commit hooks to reduce errors and ensure consistency

    pre-commit install

## Tips & Tricks

* you can [increase the I2C baudrate](https://luma-oled.readthedocs.io/en/latest/hardware.html#enabling-the-i2c-interface) from the default 100KHz to 400KHz by adding `dtparam=i2c_arm=on,i2c_baudrate=400000` to `/boot/config.txt` and then rebooting. This will allow you to run animations at a higher framerate, but it is not required for the default status display.
* `raspi-poe-mon` might leak memory when running for a long time on specific combinations of OS and Python interpreter. I was unable to debug this issue, because the leak goes away when you attach a profiler (stupid heisenbug). If you are affected, please try to upgrade to a newer Python version or set up a cron job to restart `raspi-poe-mon` once per day.

## Links

* [raspi-poe-mon](https://github.com/klamann/raspi-poe-mon) (this project) on GitHub
* [RustBerry-PoE-Monitor](https://github.com/jackra1n/RustBerry-PoE-Monitor), another implementation in Rust
* [Waveshare: PoE HAT (B)](https://www.waveshare.com/wiki/PoE_HAT_(B))
* [luma.oled](https://github.com/rm-hull/luma.oled)
* [pillow (PIL) dependencies](https://pillow.readthedocs.io/en/latest/installation.html#external-libraries)
* [Increase I2C baudrate from the default of 100KHz to 400KHz](https://luma-oled.readthedocs.io/en/latest/hardware.html#enabling-the-i2c-interface)
* [Font: CG pixel 4x5](https://fontstruct.com/fontstructions/show/1404171/cg-pixel-4x5)

## License

This project is available under the terms of the [MIT License](./LICENSE).


            

Raw data

            {
    "_id": null,
    "home_page": "https://github.com/klamann/raspi-poe-mon",
    "name": "raspi-poe-mon",
    "maintainer": null,
    "docs_url": null,
    "requires_python": "<4.0,>=3.9",
    "maintainer_email": null,
    "keywords": "raspberry-pi, oled-display, monitoring, waveshare, power-over-ethernet",
    "author": "Sebastian Straub",
    "author_email": "sstraub@posteo.de",
    "download_url": "https://files.pythonhosted.org/packages/6d/69/3e601be0eaa24689389b5394611d26c44bcb2fed3f18adbde1d740045033/raspi_poe_mon-1.0.0.tar.gz",
    "platform": null,
    "description": "# Raspi PoE HAT Monitor\n\n[![build](https://github.com/klamann/raspi-poe-mon/actions/workflows/build.yml/badge.svg?branch=main&event=push)](https://github.com/klamann/raspi-poe-mon/actions/workflows/build.yml)\n[![PyPI](https://img.shields.io/pypi/v/raspi-poe-mon)](https://pypi.org/project/raspi-poe-mon/)\n[![PyPI - License](https://img.shields.io/pypi/l/raspi-poe-mon)](https://github.com/klamann/raspi-poe-mon/blob/main/LICENSE)\n![Raspi](https://img.shields.io/badge/Raspberry%20Pi-A22846?logo=Raspberry%20Pi&logoColor=white)\n![Python](https://img.shields.io/badge/python-3670A0?logo=python&logoColor=ffdd54)\n\nA controller for the display and fan of the Raspberry Pi Power Over Ethernet HAT (Type B), compatible with Raspberry Pi 3B+/4B.\n\n![](https://raw.githubusercontent.com/klamann/raspi-poe-mon/main/docs/raspi-poe-hat-2k.webp)\n\nThe PoE HAT ([Waveshare SKU 18014](https://www.waveshare.com/wiki/PoE_HAT_(B))) allows you to deliver gigabit ethernet connectivity and power supply to your Raspi using a single connection (if you have a PoE capable switch/router). While PoE works without additional drivers, there is also a fan and a 128x32 pixel monochrome display on the HAT, both of which can be controlled with this software.\n\nWarning: The OLED display is susceptible to burn-in, pixel brightness will deteriorate over time - refer to section [Handling OLED burn-in](#handling-oled-burn-in) for more information.\n\n## Features\n\n* automatic fan control to reach your desired temperature target\n* show status information on the display: IP address, CPU usage, CPU temperature, RAM usage, disk usage.\n* manual fan control via CLI\n* show custom text via CLI (wip)\n\n## Getting Started\n\nIf you are running the latest [Raspberry Pi OS](https://www.raspberrypi.com/software/), everything should already be set up the way we need it and you can run\n\n    pip install raspi-poe-mon --break-system-packages\n\nThe scary `--break-system-packages` flag just tells Python that you want to install this package globally rather than in a virtualenv. I don't agree with the framing here, in my opinion it's fine to install Python packages globally on your Raspi.\n\nAfter installation finished, you can call\n\n    raspi-poe-mon run\n\nand the OLED disply should show you some info. Learn more about the available options with `raspi-poe-mon --help`. Each command has its own help section, e.g. `raspi-poe-mon run --help`.\n\n### Install Guide\n\nIf you want to install `raspi-poe-mon` on older Raspberry Pi OS or on a different OS, this section is for you.\n\nThe OLED display and fan controls of the PoE HAT are accessed through the [I\u00b2C interface](https://de.wikipedia.org/wiki/I%C2%B2C), which may be deactivated by default on your Raspi. To activate it on Raspberry Pi OS, run\n\n    sudo raspi-config nonint do_i2c 0\n\nor call `raspi-config` without params and use the menu (`Interface Options` -> `I2C` -> `Yes`). You may need to reboot your Raspi to apply the change.\n\nNext we install required packages: Python and pip are needed; the remaining packages are dependencies of the Pillow graphics library.\n\n    sudo apt install python3 python3-pip libjpeg-dev zlib1g-dev libfreetype6-dev liblcms2-dev libopenjp2-7 libtiff5 libsdl2-image-2.0-0\n\nNow we are ready to install `raspi-poe-mon` from PyPI:\n\n    pip install raspi-poe-mon\n\nIf you are using Python 3.11 or higher, you may be greeted by `error: externally-managed-environment`. You can install raspi-poe-mon in a virtual environment to avoid this message, but then you can only use the `raspi-poe-mon` CLI when you enable this virtualenv first. If you want to ignore this annoyance, you can just add the `--break-system-packages` flag and go on with your day.\n\n### Troubleshooting\n\n* the `raspi-poe-mon` command is not available after installation? Make sure that `$HOME/.local/bin` is on your `PATH`! On Raspi OS, this is already the case, but when this folder was just created, you might have to open a new terminal session first.\n* if you try to install Python packages via pip on Raspberry Pi OS, you may get stuck due to [issues with gnome-keyring](https://github.com/pypa/pip/issues/7883). If this is the case, please `export PYTHON_KEYRING_BACKEND=keyring.backends.null.Keyring` and try again. You may want to add this to your `.profile` if the issue persists.\n* `pip install raspi-poe-mon` is still hangig or really slow? I can confirm that sometimes, downloading packages from PyPI on Raspi OS can take quite a while and I have no idea why... Try `pip install raspi-poe-mon -vvv` to get some status info and let it do it's thing for a couple of minutes.\n* the `pip` command is not available, even after installing `python3-pip`? try `pip3` instead.\n\n### Handling OLED burn-in\n\nThe light output of pixels in OLED displays generally decreases over time when used. Modern OLED panels in TVs and computer monitors can compensate for this kind of degradation, but the cheap monochrome display that comes with the PoE HAT does not. If usage patterns on displays are unevenly distributed, you can see pixels that are weaker than others, and over time ghost images may appear.\n\nAfter a year, the display can look like this (all pixels were set to 100% brightness for this effect):\n\n![](https://raw.githubusercontent.com/klamann/raspi-poe-mon/main/docs/oled-burn-in.webp)\n\n*Can you guess my local IP address?*\n\nWith this display model, there's not much we can do to slow this process, except *not* using the display. [This video](https://youtu.be/GWOFF5tMv_A?t=670) shows the burn-in effect for monochrome OLED displays over the duration of a year.\n\nThe good news is: The OLED display usually does not break, even when lots of pixels are affected by burn-in. The bad news: We can't control the voltage for individual pixels and things like screensavers don't work for the kind of panel we're dealing with.\n\nSo what can we do?\n\n* decrease display brightness. With the `--brightness` flag, we can set the brightness level from 0 to 100%, the default is 50%. The 100% setting is probably more than you need when indoors; try to find the optimal setting for your environment.\n* only turn the display on every so often. Use the `--frame-time` and `--blank-time` parameters to do so, e.g. `--frame-time 5 --blank-time 10` will turn on the display for 5 seconds and then turn it off for 10 seconds.\n* turn off the display when you don't need it with the `--no-display` flag. Of course, doing this manually would be impractical, but you can set up cron jobs in combination with the `--timeout` flag to schedule times when the display is on.\n\nNone of these options are a silver bullet and some may be too annoying for you to consider, but that's all I was able to come up with to improve the lifetime of these displays. If all else fails, you can buy a compatible OLED display and replace the one affected by burn-in. Any monochrome I2C display with 128x32 pixels should work, some soldering might be required.\n\n## User Guide\n\nAfter installation, the `raspi-poe-mon` command should be available on your terminal. Get usage instructions with\n\n    raspi-poe-mon --help\n\nTo activate the display and fan controller, use\n\n    raspi-poe-mon run\n\nThis will show live system information and control the fan on the PoE HAT based on chip temperature. Each command has its own help section that lists all avilable options, e.g. `raspi-poe-mon run --help`. This will tell you how to change the fan controller settings\n\n    raspi-poe-mon run --fan-off-temp 50 --fan-on-temp 60 --brightness 80\n\nWith this setting, the fan will turn on when the CPU reaches 60\u00b0C and turn off after it has cooled down to 50\u00b0C. The display's brightness level is set to 80%.\n\n### Start on Boot\n\nThe display and fan controller will only stay active as long as the process is running. To have it start automatically on boot and keep it running in the background, we can create a system service. On Raspi OS, create a new file `/etc/systemd/system/raspi-poe-mon.service` with this content:\n\n```\n[Unit]\nDescription=Raspi PoE HAT Monitor\nAfter=network.target\n\n[Service]\nExecStart=/home/raspi/.local/bin/raspi-poe-mon run --fan-off-temp 50 --fan-on-temp 60\nUser=raspi\nRestart=always\nRestartSec=30\n\n[Install]\nWantedBy=multi-user.target\n```\n\nYou may have to change `User=` and adjust the path to the executable in `ExecStart=` (find it with `which raspi-poe-mon`). Here you can also change the fan control settings to your liking. Now you can activate the service with\n\n    sudo systemctl daemon-reload\n    sudo systemctl enable raspi-poe-mon\n    sudo service raspi-poe-mon start\n\nEnjoy!\n\n### Command Line Options\n\n**Usage**:\n\n```console\n$ raspi-poe-mon [OPTIONS] COMMAND [ARGS]...\n```\n\n**Options**:\n\n* `-v, --version`: print the program version and exit\n* `--install-completion`: Install completion for the current shell.\n* `--show-completion`: Show completion for the current shell, to copy it or customize the installation.\n* `--help`: Show this message and exit.\n\n**Commands**:\n\n* `display`: turn the display of the PoE HAT on or off...\n* `fan`: control the fan of the PoE HAT; no speed...\n* `run`: activate the display and fan controller.\n* `text`: show some text of your own choosing on the...\n\n#### `raspi-poe-mon run`\n\nactivate the display and fan controller.\n\nthe display will show system information (IP address, CPU, RAM, disk, temperature).\nthe fan will turn on when CPU temperature gets above a certain threshold.\n\n**Usage**:\n\n```console\n$ raspi-poe-mon run [OPTIONS]\n```\n\n**Options**:\n\n* `--fan-on-temp FLOAT`: turn on the fan when CPU temperature rises above this value (in \u00b0C)  [default: 60]\n* `--fan-off-temp FLOAT`: turn off the fan when CPU temperature drops below this value (in \u00b0C)  [default: 50]\n* `--frame-time FLOAT`: show a new frame on the display every n seconds (excluding blank time)  [default: 2.0]\n* `--blank-time FLOAT`: bank time (seconds) between frames where the display is turned off  [default: 0.0]\n* `--brightness INTEGER RANGE`: brightness level of the display in percent  [default: 50; 0<=x<=100]\n* `--timeout FLOAT RANGE`: terminate after n seconds; 0 means run until interrupted  [default: 0.0; x>=0]\n* `--display / --no-display`: show system information on the display  [default: display]\n* `--fan / --no-fan`: control fan speed based on temperature  [default: fan]\n* `--verbose`: log detailed status information\n* `--dry`: dry run - simulate commands without accessing the PoE HAT\n* `--profiling`: log profiling information, very verbose\n* `--help`: Show this message and exit.\n\n#### `raspi-poe-mon display`\n\nturn the display of the PoE HAT on or off (on means all white, useful to detect pixel failures)\n\nturning the display OFF with this command should usually not be necessary, since raspi-poe-mon\nwill always turn off the display when it terminates. But if your display is stuck in the 'on'\nstate for some reason, you can explicitly turn it off with this command.\n\nturning the display ON will not show any information, but it will light up all pixels, which\ncan be useful to detect pixel failures. Unfortunately, pixel burn-in is a known issue with\nthese cheap OLED displays.\n\n**Usage**:\n\n```console\n$ raspi-poe-mon display [OPTIONS] SWITCH:{off|on}\n```\n\n**Arguments**:\n\n* `SWITCH:{off|on}`: turn the display OFF or ON  [required]\n\n**Options**:\n\n* `--help`: Show this message and exit.\n\n#### `raspi-poe-mon fan`\n\ncontrol the fan of the PoE HAT; no speed control, just on and off\n\n**Usage**:\n\n```console\n$ raspi-poe-mon fan [OPTIONS] SWITCH:{off|on}\n```\n\n**Arguments**:\n\n* `SWITCH:{off|on}`: turn the fan OFF or ON  [required]\n\n**Options**:\n\n* `--help`: Show this message and exit.\n\n## Development\n\nTo set up your local development environment, please make sure that [poetry](https://python-poetry.org/docs/#installation) is installed and updated. Then clone this repo and install the package with\n\n    poetry install\n\nThis will create a new virtualenv in the `.venv` folder, install all dependencies and then the `raspi-poe-mon` package. You should now be able to access the CLI with `poetry run raspi-poe-mon`.\n\nWe use `pytest` as test framework:\n\n    poetry run pytest\n\nTo build a distribution package (wheel), please use\n\n    poetry build\n\nBefore contributing code, please set up the pre-commit hooks to reduce errors and ensure consistency\n\n    pre-commit install\n\n## Tips & Tricks\n\n* you can [increase the I2C baudrate](https://luma-oled.readthedocs.io/en/latest/hardware.html#enabling-the-i2c-interface) from the default 100KHz to 400KHz by adding `dtparam=i2c_arm=on,i2c_baudrate=400000` to `/boot/config.txt` and then rebooting. This will allow you to run animations at a higher framerate, but it is not required for the default status display.\n* `raspi-poe-mon` might leak memory when running for a long time on specific combinations of OS and Python interpreter. I was unable to debug this issue, because the leak goes away when you attach a profiler (stupid heisenbug). If you are affected, please try to upgrade to a newer Python version or set up a cron job to restart `raspi-poe-mon` once per day.\n\n## Links\n\n* [raspi-poe-mon](https://github.com/klamann/raspi-poe-mon) (this project) on GitHub\n* [RustBerry-PoE-Monitor](https://github.com/jackra1n/RustBerry-PoE-Monitor), another implementation in Rust\n* [Waveshare: PoE HAT (B)](https://www.waveshare.com/wiki/PoE_HAT_(B))\n* [luma.oled](https://github.com/rm-hull/luma.oled)\n* [pillow (PIL) dependencies](https://pillow.readthedocs.io/en/latest/installation.html#external-libraries)\n* [Increase I2C baudrate from the default of 100KHz to 400KHz](https://luma-oled.readthedocs.io/en/latest/hardware.html#enabling-the-i2c-interface)\n* [Font: CG pixel 4x5](https://fontstruct.com/fontstructions/show/1404171/cg-pixel-4x5)\n\n## License\n\nThis project is available under the terms of the [MIT License](./LICENSE).\n\n",
    "bugtrack_url": null,
    "license": "MIT",
    "summary": "A controller for the display and fan of the Raspberry Pi Power Over Ethernet HAT (Type B), compatible with Raspberry Pi 3B+/4B",
    "version": "1.0.0",
    "project_urls": {
        "Homepage": "https://github.com/klamann/raspi-poe-mon",
        "Repository": "https://github.com/klamann/raspi-poe-mon"
    },
    "split_keywords": [
        "raspberry-pi",
        " oled-display",
        " monitoring",
        " waveshare",
        " power-over-ethernet"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "beb204e7c5b46908a88910d723824b71598357fa6fc9d86d992d5407e558b5f3",
                "md5": "a13d67f009a3f53cc9a70880a556c601",
                "sha256": "889bafb42889bd20157b86feefeb2babd93065f87a92a5cd5eaad387b92e45aa"
            },
            "downloads": -1,
            "filename": "raspi_poe_mon-1.0.0-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "a13d67f009a3f53cc9a70880a556c601",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": "<4.0,>=3.9",
            "size": 29172,
            "upload_time": "2024-09-23T18:18:39",
            "upload_time_iso_8601": "2024-09-23T18:18:39.465787Z",
            "url": "https://files.pythonhosted.org/packages/be/b2/04e7c5b46908a88910d723824b71598357fa6fc9d86d992d5407e558b5f3/raspi_poe_mon-1.0.0-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "6d693e601be0eaa24689389b5394611d26c44bcb2fed3f18adbde1d740045033",
                "md5": "7d59d6eb54bd9f1fea3a103590a0a0d6",
                "sha256": "c09952c18b92a9741c5002527d1de2b0aa159f7236868be737bbc9a050a25ced"
            },
            "downloads": -1,
            "filename": "raspi_poe_mon-1.0.0.tar.gz",
            "has_sig": false,
            "md5_digest": "7d59d6eb54bd9f1fea3a103590a0a0d6",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": "<4.0,>=3.9",
            "size": 29033,
            "upload_time": "2024-09-23T18:18:40",
            "upload_time_iso_8601": "2024-09-23T18:18:40.750748Z",
            "url": "https://files.pythonhosted.org/packages/6d/69/3e601be0eaa24689389b5394611d26c44bcb2fed3f18adbde1d740045033/raspi_poe_mon-1.0.0.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2024-09-23 18:18:40",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "klamann",
    "github_project": "raspi-poe-mon",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": true,
    "lcname": "raspi-poe-mon"
}
        
Elapsed time: 1.82156s