deskpi-team / deskpi_v1 Goto Github PK
View Code? Open in Web Editor NEWThis is deskpi version 4's driver, it contains front USB driver and cut power from daughter board driver.
License: MIT License
This is deskpi version 4's driver, it contains front USB driver and cut power from daughter board driver.
License: MIT License
@yoyojacky Hi, it would be very simple for you to implement a PWM fan control service for the Pi4 with respect to the DeskPi Lite case - this case hardware uses direct GPIO header connections for the included PWM capable fan. Like in your bigger DeskPi case software, you could easily change from a /dev/ttyUSB0 to a GPIO PWM fan control service.
For anyone else wanting to implement some form of PWM fan control, please see the included python3 script code below. This will enable: -
< 40'c - Fan 75%, for a minimum of 60sec
40'c to 45'c - Fan 85%, for a minimum of 120sec
> 45'c - Fan 100%, for a minimum of 180sec
In everyday use, this script offers good temperatrue control, with the CPU temp rarely reaches > 45'c and general fan noise is very low and still keeps good control via the PWM fan vs standard Raspberry Pi OS PWM fan control via /boot/config.txt or raspi-config.
#!/usr/bin/python3
import RPi.GPIO as GPIO
import time
import subprocess
GPIO.setmode(GPIO.BCM)
GPIO.setup(14, GPIO.OUT)
pwm = GPIO.PWM(14,100)
print("\nPress Ctrl+C to quit \n")
dc = 0
pwm.start(dc)
try:
while True:
temp = subprocess.getoutput("vcgencmd measure_temp|sed 's/[^0-9.]//g'")
if round(float(temp)) >= 45:
dc = 100
pwm.ChangeDutyCycle(dc)
print("CPU Temp:",float(temp)," Fan duty cycle:",dc)
time.sleep(180.0)
if round(float(temp)) >= 40:
dc = 85
pwm.ChangeDutyCycle(dc)
print("CPU Temp:",float(temp)," Fan duty cycle:",dc)
time.sleep(120.0)
else:
dc = 70
pwm.ChangeDutyCycle(dc)
print("CPU Temp:",float(temp)," Fan duty cycle:",dc)
time.sleep(60.00)
except KeyboardInterrupt:
pwm.stop()
GPIO.cleanup()
print("Ctrl + C pressed -- Ending program")
Greetings,
When the system is shutdown from terminal or EmulationStation, on Retropie, the adapter board does not cut power off to the Raspberry Pi.
If i double click the power button, the adapter board does issue a shutdown command to the Pi and cuts power after shutdown.
There were no errors when installing via install.sh script.
Thank you. Best regards
I have a desk pi lite
i installed this and the only way i get the power button to work right i have to have the swtich set to D and that just kills the power. not a safes hut down, but after looking at what happens when it installs
/install.sh: line 6: cd: /root/deskpi_v1/: No such file or directory
[info] Enable dwc2 on Host Mode.
[info] dwc2 has been setting up successfully.
[info] DeskPi v1 safe-cut-off-power after system halt daemon.
./install.sh: line 26: cd: /root/deskpi_v1/drivers/c/: No such file or directory
cp: cannot stat '/root/deskpi_v1/drivers/c/safecutoffpower': No such file or directory
chmod: cannot access '/usr/bin/safecutoffpower': No such file or directory
[info] DeskPi V1 Service configuration finished..
[info] DeskPi V1 Service Load module..
Created symlink /etc/systemd/system/halt.target.wants/deskpi_v1-safecutoffpower.service → /lib/systemd/system/deskpi_v1-safecutoffpower.service.
Created symlink /etc/systemd/system/shutdown.target.wants/deskpi_v1-safecutoffpower.service → /lib/systemd/system/deskpi_v1-safecutoffpower.service.
Created symlink /etc/systemd/system/poweroff.target.wants/deskpi_v1-safecutoffpower.service → /lib/systemd/system/deskpi_v1-safecutoffpower.service.
[ ok ] DeskPi V1 Driver installation finished successfully..
[info] System will reboot in 5 seconds to take effect..
it fails when trying to do whatever in the root dir
so i guessing thats the issue.
any pointers on how to fix this?
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.