mirror of
https://github.com/clockworkpi/DevTerm.git
synced 2026-03-19 10:22:44 +01:00
Merge remote-tracking branch 'origin/main'
This commit is contained in:
@@ -2,7 +2,7 @@
|
||||
|
||||
Devterm R01
|
||||
|
||||
`d1\_twm.tar.bz2` devterm r01 stock os image twm configs
|
||||
`d1_twm.tar.bz2` devterm r01 stock os image twm configs
|
||||
```
|
||||
.
|
||||
..
|
||||
@@ -17,6 +17,11 @@ Devterm R01
|
||||
readme
|
||||
```
|
||||
|
||||
`tar xpjfv d1\_twm.tar.bz2 -C /home/cpi`
|
||||
`tar xpjfv d1_twm.tar.bz2 -C /home/cpi`
|
||||
|
||||
|
||||
## Expand R01 rootfs partition size
|
||||
```
|
||||
wget https://github.com/clockworkpi/DevTerm/raw/main/Code/R01/expand_devterm_d1_root.sh
|
||||
chmod +x expand_devterm_d1_root.sh
|
||||
sudo ./expand_devterm_d1_root.sh
|
||||
```
|
||||
|
||||
31
Code/R01/expand_devterm_d1_root.sh
Executable file
31
Code/R01/expand_devterm_d1_root.sh
Executable file
@@ -0,0 +1,31 @@
|
||||
#!/bin/bash
|
||||
|
||||
GREEN='\033[1;32m'
|
||||
NC='\033[0m'
|
||||
|
||||
printf "${GREEN}Installing dependencies...${NC}\n"
|
||||
|
||||
# Install growpart util
|
||||
export DEBIAN_FRONTEND=noninteractive
|
||||
sudo apt-get -y install cloud-guest-utils
|
||||
|
||||
printf "${GREEN}Growing partition...${NC}\n"
|
||||
|
||||
# Grow root partition
|
||||
sudo growpart /dev/mmcblk0 4
|
||||
|
||||
printf "${GREEN}Resizing file system...${NC}\n"
|
||||
|
||||
# Resize file system
|
||||
sudo resize2fs /dev/mmcblk0p4
|
||||
|
||||
printf "${GREEN}Cleaning up...${NC}\n"
|
||||
|
||||
# Uninstall growpart package again
|
||||
#sudo apt-get -y remove cloud-guest-utils
|
||||
|
||||
printf "\n${GREEN}Done! 😊 ${NC}\n\n"
|
||||
|
||||
#rm -rf /etc/init.d/expand_devterm_d1_root.sh
|
||||
#unlink /etc/rc3.d/S01expand_devterm_d1_root.sh
|
||||
|
||||
37
Code/devterm_fan_daemon_cm4/README.md
Normal file
37
Code/devterm_fan_daemon_cm4/README.md
Normal file
@@ -0,0 +1,37 @@
|
||||
# Fan control daemon for devterm cm4(rpi os)
|
||||
|
||||
## Install
|
||||
|
||||
**Devterm is pre-installed this package, so devterm cm4 users do not need to repeat the installation steps**
|
||||
|
||||
```
|
||||
wget -O - https://raw.githubusercontent.com/clockworkpi/apt/main/debian/KEY.gpg | sudo apt-key add -
|
||||
echo "deb https://raw.githubusercontent.com/clockworkpi/apt/main/debian/ stable main" | sudo tee -a /etc/apt/sources.list.d/clockworkpi.list
|
||||
|
||||
sudo apt update && apt install -y devterm-fan-temp-daemon-cm4
|
||||
```
|
||||
|
||||
## Change the threshold temperature
|
||||
|
||||
Edit `/usr/local/bin/temp_fan_daemon.py`
|
||||
|
||||
line starts with `MAX_TEMP=80`
|
||||
|
||||
For devterm cm4(rpi os) the recommended MAX_TEMP is in range 60-80
|
||||
|
||||
then restart systemd service to take effect
|
||||
|
||||
`sudo systemctl restart devterm-fan-temp-daemon`
|
||||
|
||||
## How to control the fan from GPIO
|
||||
|
||||
``` start the fan
|
||||
sudo gpio mode 17 out
|
||||
sudo gpio write 17 1
|
||||
```
|
||||
|
||||
```stop the fan
|
||||
sudo gpio mode 17 out
|
||||
sudo gpio write 17 0
|
||||
```
|
||||
|
||||
@@ -0,0 +1,10 @@
|
||||
[Unit]
|
||||
Description=devterm raspberry pi cm4 fan control daemon
|
||||
|
||||
[Service]
|
||||
Type=simple
|
||||
ExecStart=/usr/bin/python3 /usr/local/bin/temp_fan_daemon.py
|
||||
|
||||
|
||||
[Install]
|
||||
WantedBy=multi-user.target
|
||||
51
Code/devterm_fan_daemon_cm4/temp_fan_daemon.py
Normal file
51
Code/devterm_fan_daemon_cm4/temp_fan_daemon.py
Normal file
@@ -0,0 +1,51 @@
|
||||
###devterm raspberry pi fan control daemon
|
||||
import os
|
||||
import time
|
||||
|
||||
|
||||
def isDigit(x):
|
||||
try:
|
||||
float(x)
|
||||
return True
|
||||
except ValueError:
|
||||
return False
|
||||
|
||||
def measure_temp():
|
||||
temp = os.popen("/usr/bin/vcgencmd measure_temp").readline()
|
||||
temp2 = temp.replace("temp=","")
|
||||
temp3 = temp2.replace("'C","").strip()
|
||||
#print(temp3)
|
||||
if isDigit(temp3):
|
||||
return float(temp3)
|
||||
else:
|
||||
return 0
|
||||
|
||||
|
||||
def init_fan_gpio():
|
||||
os.popen("gpio mode 17 out")
|
||||
|
||||
def fan_on():
|
||||
init_fan_gpio()
|
||||
os.popen("gpio write 17 1")
|
||||
|
||||
def fan_off():
|
||||
init_fan_gpio()
|
||||
os.popen("gpio write 17 0")
|
||||
|
||||
|
||||
MAX_TEMP=80
|
||||
|
||||
init_fan_gpio()
|
||||
|
||||
while True:
|
||||
temp = measure_temp()
|
||||
if(temp > MAX_TEMP):
|
||||
fan_on()
|
||||
else:
|
||||
fan_off()
|
||||
|
||||
time.sleep(5)
|
||||
|
||||
|
||||
|
||||
|
||||
59
Code/patch/cm3/README.md
Normal file
59
Code/patch/cm3/README.md
Normal file
@@ -0,0 +1,59 @@
|
||||
# How to compile devterm cm3 kernel
|
||||
|
||||
## Clone kernel source code
|
||||
```
|
||||
git clone https://github.com/raspberrypi/linux.git
|
||||
cd linux
|
||||
git checkout remotes/origin/rpi-4.19.y
|
||||
```
|
||||
|
||||
## Get cross compile tools
|
||||
```
|
||||
git clone https://github.com/raspberrypi/tools.git
|
||||
```
|
||||
|
||||
## Compiling process
|
||||
```
|
||||
#must use the rpi arm-bcm2708 cross compiler tools
|
||||
|
||||
cd linux
|
||||
git apply devterm-4.19_v0.11.patch #get patch from https://github.com/clockworkpi/DevTerm/tree/main/Code/patch/cm3
|
||||
|
||||
export PATH=/data/github/raspberrypi/tools/arm-bcm2708/arm-linux-gnueabihf/bin/:$PATH ## change the arm-bcm2708 tools location for yourself
|
||||
|
||||
KERNEL=kernel7l make ARCH=arm CROSS_COMPILE=arm-linux-gnueabihf- bcm2709_defconfig
|
||||
KERNEL=kernel7l make ARCH=arm CROSS_COMPILE=arm-linux-gnueabihf- -j3
|
||||
INSTALL_MOD_PATH=./modules
|
||||
rm -rf $INSTALL_MOD_PATH
|
||||
make modules_install
|
||||
|
||||
rm modules/lib/modules/*/build
|
||||
rm modules/lib/modules/*/source
|
||||
|
||||
```
|
||||
|
||||
## /boot/config.txt
|
||||
|
||||
In config.txt,I renamed kernel7.img to devterm-kernel7.img
|
||||
|
||||
```
|
||||
ignore_lcd=1
|
||||
dtoverlay=vc4-kms-v3d,audio=0,cma-384
|
||||
dtoverlay=devterm-pmu
|
||||
dtoverlay=devterm-panel
|
||||
dtoverlay=devterm-wifi
|
||||
dtoverlay=devterm-bt
|
||||
dtoverlay=devterm-misc
|
||||
gpio=5=op,dh
|
||||
gpio=9=op,dh
|
||||
gpio=10=ip,np
|
||||
gpio=11=op,dh
|
||||
|
||||
enable_uart=1
|
||||
dtparam=spi=on
|
||||
dtoverlay=spi-gpio35-39
|
||||
|
||||
dtparam=audio=on
|
||||
kernel=devterm-kernel7.img
|
||||
```
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
diff --git a/arch/arm/boot/dts/overlays/Makefile b/arch/arm/boot/dts/overlays/Makefile
|
||||
index 9863b50ad6da..4ec57b4a087f 100644
|
||||
index d96ac08a606e..2f52093b14ce 100644
|
||||
--- a/arch/arm/boot/dts/overlays/Makefile
|
||||
+++ b/arch/arm/boot/dts/overlays/Makefile
|
||||
@@ -27,6 +27,11 @@ dtbo-$(CONFIG_ARCH_BCM2835) += \
|
||||
@@ -11,9 +11,9 @@ index 9863b50ad6da..4ec57b4a087f 100644
|
||||
+ devterm-panel.dtbo \
|
||||
+ devterm-pmu.dtbo \
|
||||
+ devterm-wifi.dtbo \
|
||||
chipdip-i2s-master-dac.dtbo \
|
||||
dht11.dtbo \
|
||||
dionaudio-loco.dtbo \
|
||||
dionaudio-loco-v2.dtbo \
|
||||
diff --git a/arch/arm/boot/dts/overlays/devterm-bt-overlay.dts b/arch/arm/boot/dts/overlays/devterm-bt-overlay.dts
|
||||
new file mode 100755
|
||||
index 000000000000..4b634fdd3bda
|
||||
@@ -308,7 +308,7 @@ index 000000000000..3ffc51b8fc2d
|
||||
+ __overlay__ {
|
||||
+ battery: battery@0 {
|
||||
+ compatible = "simple-battery";
|
||||
+ constant_charge_current_max_microamp = <2100000>;
|
||||
+ constant-charge-current-max-microamp = <2100000>;
|
||||
+ voltage-min-design-microvolt = <3300000>;
|
||||
+ };
|
||||
+ };
|
||||
|
||||
Reference in New Issue
Block a user