Difference between revisions of "X735-script"

From Geekworm Wiki
Jump to navigation Jump to search
 
Line 52: Line 52:
 
===Preconfigured <code>config.txt</code>===
 
===Preconfigured <code>config.txt</code>===
 
To install pwm fan, first add <code>dtoverlay=pwm-2chan,pin2=13,func2=4</code> to <code>/boot/firmware/config.txt</code> under [all] or the end of file and <code>reboot</code>:
 
To install pwm fan, first add <code>dtoverlay=pwm-2chan,pin2=13,func2=4</code> to <code>/boot/firmware/config.txt</code> under [all] or the end of file and <code>reboot</code>:
 +
 +
'''PS''': You can skip this step due to '''X735 V1.0''' does not support PWM fans
 
  sudo nano /boot/firmware/config.txt
 
  sudo nano /boot/firmware/config.txt
 
Save & exit.
 
Save & exit.

Revision as of 12:09, 10 December 2024

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;

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

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

X735-fan-service-umbrel.png

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

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

Add your comment
Geekworm Wiki welcomes all comments. If you do not want to be anonymous, register or log in. It is free.


Anonymous user #21

21 days ago
Score 0++

Tried to install the script on a fresh and fully updated installation of Raspberry OS Lite (64-bit) on a Raspberry Pi 3 Model B+.

I followed the steps above until command:

sudo ./install-pwr-service.sh

The system then notifies with:

"Start installing the power management service... Created symlink /etc/systemd/system/multi-user.target.wants/x735-pwr.service → /lib/systemd/system/x735-pwr.service. Power management service installed"

BUT in the second thereafter the system shuts down with the following notification:

"The system will power off now!"

Installation is then broken and system will not start again.

How can I fix (or avoid) this so that I can complete the installation and get a fully functional system)?


Tried several times now. No difference with or without the additonal step:

sudo apt-get install -y python3-smbus python3-rpi.gpio

Harry

21 days ago
Score 0++

Hello,

which os version? Bookworm or Bullseye? Please email to us at support@geekworm.com

Anonymous user #20

3 months ago
Score 0++
Anonymous user #19, did you fix this? Having the same problem.

Lisa

3 months ago
Score 0++
Hi,Please contact us by email <info@geekworm.com>; please tell us your order number and more details (include installation pictures and script installation screenshot).

Anonymous user #19

4 months ago
Score 0++

Hi there, I have installed the scripts per the instructions and the fan does not start. I can run `sudo python3 /home/<my_user>/x735-script/read_fan_speed.py` and it logs "0 RPM" continuously, which seems accurate since the fan is not running. I have also run the fan script directly `sudo /usr/local/bin/x735-fan.sh` and it only logs "Fan speed changed to 50, temp is 55.99" once. Things seem to be installed correctly and the scripts execute successfully, but the fan does not start. Please advise on how to troubleshoot the issue.

Also, this device has a continuous high-pitched squeak while it is on. This may be unrelated, but please let me know if you have seen this as well.

Anonymous user #20

3 months ago
Score 0++
Did you fix this?

Anonymous user #18

6 months ago
Score 0++
Hello, what is the x735 v2.5 script for libreelec, kodi 21 omega that works on raspberry pi 4. Can you help me. When giving the shutdown order, everything turns off completely.

Anonymous user #18

6 months ago
Score 0++
Buenas, que script x735 v2.5 para libreelec, kodi 21 omega que funcione raspberry pi 4. me podéis ayudar.

Anonymous user #17

6 months ago
Score 0++

I have thhe following problem and need some help.

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

Anonymous user #15

8 months ago
Score 0++
Any way to configure PWM in Home Assistant OS since it does not have apt, wget, etc?

Anonymous user #16

7 months ago
Score 0++

I decided to run Home Assistant OS as a virtual machine using Incus so I could use the X735 following the instructions on this wiki page. Fan now is quiet and PWM is doing its thing. I followed the steps here, but I used

pip3 install --break-system-packages rpi-lgpio ‎

for installinh the GPIO library. To check if the services are working I used

systemctl status x735-fan ‎

and

systemctl status x735-pwr ‎

For troubleshooting it helps to check

sudo journalctl -u x735-fan ‎

x735off‎ is still an unrecognized command and doesn't work for some reason, but I can live with it.

Anonymous user #14

8 months ago
Score 0++

Hi, running the steps to install fan, pwr and sss the fan doesn't start. The os version is new one:OS Version: Raspberry OS 6.6.26-v8+ With the new gpiolib the script read_fan_speed.py starts successful but "0 RPM" is not what i want to see :-) Before i use the new documentation to install i try to install everything with the deprecated tutorial, may be this can be the problem ... It would be great if you could help.

Lars

Harry

8 months ago
Score 0++

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 re-git the new script after deleting the old x735-script first. 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

Anonymous user #10

9 months ago
Score 0++

Hello Support under RPI OS Linux 6.6.20+rpt-rpi-v8 #1 SMP PREEMPT Debian 1:6.6.20-1+rpt1 (2024-03-07) aarch64 GNU/Linux I get now these Error File "/home/pi/x735-v2.5/./read_fan_speed_once.py", line 29, in <module> GPIO.add_event_detect(TACH, GPIO.FALLING, fell) RuntimeError: Failed to add edge detection

How can I solve this?

Anonymous user #11

9 months ago
Score 0++
I have the same Problem! At the beginning was all fine, but now i have to run the fan at full speed without the jumper! I have done all the installation processes again and the shutdown "x735off" still works but the auto-fan-speed doesn't. The x735-fan.sh script is already in use and under htop visible!

Harry

9 months ago
Score 0++

Refer to https://gith...lsd-gpiod.py

Please use ```libgpiod``` library and don't use RPi.GPIO anymore.

https://gith.../issues/6037

Anonymous user #12

9 months ago
Score 0++

me too,

need help

Anonymous user #13

9 months ago
Score 0++

I have the same problem

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

Anonymous user #9

11 months ago
Score 0++
Hi, I've followed through the instructions but even after keying in the command "sudo systemctl start x735-fan" the pwm fan is not turning on. Please help

Walker

11 months ago
Score 0++
May I ask which version of X735 you are using?Can you provide your order number easily? You can contact us by email: support@geekworm.com

Anonymous user #8

11 months ago
Score 0++

Hi, have the same issue like user #7: just received everything including the X735 v3.0 I installed umbrel latest version 0.5.4 I used the script (that installed with no errors) the fan starts after reboot for 4 seconds and then stops. CPU Temp. is 54°C. What temp. the fan should run? Need help.

Do you have any suggestion?

Walker

11 months ago
Score 0++
Hi, X735 V3.0 after installing the script, it is controlling the RPM by temperature, this default temperature will be reflected in the script, you can check the script

Anonymous user #7

11 months ago
Score 0++

Hi, just received everything including the X735 v3.0 I installed umbrel latest version 0.5.4 I used the script (that installed with no errors) but the fan are not running at all.

Do you have any suggestion?

Walker

11 months ago
Score 0++
Hi, we have tested Umbrel OS, if the pwm fan script is installed without errors, the fan is working fine, could you please provide us with more information? (e.g. video, your procedure), you can contact our tech support at support@geekworm.com '(by the way provide us your order number)

Anonymous user #6

12 months ago
Score 0++
fan still not working. ran this on a new x735 v3.0

Walker

12 months ago
Score 0++
Hello, please provide your order number, then you can send it to our email: support@geekworm.com , we will solve the problem for you!

Anonymous user #5

15 months ago
Score 0++

I was wondering if it was possible to remove the reboot option in the script. I want to only have safe shutdown and force shutdown. what lines should I change in the script?

thank you

Anonymous user #4

15 months ago
Score 0++

You'll have to excuse the newbie if this is a dumb question, but....

entered everything correctly, and everything on the x735 works, except when powered by 12v input system will not come up from shutdown. Button held 2-3 sec causes blue light to flicker, but that's all. Via USB-C, everything works as it should. Thoughts?

Walker

15 months ago
Score 0++
Hello, you can contact us via our email: support@geekworm.com we will do our best to solve your problem

Anonymous user #3

15 months ago
Score 0++
This is going to sound dumb but I know it states that you cant use the shutdown command but is the reboot command still safe to use.

Walker

15 months ago
Score 0++

Hello, X735 can implement shutdown command. For details, you can refer here:

software shutdown script

Anonymous user #1

17 months ago
Score 0++

After I type x735off I get sudo: /usr/local/bin/x735-softsd.sh: command not found

If I navigate to /usr/local/bin/ and type x735-softsd.sh I get a few permission denied errors.

Anonymous user #2

17 months ago
Score 0++

sudo cp -f ./x735-softsd.sh /usr/local/bin/ Do you sure that you run this line command?

You should run x735off NOT x735-softsd.sh, or you can run sudo x735-softsd.sh

Please read the tutorial carefully.