Changes

Jump to navigation Jump to search

X708-Software

1,458 bytes removed, 09:59, 31 May 2023
no edit summary
3. Check if the i2c of the X708 is connected correctly
<span style="color:#23AC38">pi@raspberrypi</span>: <span style="color:#50BEDB">~/x708v2 $</span> sudo i2cdetect -y 1
0 1 2 3 4 5 6 7 8 9 a b c d e f
00: -- -- -- -- -- -- -- --
3. Download x708 setup scripts:
<span style="color:#23AC38">pi@raspberrypi</span>:<span style="color:#50BEDB">~ $</span> cd ~ <span style="color:#23AC38">pi@raspberrypi</span>:<span style="color:#50BEDB">~ $</span> git clone https://github.com/geekworm-com/x708v2
This command will download the script installation file for X708
4.1 Enters the corresponding operating system scripts folder (raspberry-pi-os)
<span style="color:#23AC38">pi@raspberrypi</span>:<span style="color:#50BEDB">~ $</span> cd ~/x708v2/raspberry-pi-os/
4.2 Execute the installation script.
4.3 Create an alias x708off so that we can perform software shutdown from the command line, you can also change x708off to any name you like
<span style="color:#23AC38">pi@raspberrypi</span>:<span style="color:#50BEDB">~/x708v2/raspberry-pi-os $ </span>printf "%s\n" "alias x708off='sudo x708softsd.sh'" >> ~/.bashrc <span style="color:#23AC38">pi@raspberrypi</span>:<span style="color:#50BEDB">~/x708v2/raspberry-pi-os $ </span>sudo reboot
Or force press the button of x708 for 8 seconds to shut down and then restart
5. How to reading battery voltage and percentage, this is the sample code, you can modify it by your request.
<span style="color:#23AC38">pi@raspberrypi</span>:<span style="color:#50BEDB">~ $</span> cd ~/x708v2/raspberry-pi-os/ <span style="color:#23AC38">pi@raspberrypi</span>:<span style="color:#50BEDB">~/x708v2/raspberry-pi-os $ </span>sudo python3 bat.py
<pre>
******************
6. Testing AC power off/loss or power adapter failure detection (PLD function)
<span style="color:#23AC38">pi@raspberrypi</span>:<span style="color:#50BEDB">~ $</span> cd ~/x708v2/raspberry-pi-os/ <span style="color:#23AC38">pi@raspberrypi</span>:<span style="color:#50BEDB">~/x708v2/raspberry-pi-os $ </span>sudo python3 pld.py
<pre>
7. Test Auto shutdown when AC power loss or power adapter failure
<span style="color:#23AC38">pi@raspberrypi</span>:<span style="color:#50BEDB">~ $</span> cd ~/x708v2/raspberry-pi-os/
<span style="color:#23AC38">pi@raspberrypi</span>:<span style="color:#50BEDB">~/x708v2/raspberry-pi-os $ </span>sudo python3 plsd.py
Testing Started---AC Power Loss OR Power Adapter Failure---
8. Automatically control the cooling fan
<span style="color:#23AC38">pi@raspberrypi</span>:<span style="color:#50BEDB">~ $</span> cd ~/x708v2/raspberry-pi-os/ <span style="color:#23AC38">pi@raspberrypi</span>:<span style="color:#50BEDB">~ $</span> python3 fan.py
Then the fan starts running.
9. Uninstall
<span style="color:#23AC38">pi@raspberrypi</span>:<span style="color:#50BEDB">~ $</span> cd ~/x708v2/raspberry-pi-os/ <span style="color:#23AC38">pi@raspberrypi</span>:<span style="color:#50BEDB">~/x708v2/raspberry-pi-os $ </span>sudo bash uninstall.sh
== For Ubuntu==

Navigation menu