X708-Software

From Geekworm Wiki
Jump to navigation Jump to search


For Raspbian

The following test is base on '2020-02-13-raspbian-buster.img'

Python version: V2.7

1. Enable I2C funcion on Raspbian:

2. Install necessary software (python and i2c tool library)

sudo apt-get install python-smbus 
sudo apt-get install i2c-tools 


3. Download x708 setup scripts:

git clone https://github.com/geekworm-com/x708.git
cd x708
chmod +x install.sh


4. Install script&reboot:

sudo bash install.sh
printf "%s\n" "alias x708off='sudo x708softsd.sh'" >> ~/.bashrc 
sudo reboot

6. How to reading battery voltage and percentage, this is the sample code, you can modify it by your request.

sudo python x708bat.py


7. How to power off command on Raspbian from software

x708off

8. Testing AC power off/loss or power adapter failure detection (need to shor the 'PLD' pin)

sudo python x708pld.py


9. How to programming to get ASD function on V1.2 version

The following is fake C/C++ code:

while(1) {
  // You need to implement getCurrentVoltage function
  float fVoltage = getCurrentVoltage();
  if (fVoltage <= 2.5) {
  //execute shut down command, "sudo x708off"
  break;
  }
}

10. Uninstall

./uninstall.sh

For Ubuntu

Base ubuntu-mate-20.04.1-desktop-armhf+raspi.img

1. Enable I2C


2. update & upgrade

sudo apt update
sudo apt upgrade

3. Install necessary software

sudo apt install git python python3 python3-smbus python3-rpi.gpio python-rpi.gpio wiringpi -y

4.Download x708 setup scripts:

git clone https://github.com/geekworm-com/x708.git
cd x708
chmod +x *.sh
sudo bash install-ubuntu.sh
sudo reboot

5. How to reading battery voltage and percentage, this is the sample code, you can modify it by your request.

sudo python3 x708bat.py

6. How to power off command on ubuntu from software

x708off
* press button 1-2 seconds to reboot
* press button 3 seconds to safe shutdown,
* press 7-8 seconds to force shutdown.

7. Testing AC power off/loss or power adapter failure detection (need to shor the 'PLD' pin)

sudo python3 x708pld.py

8. Uninstall

./uninstall-ubuntu.sh

Return to X708

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 #9

6 days ago
Score 0++
how to use SSD1306 OLED Displays (batter volt & capacity)

Lisa

6 days ago
Score 0++
Hello,sorry that we haven't tested x708 + OLED Displays;

Anonymous user #9

6 days ago
Score 0++
"bash: x708.sh: No such file or directory" <---how to do???

Harry

6 days ago
Score 0++
sorry, should be install.sh

Anonymous user #8

9 days ago
Score 0++

Hi, I keep getting this : pi@raspberrypi:~/x708 $ chmod +x install.shchmod +x install.sh chmod: cannot access 'install.shchmod': No such file or directory

chmod: cannot access '+x': No such file or directory

Lisa

8 days ago
Score 0++
Hello,Please email to us【support@geekworm.com】 and provide some pictures or videos so that we can find the problem. And tell us your order number.Best regards

Anonymous user #7

one month ago
Score 0++

Hi can this be used on twister to monitor battery state..

Thanks

Lisa

one month ago
Score 0++
Hi, Sorry we haven't tested on twister yet.

Anonymous user #6

2 months ago
Score 0++
How to enable Auto Power ON feature?

Lisa

one month ago
Score 0++
Hi,please refer here:X708-Hardware

Anonymous user #5

4 months ago
Score 0++

Guten Tag,

Ist es möglich den Lüfter per Termeratur zu steuern wie beim board X730 ??

Lisa

one month ago
Score 0++
Hi, The fan of X708 does not support temperature control.

Anonymous user #4

7 months ago
Score 0++
Hi. Is there a way to increase the delay between when "poweroff" of the RPI starts and the X708 drops power? This would allow to add a longer delay so that the OS is completely shutdown?

Xiali

7 months ago
Score 0++
Hi dear ,X708 will cut off the power after the system is shut down, you need to install the script first,By the way ,There are many Raspberry Pi fans exchange experiences on our official website, you are welcome to join us https://geek...munity/forum

Anonymous user #3

8 months ago
Score 0++

Hi,

I can't shutdown the pi using the command x708off. It says: "command not found".

Anonymous user #3

8 months ago
Score 0++
I could solve the problem myself. Had do modify the ~/.bashrc file. There was written "alias x728off = 'sudo x728softsd.sh'. But I got under /usr/local/bin/x708softsd.sh ...

Xiali

8 months ago
Score 0++
Hi dear ,So you have solve the problem That is a good news ,by the way there are many Raspberry Pi fans exchange experiences on our official website, you are welcome to join us: http://www.g...munity/forum

Harry

9 months ago
Score 0++
Sorry, we updated the script for X708.

Georgefeichter

10 months ago
Score 0++
Is there anyone who can help with this?

Georgefeichter

11 months ago
Score 0++

I can't get the pi to shut down through a command at the command line.

I type this: x728off

and I get this: /usr/local/bin/x728softsd.sh: line 5: echo: write error: Device or resource busy X728 Shutting down...

But nothing happens.

Any ideas anyone?

Anonymous user #1

11 months ago
Score 0++

Hi

Just got your x708 and installed it.

Step 3 of the software instructions is not very clear. Which lines need to be commented out?

Like this:

==================
  1. because X708 doesn't support RTC function, so we need to remove or comment out (add # at the beginning of the line) the following 4 lines
  2. X728 RTC setting up
  3. sudo sed -i '$ i rtc-ds1307' /etc/modules

sudo sed -i '$ i echo ds1307 0x68 > /sys/class/i2c-adapter/i2c-1/new_device' /etc/rc.local sudo sed -i '$ i hwclock -s' /etc/rc.local

===================

Like this:

==================
  1. because X708 doesn't support RTC function, so we need to remove or comment out (add # at the beginning of the line) the following 4 lines
  2. X728 RTC setting up
  3. sudo sed -i '$ i rtc-ds1307' /etc/modules
  4. sudo sed -i '$ i echo ds1307 0x68 > /sys/class/i2c-adapter/i2c-1/new_device' /etc/rc.local

sudo sed -i '$ i hwclock -s' /etc/rc.local

===================

or like this:

==================
  1. because X708 doesn't support RTC function, so we need to remove or comment out (add # at the beginning of the line) the following 4 lines
  2. X728 RTC setting up
  3. sudo sed -i '$ i rtc-ds1307' /etc/modules
  4. sudo sed -i '$ i echo ds1307 0x68 > /sys/class/i2c-adapter/i2c-1/new_device' /etc/rc.local
  5. sudo sed -i '$ i hwclock -s' /etc/rc.local
===================
Thank you very much.

Anonymous user #2

11 months ago
Score 0++

I read it as

  1. X728 RTC setting up
  2. sudo sed -i '$ i rtc-ds1307' /etc/modules
  3. sudo sed -i '$ i echo ds1307 0x68 > /sys/class/i2c-adapter/i2c-1/new_device' /etc/rc.local
  4. sudo sed -i '$ i hwclock -s' /etc/rc.local