GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — GitHub - doingit4science/EP-0152: Updated Python for 52Pi EP-0152 Raspberry Pi Fan Expansion Board

BranchesTags
Open more actions menu

Latest commit

 

History

13 Commits
13 Commits

Folders and files

NameName
Last commit message
Last commit date
Fan
Fan
 
 
LEDs
LEDs
 
 
OLED
OLED
 
 
.gitignore
.gitignore
 
 
LICENSE
LICENSE
 
 
README.md
README.md
 
 

Repository files navigation

52Pi EP-0152 Raspberry Pi Fan Expansion Board - UPDATED for Raspberry Pi 5

Updated source code for the 52Pi EP-0152 Raspberry Pi Fan Expansion Board, sold on Amazon as GeeekPi Fan Hat for Raspberry Pi 4 Model B, PWM Fan GPIO Expansion Board with 0.91inch OLED Display for Raspberry Pi 4B/3B+/3B/2B.

The original code listed for the fan hat is woefully out of date, as it won't work for the Raspberry Pi 5 and doesn't use the PEP 668 specification, which is now required for Rasberry Pi OS.

This repository is compatible with the following Raspberry Pi versions on Raspberry Pi OS (64-bit) / Debian GNU/Linux 12 (bookworm):

  • Raspberry Pi 5B ( ✅ - Tested)
  • Raspberry Pi 4B ( ✅ - Tested)
  • Raspberry Pi 3B+/3B ( ❓ - Untested)
  • Raspberry Pi 2B ( ❓ - Untested)

Assembly Steps

How to assemble the Fan hat.

Python Requirements

  1. Create a Python Virtual Environment to install pip packages.

    sudo -i
    python3 -m venv /opt/EP-0152
    source /opt/EP-0152/bin/activate
  2. Install pip3 packages:

    pip3 install board pillow adafruit_circuitPython_ssd1306
    • For Raspbery Pi 5:

      pip3 uninstall RPI.GPIO
      pip3 install rpi-lgpio
  3. Remember to exit from sudo -i:

    exit

Fan Control

I've added @franganghi's version of Raspberry-Pi5-PWM-Fan-Control as a submodule to this repository. To pull the submodule after cloning this repository, run:

cd EP-0152
git submodule update --init --recursive

After doing so, follow the instructions listed in the README to install as a Linux service.

PWM LEDs

LEDs Installation

cd EP-0152/LEDs
sudo mkdir /opt/EP-0152/LEDs
sudo cp ep0152ledpwm.service /lib/systemd/system/ep0152ledpwm.service
sudo cp LEDsV2.* /opt/EP-0152/LEDs/.
sudo chmod 644 /lib/systemd/system/ep0152ledpwm.service
sudo chmod +x /opt/EP-0152/LEDs/LEDsV2.py
sudo chmod +x /opt/EP-0152/LEDs/LEDsV2.sh
sudo systemctl daemon-reload
sudo systemctl enable --now ep0152ledpwm.service

LEDs Check Status

$ sudo systemctl status ep0152ledpwm.service
● ep0152ledpwm.service - EP-0152 LEDs PWM Pulse
     Loaded: loaded (/lib/systemd/system/ep0152ledpwm.service; enabled; preset: enabled)
     Active: active (running) since Fri 2024-06-21 10:34:34 PDT; 1h 13min ago
   Main PID: 2701 (LEDsV2.sh)
      Tasks: 5 (limit: 9248)
        CPU: 3.627s
     CGroup: /system.slice/ep0152ledpwm.service
             ├─2701 /bin/bash /opt/EP-0152/LEDs/LEDsV2.sh
             └─2710 python3 /opt/EP-0152/LEDs/LEDsV2.py

Jun 21 10:34:34 host systemd[1]: Started ep0152ledpwm.service - EP-0152 LEDs PWM Pulse.

LEDs Uninstallation

sudo systemctl stop ep0152ledpwm.service
sudo systemctl disable ep0152ledpwm.service
sudo systemctl daemon-reload
sudo rm /lib/systemd/system/ep0152ledpwm.service
sudo rm -rf /opt/EP-0152/LEDs

OLED Screen

Credit to @AmazonShopper for providing the edits to the original code.

OLED Installation

cd EP-0152/OLED
sudo mkdir /opt/EP-0152/OLED
sudo cp ep0152oled.service /lib/systemd/system/ep0152oled.service
sudo cp oledV2.py /opt/EP-0152/OLED/.
sudo cp OLED.sh /opt/EP-0152/OLED/.
sudo chmod 644 /lib/systemd/system/ep0152oled.service
sudo chmod +x /opt/EP-0152/LEDs/oledV2.py
sudo chmod +x /opt/EP-0152/LEDs/OLED.sh
sudo systemctl daemon-reload
sudo systemctl enable --now ep0152oled.service

OLED Check Status

$ sudo systemctl status ep0152oled.service
● ep0152oled.service - EP-0152 OLED Monitor
     Loaded: loaded (/lib/systemd/system/ep0152oled.service; enabled; preset: enabled)
     Active: active (running) since Fri 2024-06-21 10:34:34 PDT; 1h 18min ago
   Main PID: 2703 (OLED.sh)
      Tasks: 2 (limit: 9248)
        CPU: 1min 729ms
     CGroup: /system.slice/ep0152oled.service
             ├─2703 /bin/bash /opt/EP-0152/OLED/OLED.sh
             └─2711 python3 /opt/EP-0152/OLED/oledV2.py

Jun 21 10:34:34 host systemd[1]: Started ep0152oled.service - EP-0152 OLED Monitor.

OLED Uninstallation

sudo systemctl stop ep0152oled.service
sudo systemctl disable ep0152oled.service
sudo systemctl daemon-reload
sudo rm /lib/systemd/system/ep0152oled.service
sudo rm -rf /opt/EP-0152/OLED

Uninstallation of Python VEnv

sudo rm -rf /opt/EP-0152

About

Updated Python for 52Pi EP-0152 Raspberry Pi Fan Expansion Board

wiki.52pi.com/index.php?title=EP-0152

Topics

52pi52pi-ep-0152ep-0152ep0152pep-668raspberry-piraspberry-pi-gpioraspberrypirpirpi2rpi3rpi3brpi3b-plusrpi4rpi4brpi5rpi5-gpio

Resources

Readme
Apache-2.0 license
Activity

Stars

6 stars

Watchers

1 watching

Forks

0 forks
Report repository

Releases

Packages

Contributors

Languages

You are visitor 01402792 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.