树莓派4B ARGON-ONE
项目背景
由于之前买了树莓派4B和ARGON-ONE外壳,而且个人需要在上面安装CentOS 7.7系统,
而从官方没有找到对应的ARGON-ONE的风扇控制程序,只有官方系统下的python的版本,
其不能在CentOS 7.7下工作,所有DIY一个风扇控制程序。其通用性强,可以适配任何
树莓派的系统。Enjoy it.
源码 https://github.com/panyingyun/argonone
1、Hardware
- Raspberry Pi 4 Model B Rev 1.2
- PI4-CASE-ARGON-ONE (http://www.waveshare.net/wiki/Pioneer600)
2、Rom & OS
- CentOS 7.7 Download Rom and Flash to SD
3、Boot config file(very important,if not do this, application can not run normal.)
open i2c dev driver
### vim /boot/config.txt and add next info
dtparam=i2c_arm=on,i2c_arm_baudrate=32000
dtparam=i2s=on
dtparam=i2c_baudrate=32000
### vim /etc/modules-load.d/modules.conf and add next info
i2c-dev
i2c-bcm2835
4、Reboot && check config work or not
- (1) check i2c dirver work
[root@pinas2 modprobe.d]# lsmod | grep i2c
i2c_bcm2835 16384 0
i2c_dev 20480 0
- (2) check i2c baudrate(32000 is OK)
[root@pinas2 tools]# cat /sys/module/i2c_bcm2708/parameters/baudrate
32000
- (3) check ARGON-ONE device(‘1a’ is device address for fan)
[root@pinas2 tools]# yum install i2c-tools -y
[root@pinas2 tools]# i2cdetect -y 1
0 1 2 3 4 5 6 7 8 9 a b c d e f
00: -- -- -- -- -- -- -- -- -- -- -- -- --
10: -- -- -- -- -- -- -- -- -- -- 1a -- -- -- -- --
20: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
30: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
40: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
50: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
60: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
70: -- -- -- -- -- -- -- --
- (4) check cpu temp
[root@pinas2 tools]# cat /sys/class/thermal/thermal_zone0/temp
44790
5、How to build
//ssh to your board and prepare Pioneer600
//and install git tools
sudo apt-get update
sudo apt-get upgrade
sudo apt install -y vim git build-essential i2c-tools
sudo apt install -y golang
//clone code
git clone git@github.com:panyingyun/argonone.git
//build
cd argonone/src/cmd
//build arm
CGO_ENABLED=0 GOOS=linux GOARCH=arm go build -o argonone
6、How to run
argonone -c prod.yml
7、Auto-run when reboot OS
Run build_arm64.sh, it will autorun argonone when reboot os
chmod 755 build_arm64.sh
sudo sh build_arm64.sh
Other shell cmd
// enable
sudo systemctl enable argonone.service
// disable
sudo systemctl disable argonone.service
// start service
sudo systemctl start argonone.service
// stop
sudo systemctl stop argonone.service
// restart
sudo systemctl restart argonone.service
8、Thanks To
- https://github.com/Elrondo46/argonone
- http://www.waveshare.net/wiki/PI4-CASE-ARGON-ONE
- https://www.cnblogs.com/bcy520/p/6816310.html
- http://nicekwell.net/blog/20171123/shu-mei-pai-wiringpi-shu-mei-pai-de-i2cpei-zhi.html
- https://blog.csdn.net/qq_41673920/article/details/86493655
- https://www.cnblogs.com/shangdawei/p/4825259.html