I have reviewed this git project and think it's a superior solution. Try it!
This script has been tested on Raspberry Pi OS, Buster (Legacy) and Bullseye only. This installation is simpler that the Waveshare provided instructions.
The supplied program will control the fan but for it to work you must slide the FAN switch on the HAT to the P0 position.
To use the script you can download the zip file and unzip it or, copy and paste the RAW version setup-poe-hat.sh and paste it into an editor. I reccomend you use nano setup-poe-hat.sh
in a Pi terminal or ssh session.
Then run bash setup-poe-hat.sh
When finished it will delete itself and any files needed only for installation. This script can be rerun. It will do a new install of the Waveshare software.
When complete a systemd service named poe-hat.service
will run and start on every boot.
to remove run these commands
sudo systemctl disable poe-hat.service sudo systemctl stop poe-hat.service rm -rf ~/.poe-hat
Hey,
I tried another approach.
Personally I don't like having a lot dependencies around - like python. Especially for such a simple task like setting a string or turning the fan on and off. For that reason I wrote a very simple c++ which program you are able to call in your shell.
It's possible to view up to 4 rows. The text size is adapted automatically.
It comes with a very simple bash script that you can customize in any way you like. It simply calls that c++ program and doesn't need to be recompiled.
In case you are running docker, you might want to try the alpine based image.
Here are some example calls..
https://github.com/pietmacom/waveshare-poe-hat-b-cli
https://hub.docker.com/r/pietmacom/waveshare-poe-hat-b-cli
Hope that helps!
Marti