Changes

Jump to navigation Jump to search

X-C1 Software

1,744 bytes added, 17:12, 28 April 2021
Created page with "{{GD Template Impl}} This guide is only for x-c1 adapter shield. ==How to setup script??== 1. Once you have logged into your Raspberry Pi from the command line, run the follo..."
{{GD Template Impl}}
This guide is only for x-c1 adapter shield.

==How to setup script??==
1. Once you have logged into your Raspberry Pi from the command line, run the following commands
sudo apt-get update
sudo apt-get install python-smbus
sudo apt-get install pigpio python-pigpio python3-pigpio

2. Download script and some sample code.
git clone https://github.com/geekworm-com/x-c1.git

3. Setup script.
cd x-c1
sudo chmod +x x-c1.sh
sudo bash x-c1.sh
printf "%s\n" "alias xoff='sudo x-c1softsd.sh'" >> ~/.bashrc

4. Reboot
sudo reboot

5. Test safe shutdown
xoff

At this time, the fan is still not rotating, we need to continue to install the pwm fan control script

We can manually run the following commands:
python /home/pi/x-c1/pwm_fan_control.py
Then the x735 fan will start working.

But we hope that the script can be executed automatically when the Raspberry Pi board boots, we can use crontab system command to achieve it. please refer to the following

6. How to start PWM fan when pi 4 boots

sudo crontab -e

[[File:Crontab-step1.png]]

Choose "1" then press Enter

Add a line at the end of the file that reads like this:

@reboot python3 /home/pi/x-c1/pwm_fan_control.py

Please note the path of this file.

[[File:Crontab-step2.png]]

Save and exit (CTRK + O and ENTER to save it). In nano editor, you do that by hitting CTRL + X, answering Y and hitting Enter when prompted.

== How to read the fan RPM?==
please refer to /home/pi/x-c1/read_fan_speed.py, and this is only show how to get the fan speed every second, run the following command.
sudo python /home/pi/x-c1/read_fan_speed.py

<!--Add review function! -->
<comments />


[[Category:Product Manual]]
[[Category:Raspberry pi]]
[[Category:Knowledge]]

Navigation menu