X735-script
Contents
Overview
This is script installation tutorial for X735 v2.5 & v3.0, it will replace X735 Software installation tutorial, although X735 Software installation tutorial is still available, but we strongly recommend that you use this script tutorial, which simplifies the installation process and reduces dependencies on third-party python libraries.
The core shell script of X735-script comes from from pimlie/geekworm-x-c1, pimlie implements the pwm fan shell script, which does not depend on third-party python libraries at all. Thanks to pimlie.
Now we think you have successfully flashed the OS Image into Micro SD and and power on the device, and you have also completed the operations such as creating new user required in some OS. You need to perform the following operations in Terminal
.
[update]
1. Use gpiod instead of obsolete interface, and supports ubuntu 23.04 also
2. The script now supports the Raspberry Pi OS BOOKWORM version. You just need to uninstall the original script and reinstall it. Please refer to the following:
Open ternimal window, then run the following command:
mv x735-script x735-script-old git clone https://github.com/geekworm-com/x735-script cd x735-script chmod +x *.sh ./uninstall.sh
Then just follow the installation process below.
3. Fix fan not working on Raspberry Pi 5 hardware
If you are using it on a Raspberry Pi 5, make the following changes:
- Be sure to update the kernel to version 6.6.22 or more high version.
sudo apt update sudo apt full-upgrade sudo rpi-update
- Change the
PWM_CHIP_PATH
to/sys/class/pwm/pwmchip2
on line 7 of x735fan.sh
OS that has been tested
- Raspbian
- DietPi
- Manjaro
- Ubuntu
- myNode
- Umbrel
- Volumio
- RetroPie
- Twister
Install
Preconfigured config.txt
To install pwm fan, first add dtoverlay=pwm-2chan,pin2=13,func2=4
to /boot/firmware/config.txt
under [all] or the end of file and reboot
:
PS: You can skip this step due to X735 V1.0 does not support PWM fans
sudo nano /boot/firmware/config.txt
Save & exit.
sudo reboot
Install gpiod package
sudo apt install -y gpiod
If you need to use pwm_fan_control.py in some OS, need to install the following python dependencies
sudo apt-get install -y python3-rpi.gpio
Clone the script
Clone pruduct software script
git clone https://github.com/geekworm-com/x735-script cd x735-script chmod +x *.sh
PS: For some OS such as Raspberry Pi OS Lite, the git tool is not installed by default, if you get an error like error: -bash: git: command not found, please run the following command to install the git tool.
sudo apt install -y git
Configuring Different GPIO Chip for Raspberry Pi 5 hardware
If you are not using Raspberry 5 hardware(such as you are using pi 4 hardware), directly skip this step,or run the following command to set differnt chip and pwm number.
PS: Since 2024-09-02, Raspberry Pi has finally unified the gpipchip to 0 on all Raspberry Pis(Pi, 0, 1, 2, 3, 4, 5). Previously, the gpiochip on the Raspberry Pi 5 was 4.
So we comment out the following command line.
#sed -i 's/xPWR.sh 0 5 12/xPWR.sh 4 5 12/g' x735-pwr.service
PS: But on the Raspberry Pi 5 the pwmchip is still 2, not 0 as used on the Pi 0/1/2/3/4, so you still run the following command if you work on RPi 5 hardware.
sed -i 's/pwmchip0/pwmchip2/g' x735-fan.sh
Create the x735-fan service
x735-fan service is for pwm fan, the pwm fan will automatically adjust the runing speed according to the temperature of the cpu after the service is started.
Run the following command to install fan service script;
PS: You can skip this step due to X735 V1.0 does not support PWM fans
sudo ./install-fan-service.sh
Then the pwm fan starts running.
PS: If fan don't works, be sure to update the kernel to version 6.6.22, don't work on 6.6.20, it's a kernel issue.
sudo apt update sudo apt full-upgrade sudo rpi-update
Run the command uname -r to check kernel verson
Create the x735-pwr service
PS: If you use X735 V1.0, you need to modify x735-pwr.service to adapt to the GPIO of X735 v1.0, you can refer to line 10 of x735-pwr.service
sudo ./install-pwr-service.sh
Prepair software shutdown script
1. Prepaid the xSoft.sh command
sudo cp -f ./xSoft.sh /usr/local/bin/
2. Then run the following command to create a alias 'x735off' command
echo 'alias x735off="sudo /usr/local/bin/xSoft.sh 0 20"' >> ~/.bashrc
3. Run the following command to make the alias x735off effective
source ~/.bashrc
After the installation is complete, an x735off
command will be created to safe shut down.Then you can run x735xoff
to execute software shutdown.
Uninstall
Run the following command to uninstall all.
sudo ./uninstall.sh
Test
Test safe shutdown
Software safe shutdown command:
x735off
DON'T run the 'shutdown' linux command to shut down, otherwise the power of x735 shield will not be shut down.
Hardware safe shutdown operation:
You can verify the safety switch through the onboard switch, press and hold the switch for 3
seconds, then the blue LED will flash slowly and the shutdown is going then all LEDs will be off until the device is completely powered off.
- press on-board button switch
1-2
seconds to reboot - press button switch
3
seconds to safe shutdown, - press
7-8
seconds to force shutdown.
Read fan speed
read_fan_speed.py
is a sample python file on how to read the speed of the pwm fan. Run the following command to get the speed of the fan:
cd ~x735-script sudo python3 read_fan_speed.py
This `read_fan_speed.py` python file depends on the third-party python library `Rpi.GPIO`. In the official Raspberry Pi OS and most third-party OS, this library is installed by default. If you run this file and get some errors, try to run the following command to install the Rpi.GPIOy library.
sudo apt-get install -y python3-smbus python3-rpi.gpio
Or you can refer to How to Install RPi.GPIO Python Library
Other
pwm_fan_control.py
is no longer used, and are reserved here for research and use by python lovers only.
How to make the fan run after upgrading umbrel to 1.0
Above X735-script mainly implements three functions of X735 hardware:
1. Fan service: Use shell scripts or other high-level languages such as python to control the pwm fan; (corresponding to #Create_the_x735-fan_service)
2. Power management service: Use the shell to detect the user's keystrokes in real time to perform a safe shutdown or restart; (corresponding to #Create_the_x735-pwr_service)
3. Software shutdown service: Provides a shell script to implement command line shutdown (corresponding to #Prepair_software_shutdown_script)
Among them, the purpose of editing config.txt is to support the x735 fan service. Since the /boot directory of umbrel is read-only, we cannot edit the config.txt file, so we cannot use the method provided on our wiki page to install the x735 fan service. , that is, after you install the fan service, the fan of the X735 will still not run; but the other two functions can be used. You only need to follow the above steps on the current page to achieve pressing button to shutdown and software command line shutdown; (PS: After the installation is completed, you can press the key for 3 seconds to test whether the safe shutdown of the X735 is working properly).
Now let us solve the problem of pwm fan not running in umbrel 1.0:
We can use python code to make the pwm fan run. There is a pwm_fan_control.py file in the x735-script directory. You can run python3 pwm_fan_control.py to make the fan run, it's that simple.
After the fan runs successfully, we need to let the python3 pwm_fan_control.py command run automatically after booting, so we need to change the x735-fan.service file as follows:
cd cd x735-script nano x735-fan.service
Press Ctrl + O to save this file.
Press Ctrl + X to exit nano editor.
Then execute sudo ./install-fan-service.sh to install fan service script.
It should be noted that since the pwm_fan_control.py file uses the RPi.GPIO python library, you need to install this python dependencies package in advance:
sudo apt-get install -y python3-rpi.gpio
Finally, as a reminder, please remove the local x735-script folder and then re-execute the above installation process.
Support
- https://github.com/geekworm-com/x735-v2.5/issues/6
- If you have some questions or suggestions, please contact to support@geekworm.com
FAQ
Q1: Why does running python3 ~/x735-script/read_fan_speed.py
get errors?
A: After upgrading raspberry if you launch the command: python3 ~/x735-script/read_fan_speed.py
you may get the following error:
pi@raspberrypi:~/x735-script $ python3 read_fan_speed.py Traceback (most recent call last): File "/home/pi/x735-script/read_fan_speed.py", line 29, in <module> GPIO.add_event_detect(TACH, GPIO.FALLING, fell) RuntimeError: Failed to add edge detection
The reason is caused by the rpi.gpio library not being upgraded after the kernel upgrade, which can be referred to here https://github.com/raspberrypi/linux/issues/6037 to know more detail and solutions
The solution is as follows:
replace rpi.gpio with rpi-lgpio by running the following command:
sudo apt update && sudo apt install python3-rpi-lgpio --auto-remove --purge
Q2: How can I help you solve your issues?
A: First of all you really need to read our wiki tutorial carefully and then carefully step by step, try not to type in the commands, you should copy our commands from the wiki page. If you can read linux shell scripts, reading them directly is the best way to go. One thing to note is that it requires you to git the new script again after remove the old x735-script fold first because we updated this page tutorial and github project in April 2024 If you still can't get the board to work, please provide the results of the following commands via email for us to troubleshoot:
cat ~/.bashrc sudo systemctl status x735-pwr sudo systemctl status x735-fan history
Q3: How to login volumio via SSH?
1. Enable SSH:
Visit http://volumio.local/dev/, then click ENABLE SSH button
2. URL connection is IP address, and the default user name is volumio, default password is volumio
Q4: How to login to myNode via SSH?
A: URL connection is IP address, and the default user name is admin, default password is bolt
Q: How to login to Umbrel via SSH?
A: ssh umbrel@umbrel.local (or ssh umbrel@). the default user name is umbrel, default password is moneyprintergobrrr
Q5: How to login to DietPi via SSH?
A: URL connection is IP address, and the default user name is root, default password is dietpi
Q6: Is LibreELEC supported?
A:No support for LibreELEC
We have tried installing the script on LibreELEC but with no success. You will get the following message
LibreELEC:~ # apt-get install -y gpiod There is no working 'apt-get'. 'apt-get' is a command to install, update and remove software which is stored in a non local repo. 'apt-get' does nothing then connecting to such repo, downloads the software, unpacks the software, updates a big local database with all filepaths and other informations about the installed software or removes or updates installed Software. With LibreELEC it is not possible to change the system for security and stability reasons so even 'apt-get' would not be able to do this. We also dont have and want to maintain such a repo for various other great reasons. Also Ubuntu or Debian packages are often outdated and not compatible with LibreELEC TIP: use Kodi's addon browser to enhance your LibreELEC system LibreELEC:~ #
But you can remove the [Fan FS] jumper to make the PWM fan run at full speed.
How to enalbe ssh connection?
Refer to: https://www.jeffgeerling.com/blog/2022/using-libreelec-pro-management-ssh
Return to X735
Enable comment auto-refresher
Anonymous user #21
Permalink |
Harry
Anonymous user #20
Permalink |
Lisa
Anonymous user #19
Permalink |
Anonymous user #20
Anonymous user #18
Permalink |
Anonymous user #18
Permalink |
Anonymous user #17
Permalink |
Anonymous user #15
Permalink |
Anonymous user #16
Anonymous user #14
Permalink |
Harry
Anonymous user #10
Permalink |
Anonymous user #11
Harry
Anonymous user #12
Anonymous user #13
Anonymous user #9
Permalink |
Walker
Anonymous user #8
Permalink |
Walker
Anonymous user #7
Permalink |
Walker
Anonymous user #6
Permalink |
Walker
Anonymous user #5
Permalink |
Anonymous user #4
Permalink |
Walker
Anonymous user #3
Permalink |
Walker
Anonymous user #1
Permalink |
Anonymous user #2