Open main menu

Changes

X735 Software

6,007 bytes added, 3 April
no edit summary
{{GD Template Impl}}
<span class="tb_red"><big>This tutorial is deprecated, see [[X735-script]]</big></span>  ==Overview==This guide also applies to [[X735]] V3.0 / V2.5 shield; ==For Raspbian / Raspbian Lite / RetroPie / Twister OS v2.0.2==Test '2022-04-04-raspios-bullseye-armhf-lite.img' on May 6th 2022; '''install'''  sudo apt-get update sudo apt-get upgrade  sudo apt-get install -y git sudo apt-get install -y pigpio python3-pigpio sudo apt-get install -y python3-smbus python3-rpi.gpio git clone https://github.com/geekworm-com/x735-v2.5 cd x735-v2.5 sudo chmod +x *.sh sudo bash install.sh echo "alias x735off='sudo /usr/local/bin/x735softsd.sh'" >> ~/.bashrc sudo reboot If reboot fails, please force shutdown or power off and restart '''Test safe shutdown''' x735off* x735off is safe shutdown command, you can run this command to safe shutdown.* press button 1-2 seconds to reboot* press button 3 seconds to safe shutdown,* press 7-8 seconds to force shutdown. '''uninstall''' sudo ./uninstall.sh '''read-fan-speed.py''' sudo python3 read_fan_speed.pyor sudo python read_fan_speed.py After a reboot, we can run ```sudo python read_fan_speed.py``` to get an update on the fan's current speed. '''How to setup make the fan scriptrun automatically after booting??''' There are two ways to achieve it: 1. Put the command line in the /etc/rc.local file: ('''Default''') vi /etc/rc.local <source lang='shell' line highlight="21">#!/bin/sh -e## rc.local## This script is executed at the end of each multiuser runlevel.# Make sure that the script will "exit 0" on success or any other# value on error.#1# In order to enable or disable this script just change the execution# bits.## By default this script does nothing. Once you have logged into your Raspberry Pi from  # Print the IP address_IP=$(hostname -I) || trueif [ "$_IP" ]; then printf "My IP address is %s\n" "$_IP"fi /etc/x735pwr.sh &python /home/pi/x735-v2.5/pwm_fan_control.py&exit 0</source> NOTE: * The install.sh script will make sure this command lineis put into the rc.local file, you don't need to do anything.* Please change 'python' to 'python3' if you are using python3.* Please make sure the file path of pwm_fan_control.py is correct.  2. Use crontab to add a timed task. For details, please refer to [[How to add crontab job]]. ==For DietPi=='''install''' sudo apt-get install -y python-smbus python python3-rpi.gpio sudo apt-get install -y pigpio python-pigpio python3-pigpio git git clone https://github.com/geekworm-com/x735-v2.5 cd x735-v2.5 sudo chmod +x *.sh sudo bash install-dietpi.sh echo "alias x735off='sudo /usr/local/bin/x735softsd'" >> ~/.bashrc sudo reboot PS: according to the customer feedback, the above shell script is also work with Citadel, please test yourself, run thanks! ==For Volumio 3==Test the following commandsscript base on the 'Volumio-3.175-2021-12-13-pi.img' The default username and passpword are both 'volumio' '''install''' # Enable SSH Visit 'http://volumio.local/dev/' to click 'Enable' button to enable SSH  # install software and tools via SSH window
sudo apt-get update
sudo apt-get install python-smbus
sudo apt-get -y install pigpio python-pigpio rpi.gpio python3-pigpiorpi.gpio # download the install script sudo git clone https://github.com/geekworm-com/x735-v2.5 cd x735-v2.5 sudo chmod +x *.sh sudo bash install-volumio3.sh
# add x735off alias echo "alias x735off='sudo /usr/local/bin/x735softsd'" >> ~/.bashrc sudo reboot '''Test safe shutdown''' x735off* x735off is safe shutdown command, you can run this command to safe shutdown.* press button 1-2seconds to reboot* press button 3 seconds to safe shutdown,* press 7-8 seconds to force shutdown. '''uninstall''' sudo ./uninstall. Download script and some sample codesh '''read-fan-speed.py''' git clone sudo python3 read_fan_speed.py ==For Ubuntu Server==Test the following script base on [https://githububuntu.com/geekworm-comdownload/x735raspberry-v2pi Ubuntu Server 21.510] on March 24th, 2022  '''install'''  # install software and tools cd ~ sudo apt-get update sudo apt-get upgrade sudo apt-get install -y unzip make gcc git sudo apt-get install -y wiringpi python python3-pigpio python-setuptools python3-distutils python3-rpi.gitgpio
3 # install pigpio library, also refer to http://abyz. Setup scriptme.uk/rpi/pigpio/download.html wget https://github.com/joan2937/pigpio/archive/master.zip unzip master.zip cd pigpio-master sudo make sudo make install  # download X735 installation scripts cd ~ git clone https://github.com/geekworm-com/x735-v2.5
cd x735-v2.5
sudo chmod +x x735-v25*.sh sudo bash x735-v25.sh printf "%s\n" "alias x735off='sudo x735softsd.sh'" >> ~/.bashrc
4 # create pigpiod service sudo bash create-pigpiod. Rebootservice.sh # create /etc/rc.local file sudo bash create-rc.local.sh # install script sudo bash install.sh # add x735off alias echo "alias x735off='sudo /usr/local/bin/x735softsd.sh'" >> ~/.bashrc
sudo reboot
5. '''Test safe shutdown'''
x735off
* x735off is safe shutdown command, you can run this command to safe shutdown.
* press button 1-2 seconds to reboot
* press button 3 seconds to safe shutdown,
* press 7-8 seconds to force shutdown.
At this time, the fan is still not rotating, we need to continue to install the pwm fan control script'''uninstall''' sudo ./uninstall.sh
We can manually run the following commands: python ./x735'''read-fan-v25/pwm_fan_controlspeed.py'''Then the x735 fan will start working sudo python3 read_fan_speed.py
But we hope that the script can be executed automatically when the Raspberry Pi board boots== For myNode OS and Umbrel ==About myNode, we can use crontab command to achieve it. please refer to the followinghttp://www.mynodebtc.com/
6About Umbrel, please refetrto https://getumbrel.com/, we test it base on 'umbrel-os-v0.4. How to start PWM fan when pi 4 boots.img'
sudo crontab We tested umbrel v0.4.16 on Apr. 18th, 2022 base on 'umbrel-eos-v0.4.16.img'
[[File:Crontab-step1.png]]'''Install'''
Choose "1" login to mynode teminal via Putty or Xsheel tool, the default user name is `admin`, password is `bolt`, then press Enterrun the following command:
Add a line at Login to mynode teminal via Putty or Xsheel tool, the end of default user name is `umbrel`, default password is `moneyprintergobrrr`, then run the file that reads like thisfollowing command:
@reboot python3 /home/pi/x735-V2.5/pwm_fan_control.py'''FAQ'''
Please note Q: What are the path of this file.credentials to SSH into my Umbrel?
[[FileA:Crontab-step2ssh host is '''umbrel.png]]local''' (or ssh <'''local IP address''' of your Umbrel>). The default user name is '''umbrel''', and the default password '''moneyprintergobrrr'''
Save and exit. In nano editor, you do that by hitting CTRL + X, answering Y and hitting Enter when prompted.<pre>
sudo apt-get update sudo apt-get install -y python-smbus python pigpio python-pigpio python3-pigpio git wiringpi sudo apt-get install -y python-rpi.gpio python3-rpi.gpio rpi.gpio git clone https://github.com/geekworm-com/x735-v2.5 cd x735-v2.5 chmod +x *.sh sudo bash install-mynode.sh echo "alias x735off='sudo /usr/local/bin/x735softsd.sh'" >> ~/.bashrc sudo reboot If you fail to reboot, please unplug the power directly and restart;</pre> ''' PWM fan control''' The script is installed successfully and the fan starts to run '''Test safe shutdown''' x735off* Please run 'x735off' to shut down or press the on-board button switch to shut down. <span style= Other python sample code"color:red;">DON'T run the 'shutdown' linux command to shut down, otherwise the power of x735 will not be shut down.</span>* press button switch 1-2 seconds to reboot* press button switch 3 seconds to safe shutdown,* press 7-8 seconds to force shutdown. '''uninstall''' ./uninstall-mynode.sh ==For Version 2.1 or more low version== Please refer to '''[http://www.suptronics.com/miniPCkits/x735-hardware.html Hardware]''' and '''[http://www.suptronics.com/miniPCkits/x730-software.html Software]''' and read them and follow the instructions before ask any questions, thank you! The safe shutdown script is same with X730. * [https://github.com/geekworm-com/x730-script Github]We test this shell script base official Raspbian '2018-11-13-raspbian-stretch.img' version;other operating systems not be tested!
<pre>
#read_fan_speedDownload run script git clone https://github.com/geekworm-com/x730-script cd x730-script #Setting file attributessudo chmod +x x730.pysh  #This is only show how to get Install the fan speed every secondscriptsudo bash x730.sh  #Setting up the command to turn off X730 from software printf "%s\\n" "alias x730off='sudo python read_fan_speedx730shutdown.sh'" >> ~/.pybashrc #Reboot the Raspberry Pisudo reboot #Powering off the Raspberry Pi from softwarex730off
</pre>
pwm_fan_control.py
This is the phthon sample file to control fan speed by CPU temperature. you can refer to this sample or modify it by your request. please contact us if you found some error for this file.
You can use the 'crontab' system command to execute this python file to get the function of speed adjustment according to temperature changes.
Return to [[X735]]
<!--Add review function! -->
<comments />