X708-Software

From Geekworm
Jump to navigation Jump to search


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

Python version: V2.7

1. Enable I2C funcion on Raspbian:

sudo raspi-config

Select 5 Interfacing Options and then P5 I2C - Enable/Disable automatic loading. A prompt will appear asking Would you like the ARM I2C interface to be enabled?, select "Yes"

Rpi-config-1.jpg
Rpi-config-5.jpg
Rpi-config-6.jpg

Select "OK"

Select "Finish" to return to the command line and reboot your raspberry pi.

sudo reboot

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 x708.sh


4. Install script&reboot:

sudo bash x708.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


Return to X708

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


Anonymous user #3

14 days ago
Score 0++

Hi,

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

Anonymous user #3

13 days 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

13 days 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

27 days ago
Score 0++
Sorry, we updated the script for X708.

Georgefeichter

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

Georgefeichter

2 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

2 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

2 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