Open main menu

Changes

X735-script

5,781 bytes added, 23 April
{{GD Template Impl}}
__NOTOC__==Overview==
This is script installation tutorial for [[X735]] v2.5 & v3.0, it will replace [[X735 Software | X735 Software installation tutorial]], although [[X735 Software | 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.
This guideline is similar to [[XScript]] only because the hardware uses a different GPIO.
The core shell script of [[X735-script]] comes from from [https://github.com/pimlie/geekworm-x-c1 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 users user required in some OS. You need to perform the following operations in <code>Terminal</code>.  '''[update]''' 1. Use '''gpiod''' instead of obsolete interface, and suuports 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:<pre>mv x735-script x735-script-oldgit clone https://github.com/geekworm-com/x735-scriptcd x735-scriptchmod +x *.sh./uninstall.sh</pre>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 <code>PWM_CHIP_PATH</code> to <code>/sys/class/pwm/pwmchip2</code> on line 7 of '''x735fan.sh'''
==OS that has been tested==
* Twister
==Install=====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>: sudo nano /boot/config.txt '''Or''' (it's <code>/boot/firmware/config.txt</code> if you are using <code>ubuntu os</code>)
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===<pre>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<!--2. Download xGPIO tool wget https://github.com/geekworm-com/xgpio/raw/main/bin/ubuntu/xgpio_pwr wget https://github.com/geekworm-com/xgpio/raw/main/bin/ubuntu/xgpio_softAfter the download is successful, there will be two files xGPIO_pwr and xGPIO_soft in the current directory.-->
cd ===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. sed -i 's/xSoft.sh 0 20/xSoft.sh 4 20/g' install-sss.sh sed -i 's/xPWR.sh 0 5 12/xPWR.sh 4 5 12/g' x735-scriptpwr.servicechmod +x * sed -i 's/pwmchip0/pwmchip2/g' x735-fan.sh</pre>PS: Raspberry Pi 5 use different gpio chip name.
===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.
<pre>sudo cp -f ./x735-Run the following command to install fan.sh /usr/local/bin/service script; sudo cp -f ./x735install-fan-service.service /lib/systemd/systemsudo systemctl daemon-reloadsudo systemctl enable x735-fansudo systemctl start x735-fan</pre>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-updateRun the command '''''uname -r''''' to check kernel verson ===Create the x735-pwr service===x735 sudo ./install-pwr -service will be responsible for power management and hardware safe .sh ===Prepair software shutdown.script===<pre>Run the following command to install software shutdown script (sss) sudo cp -f ./x735install-pwrsss.sh  After the installation is complete, an <code>x735off</usr/local/bin/sudo cp -f x735-pwrcode> command will be created to safe shut down.service /lib/systemd/systemsudo systemctl daemon-reloadsudo systemctl enable x735-pwrsudo systemctl start x735-pwrThen you can run <code>x735xoff</precode>to execute software shutdown.
==Prepair software shutdownUninstall== sudo cp -f ./x735-softsd.sh /usr/local/bin/Create a alias <code>x735off</code> Run the following command to execute the software shutdownuninstall all.<pre>echo "alias x735off=' sudo ./usr/local/bin/x735-softsduninstall.sh'" >> ~/.bashrcsource ~/.bashrc</pre>Then you can run <code>x735off</code> to execute software shutdown.
==Test=====Test safe shutdown===
'''Software safe shutdown command''':
x735off
* press <code>7-8</code> seconds to force shutdown.
===Read fan speed===
<code>read_fan_speed.py</code> 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
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===
<code>pwm_fan_control.py</code> 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
[[File: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==
If you have some questions or suggestions, please contact to <span class="tb_red">support@geekworm.com</span>
==FAQ==
<html>
<details>
<summary>Q: How to login <b>volumio</b> via SSH?</summary>
<p>1. Enable SSH:</p>
<p>Visit http://volumio.local/dev/, then click <b>ENABLE SSH</b> button</p>
<p>2. URL connection is IP address, and the default user name is <b>volumio</b>, default password is <b>volumio</b></p>
</details>
<detailsdiv class="toccolours mw-collapsible mw-collapsed"><summarydiv style="font-weight:bold;line-height:1.0;">Q: How to login to <b>Umbrelcan I help you solve your issues?</bdiv> via SSH?</summarydiv class="mw-collapsible-content">A: ssh umbrel@umbrel.local (or ssh umbrel@<IP address First of your Umbrel>)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 default user name best way to go. One thing to note is <b>umbrel<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 ~/b>, default password is <b>moneyprintergobrrr.bashrc sudo systemctl status x735-pwr sudo systemctl status x735-fan history</bdiv></detailsdiv>
<detailsdiv class="toccolours mw-collapsible mw-collapsed"><summarydiv style="font-weight:bold;line-height:1.0;">Q: How to login to <b>myNode</b> '''volumio''' via SSH?</summarydiv><div class="mw-collapsible-content">1. Enable SSH:
AVisit http: URL connection is IP address, and the default user name is <b>admin</b>, default password is <b>bolt</b><volumio.local/dev/details>, then click '''ENABLE SSH''' button
<details>2. URL connection is IP address, and the default user name is '''volumio''', default password is '''volumio'''<summary>Q: How to login to <b>DietPi</bdiv> via SSH?</summarydiv>
<div class="toccolours mw-collapsible mw-collapsed"><div style="font-weight:bold;line-height:1.0;">Q: How to login to <b>myNode</b> via SSH?</div><div class="mw-collapsible-content">A: URL connection is IP address, and the default user name is <b>root</b>'''admin''', default password is <b>dietpi'''bolt'''</bdiv></detailsdiv>
<detailsdiv class="toccolours mw-collapsible mw-collapsed"><summarydiv style="font-weight:bold;line-height:1.0;">Q: Is How to login to Umbrel via SSH?</div><bdiv class="mw-collapsible-content">LibreELECA: ssh umbrel@umbrel.local (or ssh umbrel@). the default user name is '''umbrel''', default password is '''moneyprintergobrrr'''</bdiv> supported?</summarydiv>
<div class="toccolours mw-collapsible mw-collapsed"><div style="font-weight:bold;line-height:1.0;">Q: How to login to DietPi via SSH?</div><div class="mw-collapsible-content">A: TODOURL connection is IP address, and the default user name is '''root''', default password is '''dietpi'''</div></detailsdiv>
<div class="toccolours mw-collapsible mw-collapsed"><div style="font-weight:bold;line-height:1.0;">Q: Is LibreELEC supported?</htmldiv><div class="mw-collapsible-content">A:TODO</div></div>
Return to [[X735]]
<!--Add review function! -->