Argon One Service and Control Service coding by golang for Raspberry Pi 4B/4B+ centos7.7 or other Pi Linux System
Enjoy it.
- Raspberry Pi 4 Model B Rev 1.2
- PI4-CASE-ARGON-ONE
- CentOS 7.7 Download Rom and Flash to SD
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
i2c-bcm2708
- (1) check i2c dirver work
[root@pinas2 modprobe.d]# lsmod | grep i2c
i2c_bcm2708 16384 0
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
//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/cmd
//build arm
CGO_ENABLED=0 GOOS=linux GOARCH=arm go build -o argonone
argonone -c prod.yml
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
When CPU Temp from 41.381℃ to 39.92℃ ,and fan speed from 10% to stop.
{"level":"INFO","ts":"2020-06-07 11:20:34","msg":"Raspberry Pi 4 Argonone Fan"}
{"level":"INFO","ts":"2020-06-07 11:20:34","msg":"Thanks to https://gobot.io"}
{"level":"INFO","ts":"2020-06-07 11:20:35","msg":"Current Temp is 41.381 ℃"}
{"level":"INFO","ts":"2020-06-07 11:20:35","msg":"FANOn10 ..."}
{"level":"INFO","ts":"2020-06-07 11:20:40","msg":"Current Temp is 40.894 ℃"}
{"level":"INFO","ts":"2020-06-07 11:20:40","msg":"FANOn10 ..."}
{"level":"INFO","ts":"2020-06-07 11:20:45","msg":"Current Temp is 39.92 ℃"}
{"level":"INFO","ts":"2020-06-07 11:20:45","msg":"FANOff ..."}
{"level":"INFO","ts":"2020-06-07 11:20:50","msg":"Current Temp is 39.92 ℃"}
{"level":"INFO","ts":"2020-06-07 11:20:50","msg":"FANOff ..."}