Changes

Jump to navigation Jump to search

X708-Software

1,955 bytes added, 11:38, 23 July 2020
Created page with "{{GD Template Impl}} <span style="color:blue;">'''X708 script is same as X728, only X708 doesn't support RTC function.'''</span> The following test is base on '2020-02-13-r..."
{{GD Template Impl}}

<span style="color:blue;">'''X708 script is same as X728, only X708 doesn't support RTC function.'''</span>

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"

[[File:Rpi-config-1.jpg|none]]

[[File:Rpi-config-5.jpg|none]]

[[File:Rpi-config-6.jpg|none]]

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 x728 setup scripts:
git clone https://github.com/geekworm-com/x728.git
cd x728

4. Install script&reboot:
sudo bash x728.sh
printf "%s\n" "alias x728off='sudo x728softsd.sh'" >> ~/.bashrc
sudo reboot

5. Set and Read the RTC time
#X708 does't support RTC, so comment out the following script.
#If you need to set the system time for any reason you can use the following command :
#date -s "5 MAR 2019 13:00:00"

#Write the system date and time to the RTC module after your correct the system date and time :
#sudo hwclock -w

#Read the date and time back from the RTC module:
# sudo hwclock -r

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

7. Power off command on Raspbian from software
x728off

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


Return to [[X728]]

<!--Add review function! -->
<comments />

<!--Please choose the -->
<!--Remove other categories, just keep the appropriate categories -->

[[Category:Product Manual]]
[[Category:Raspberry pi]]
[[Category:Knowledge]]

Navigation menu