X708-Software

From Geekworm Wiki
Revision as of 16:31, 8 September 2020 by Harry (talk | contribs)
Jump to navigation Jump to search

X708 script is same as X728, but X708 doesn't support RTC function.

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 x728 setup scripts:

git clone https://github.com/geekworm-com/x728.git
cd x728

sudo nano x728.sh
#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
#X728 RTC setting up
#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 

4. Install script&reboot:

sudo bash x728.sh
printf "%s\n" "alias x728off='sudo x728softsd.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 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 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 #32

5 months ago
Score 0++

Hello, is there any way to setup the x708off to be operable using a webserver

specifically a php lightttpd server (raspap)

I want to integrate it with raspap so I can turn my pi off using the webservice of raspap and not need to ssh to give the x708off command

Anonymous user #20

9 months ago
Score 0++

x708, x862 (NGFF, WD SA510), two 18650 batteries, and a metal pushbutton switch latching are in use.

1. If this package device is left unused, the battery will be completely discharged. The power switch does not operate when the adapter is connected to the x802 boarder.

So when I remove the power cord of the battery holder from the x708 boarder and reconnect it, it charges and works.

However, the software does not boot. A Linux file system error and a disk error of M.2 NGFF on this x862 boarder occur.

2. It also causes an I/O error, making it impossible to format M.2 as well. It becomes physically unusable.

This problem repeats itself.

Anonymous user #30

10 months ago
Score 0++

I would like to understand how the X708 achieves a proper shutdown before removing power. When I look at the python scripts it appears to just kill power after toggling GPIO 13, simulating a button press of > 3 seconds.

I am try to use the X708 on MotionEye OS which is a stripped down version of Raspbian and write my own scripts. I would like to understand how the X708 uses GPIO 5, 12, and 13 so that I can monitor GPIO 6 and gracefully power down after a number of minutes.

Do I turn 13 high for 3 seconds and then X708pwr.sh will see GPIO 5 trigger and do a graceful power down?

Anonymous user #31

10 months ago
Score 0++
I just thought about the same thing. But according to my testing the software shutdown that is done via GPIO 13 actually triggers the x708pwr.sh script with GPIO 5 and performs a safe shutdown before cutting off power.

Anonymous user #29

14 months ago
Score 0++
Is the x708v2 software compatible with the X708 V1.2? What's the best way to update the older x708 script? uninstalling the old one with the unstall.sh script and installing the x708v2 software?

Lisa

13 months ago
Score 0++

Hi,The X708 software is compatible with X708 V1.2 and V2.0.

X708 V2.0 Version board is updated,but script is not change.

Anonymous user #28

16 months ago
Score 0++

Hey, When the main power is down, I want the Raspberry pi to show a message, close some programs safely, and then shut down. Then, once I connect the main power again, the pi turns on automatically. That means I don't want to interact with the onboard button since the pi will be closed in a case. I referred to the Hardware documentation and could enable the automatic switch on when I connect the power, but that only happens when the X708 hat is off.

My problem now is how to switch the hat OFF through the software so that when I connect the power again, the pi will automatically turn on. I referred to the Software documentation, followed the directions, and repeated many times, but the "x708off" doesn't switch the hat OFF. When I run it on the command line, I get "X708 Shutting down..." but the x708 is still ON even after the command finishes running. I uninstalled and reinstalled the files many times, but the same thing happened every time.

I2C is enabled, and I can detect when the power is lost, but I can't switch off the x708 or shut down the pi. When I run "plsd.py", it gets stuck at "Shutdown in 5 seconds", but it never shuts down.

I appreciate your help,

I'm using Raspbian GNU/Linux 10 (buster) on raspberry pi 4

Cindy

16 months ago
Score 0++
Hi friend, we have done the test with the Raspberry Pi OS you provided,the X708 turn off after run the x708off, there is no issue, we suggest you do uninstall and reinstall the OS and shell script to test again, thanks!

Anonymous user #28

16 months ago
Score 0++

Yes, thank you for your time and assistance.

After some tests and comparing multiple variables, I managed to fix the problem in my original SD card. What worked for me was moving everything extra on the "/etc/rc.local" file to somewhere else and only keeping "/etc/x708pwr.sh &". Apparently, there was an error related to the "rc.local" file.

Anonymous user #27

17 months ago
Score 0++

Hi, how is evaluated the battery level ? I put 2 fully charged battery on the x708v2 but it considered they where 0%, so they have been charge for hours, and maybe overcharged !

Now battery make the x708 to bug. The battery failed led is blinking while power supply is connected.

How to calibrate the battery level mesure ?

Thanks

Lisa

17 months ago
Score 0++

Hi

Please check whether the positive and negative poles of the battery are correctly installed, if you use 18650 batteries.

Replace other batteries to test.

Anonymous user #26

20 months ago
Score 0++
unfortunately your node-red flow seem to have a syntax-error... Would you please provide it once more? i am very curious, how you did the node-red implementation. Thanks!

Anonymous user #25

20 months ago
Score 0++

Sorry, something went wrong while copying. Here is the node-red flow again:

[{"id":"b6e375dca488451c","type":"rpi-gpio in","z":"4f0f7e9b873ed151","name":"GPIO6 AC-Power","pin":"6","intype":"tri","debounce":"25","read":false,"bcm":true,"x":230,"y":1290,"wires":"2e6d1c8dd9466d21"},{"id":"9153e12fa19c8a01","type":"comment","z":"4f0f7e9b873ed151","name":"Raspi4 GPIO6 Power-Status","info":"","x":190,"y":1240,"wires":[]},{"id":"2e6d1c8dd9466d21","type":"change","z":"4f0f7e9b873ed151","name":"","rules":[{"t":"change","p":"payload","pt":"msg","from":"1","fromt":"num","to":"Stromausfall","tot":"str"},{"t":"change","p":"payload","pt":"msg","from":"0","fromt":"num","to":"Power OK","tot":"str"},{"t":"move","p":"payload","pt":"msg","to":"statustext","tot":"msg"},{"t":"set","p":"location","pt":"msg","to":"Raspi 4 ","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":460,"y":1290,"wires":"b161f6101e10d6e1","b9e74652d1f4361e"},{"id":"74050275ae9b637f","type":"i2c scan","z":"4f0f7e9b873ed151","name":"","busno":"1","x":410,"y":1170,"wires":[[],["c89c48fb592feec1"]]},{"id":"5e202a022d0a2c9b","type":"inject","z":"4f0f7e9b873ed151","name":"","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"","payloadType":"date","x":230,"y":1170,"wires":"74050275ae9b637f"},{"id":"c89c48fb592feec1","type":"debug","z":"4f0f7e9b873ed151","name":"I2C-Scan","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"payload","targetType":"msg","statusVal":"","statusType":"auto","x":570,"y":1170,"wires":[]},{"id":"59b8bddf8ad93388","type":"rpi-gpio in","z":"4f0f7e9b873ed151","name":"GPIO16","pin":"16","intype":"tri","debounce":"25","read":false,"bcm":true,"x":210,"y":1570,"wires":"d23af81852163f35"},{"id":"ff66b95250fe7ee3","type":"comment","z":"4f0f7e9b873ed151","name":"Raspi4 GPIO16 fan speed: 1 => fast, 0 => slow ","info":"","x":250,"y":1520,"wires":[]},{"id":"c2201db341984359","type":"i2c in","z":"4f0f7e9b873ed151","name":"","busno":"1","address":"54","command":"","count":"2","x":510,"y":1430,"wires":"62a377fb8b7c616f"},{"id":"62a377fb8b7c616f","type":"buffer-parser","z":"4f0f7e9b873ed151","name":"","data":"payload","dataType":"msg","specification":"spec","specificationType":"ui","items":[{"type":"uint16le","name":"result","offset":0,"length":1,"offsetbit":0,"scale":"1","mask":""}],"swap1":"swap16","swap2":"","swap3":"","swap1Type":"swap","swap2Type":"swap","swap3Type":"swap","msgProperty":"payload","msgPropertyType":"str","resultType":"keyvalue","resultTypeType":"return","multipleResult":false,"fanOutMultipleResult":false,"setTopic":true,"outputs":1,"x":660,"y":1430,"wires":"93c23bb720a9407c"},{"id":"93c23bb720a9407c","type":"function","z":"4f0f7e9b873ed151","name":"","func":"var result = Number (msg.payload.result);\n\nmsg.payload = {};\nif (msg.command == 2) {\n msg.payload.voltage = Number ((result * 78.125 / 1000000).toFixed(2));\n node.status({fill:\"green\",shape:\"dot\",text: \"voltage: \" + msg.payload.voltage + \" V,\"})\n}\n\nif (msg.command == 4) {\n msg.payload.capacity = Number((result /256).toFixed(1));\n if (msg.payload.capacity > 100){\n msg.payload.capacity = 100\n }\n node.status({fill:\"green\",shape:\"dot\",text: \"capacity: \" + msg.payload.capacity + \" %\"})\n}\n\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","libs":[],"x":820,"y":1430,"wires":"1a9cac3985983151"},{"id":"dc01f23d42cf45bd","type":"inject","z":"4f0f7e9b873ed151","name":"voltage: msg.command = > 2","props":[{"p":"command","v":"2","vt":"num"}],"repeat":"","crontab":"","once":true,"onceDelay":0.1,"topic":"","x":290,"y":1410,"wires":"c2201db341984359"},{"id":"ae2b5963a5f78976","type":"inject","z":"4f0f7e9b873ed151","name":"capacity: msg.command => 4","props":[{"p":"command","v":"4","vt":"num"}],"repeat":"","crontab":"","once":true,"onceDelay":0.1,"topic":"","x":300,"y":1450,"wires":"c2201db341984359"},{"id":"1a9cac3985983151","type":"debug","z":"4f0f7e9b873ed151","name":"battery","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"payload","targetType":"msg","statusVal":"","statusType":"auto","x":960,"y":1430,"wires":[]},{"id":"d23af81852163f35","type":"function","z":"4f0f7e9b873ed151","name":"","func":"if (msg.payload == 1) {\n msg.payload = \"fan speed: fast\"\n node.status({fill:\"red\",shape:\"dot\",text: msg.payload})\n}\n\nif (msg.payload == 0) {\n msg.payload = \"fan speed: slow\"\n node.status({fill:\"green\",shape:\"dot\",text: msg.payload})\n}\n\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","libs":[],"x":370,"y":1570,"wires":"6c72a981c041ee07"},{"id":"85351224cc71914a","type":"comment","z":"4f0f7e9b873ed151","name":"Raspi4 read votage/capacity","info":"","x":190,"y":1360,"wires":[]},{"id":"e8bb816803904e9e","type":"comment","z":"4f0f7e9b873ed151","name":"I2C Bus scan","info":"","x":140,"y":1120,"wires":[]},{"id":"6c72a981c041ee07","type":"debug","z":"4f0f7e9b873ed151","name":"fan speed","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"payload","targetType":"msg","statusVal":"","statusType":"auto","x":520,"y":1570,"wires":[]},{"id":"b9e74652d1f4361e","type":"debug","z":"4f0f7e9b873ed151","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"statustext","targetType":"msg","statusVal":"","statusType":"auto","x":670,"y":1290,"wires":[]}]

Anonymous user #25

20 months ago
Score 0++

For Geeworm UPS HAT: Here is my flow in node-red for reading the battery voltage and capacity as well as fan speed and power status. Required nodes: node-red-contrib-buffer-parser node-red-contrib-i2c node-red-node-pi-gpio

[{"id":"b6e375dca488451c","type":"rpi-gpio in","z":"4f0f7e9b873ed151","name":"GPIO6 AC-Power","pin":"6","intype":"tri","debounce":"25","read":false,"bcm":true,"x":230,"y":1290,"wires":"2e6d1c8dd9466d21"},{"id":"9153e12fa19c8a01","type":"comment","z":"4f0f7e9b873ed151","name":"Raspi4 GPIO6 Power-Status","info":"","x":190,"y":1240,"wires":[]},{"id":"2e6d1c8dd9466d21","type":"change","z":"4f0f7e9b873ed151","name":"","rules":[{"t":"change","p":"payload","pt":"msg","from":"1","fromt":"num","to":"Stromausfall","tot":"str"},{"t":"change","p":"payload","pt":"msg","from":"0","fromt":"num","to":"Power OK","tot":"str"},{"t":"move","p":"payload","pt":"msg","to":"statustext","tot":"msg"},{"t":"set","p":"location","pt":"msg","to":"Raspi 4 ","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":460,"y":1290,"wires":"b161f6101e10d6e1","b9e74652d1f4361e"},{"id":"74050275ae9b637f","type":"i2c scan","z":"4f0f7e9b873ed151","name":"","busno":"1","x":410,"y":1170,"wires":[[],["c89c48fb592feec1"]]},{"id":"5e202a022d0a2c9b","type":"inject","z":"4f0f7e9b873ed151","name":"","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"","payloadType":"date","x":230,"y":1170,"wires":"74050275ae9b637f"},{"id":"c89c48fb592feec1","type":"debug","z":"4f0f7e9b873ed151","name":"I2C-Scan","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"payload","targetType":"msg","statusVal":"","statusType":"auto","x":570,"y":1170,"wires":[]},{"id":"59b8bddf8ad93388","type":"rpi-gpio in","z":"4f0f7e9b873ed151","name":"GPIO16","pin":"16","intype":"tri","debounce":"25","read":false,"bcm":true,"x":210,"y":1570,"wires":"d23af81852163f35"},{"id":"ff66b95250fe7ee3","type":"comment","z":"4f0f7e9b873ed151","name":"Raspi4 GPIO16 fan speed: 1 => fast, 0 => slow ","info":"","x":250,"y":1520,"wires":[]},{"id":"c2201db341984359","type":"i2c in","z":"4f0f7e9b873ed151","name":"","busno":"1","address":"54","command":"","count":"2","x":510,"y":1430,"wires":"62a377fb8b7c616f"},{"id":"62a377fb8b7c616f","type":"buffer-parser","z":"4f0f7e9b873ed151","name":"","data":"payload","dataType":"msg","specification":"spec","specificationType":"ui","items":[{"type":"uint16le","name":"result","offset":0,"length":1,"offsetbit":0,"scale":"1","mask":""}],"swap1":"swap16","swap2":"","swap3":"","swap1Type":"swap","swap2Type":"swap","swap3Type":"swap","msgProperty":"payload","msgPropertyType":"str","resultType":"keyvalue","resultTypeType":"return","multipleResult":false,"fanOutMultipleResult":false,"setTopic":true,"outputs":1,"x":660,"y":1430,"wires":"93c23bb720a9407c"},{"id":"93c23bb720a9407c","type":"function","z":"4f0f7e9b873ed151","name":"","func":"var result = Number (msg.payload.result);\n\nmsg.payload = {};\nif (msg.command == 2) {\n msg.payload.voltage = Number ((result * 78.125 / 1000000).toFixed(2));\n node.status({fill:\"green\",shape:\"dot\",text: \"voltage: \" + msg.payload.voltage + \" V,\"})\n}\n\nif (msg.command == 4) {\n msg.payload.capacity = Number((result /256).toFixed(1));\n if (msg.payload.capacity > 100){\n msg.payload.capacity = 100\n }\n node.status({fill:\"green\",shape:\"dot\",text: \"capacity: \" + msg.payload.capacity + \" %\"})\n}\n\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","libs":[],"x":820,"y":1430,"wires":"1a9cac3985983151"},{"id":"dc01f23d42cf45bd","type":"inject","z":"4f0f7e9b873ed151","name":"voltage: msg.command = > 2","props":[{"p":"command","v":"2","vt":"num"}],"repeat":"","crontab":"","once":true,"onceDelay":0.1,"topic":"","x":290,"y":1410,"wires":"c2201db341984359"},{"id":"ae2b5963a5f78976","type":"inject","z":"4f0f7e9b873ed151","name":"capacity: msg.command => 4","props":[{"p":"command","v":"4","vt":"num"}],"repeat":"","crontab":"","once":true,"onceDelay":0.1,"topic":"","x":300,"y":1450,"wires":"c2201db341984359"},{"id":"1a9cac3985983151","type":"debug","z":"4f0f7e9b873ed151","name":"battery","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"payload","targetType":"msg","statusVal":"","statusType":"auto","x":960,"y":1430,"wires":[]},{"id":"d23af81852163f35","type":"function","z":"4f0f7e9b873ed151","name":"","func":"if (msg.payload == 1) {\n msg.payload = \"fan speed: fast\"\n node.status({fill:\"red\",shape:\"dot\",text: msg.payload})\n}\n\nif (msg.payload == 0) {\n msg.payload = \"fan speed: slow\"\n node.status({fill:\"green\",shape:\"dot\",text: msg.payload})\n}\n\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","libs":[],"x":370,"y":1570,"wires":"6c72a981c041ee07"},{"id":"85351224cc71914a","type":"comment","z":"4f0f7e9b873ed151","name":"Raspi4 read votage/capacity","info":"","x":190,"y":1360,"wires":[]},{"id":"e8bb816803904e9e","type":"comment","z":"4f0f7e9b873ed151","name":"I2C Bus scan","info":"","x":140,"y":1120,"wires":[]},{"id":"6c72a981c041ee07","type":"debug","z":"4f0f7e9b873ed151","name":"fan speed","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"payload","targetType":"msg","statusVal":"","statusType":"auto","x":520,"y":1570,"wires":[]},{"id":"b9e74652d1f4361e","type":"debug","z":"4f0f7e9b873ed151","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"statustext","targetType":"msg","statusVal":"","statusType":"auto","x":670,"y":1290,"wires":[]}]

Anonymous user #23

24 months ago
Score 0++
Could you explain what does enabling high state on GPIO13 does on v1.2 board? There is no schematic of the board.

Lisa

24 months ago
Score 0++

Hi,

GPIO13 for power management;please referX708-Hardware

Anonymous user #24

24 months ago
Score 0++

Lisa,

I know it's for power management. The x708softsd.sh script uses GPIO13 to perform a software shutdown. The question is: how? Does it just turn off the power on the board or does it somehow emulate the pressing of the button (GPIO5) and the proper shutdown is then performed by the x708pwr.sh script?

Anonymous user #22

24 months ago
Score 0++

When I enable I2C in raspi-config I get this: modprobe: FATAL: Module i2c-dev not found in directory /lib/modules/5.10.92-v8+

This command: sudo apt-get install python-smbus

throws this: Package python-smbus is not available, but is referred to by another package. This may mean that the package is missing, has been obsoleted, or is only available from another source

E: Package 'python-smbus' has no installation candidate

Lisa

24 months ago
Score 0++

Hi,

you can refer 【Anonymous user #17】

please try to [sudo apt-get install python3-smbus] to test.

Anonymous user #20

25 months ago
Score 0++

It is said that if you press the button for 3 seconds using the button, it will be safe shutdown.

I'm curious about the Python file or sh file that executes this.

Anonymous user #20

25 months ago
Score 0++

now. press the button 3 second => safe shutdown => power down

I want to know how to executes this on rasp from software code

like software x708off.

Anonymous user #20

25 months ago
Score 0++

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.
where can i set the code described above?

Anonymous user #21

25 months ago
Score 0++
Hi, I don't understand your questions, and requires you to have some basic knowledge of computers

Anonymous user #19

26 months ago
Score 0++
Just wanted to say that forcing things to /home/pi/ might not be the best idea in the world, especially if folks us something other than the Pi user account on the device. Might not hurt to put them somewhere else, then add wherever you put it to the path. I'm specifically talking about the x708bat.py and x708pid.py commands.

Anonymous user #18

26 months ago
Score 0++

Do I have to run python3 /home/pi/x708/x708asd.py & always at startup manually or does this happen automatically in the background to get ASD? I have no desktop environment - how to make this script run in the background via SSH? I have the X807 v.1.2 - as far as I can see there are no PLD pins to shorten. Can I run the AC power off/loss script anyway? Gives me currently an error: Traceback (most recent call last): File "/home/pi/x708pld.py", line 20, in <module> raw_input("Testing Started")

NameError: name 'raw_input' is not defined

Lisa

25 months ago
Score 0++

Hello,

please refer to X708-Software#FAQ.

Anonymous user #17

26 months ago
Score 0++

On Raspberry Pi OS Lite Kernel version: 5.10, Release date: October 30th 2021 the following command didn't work:

sudo apt-get install python-smbus

Package python-smbus is not available, but is referred to by another package. This may mean that the package is missing, has been obsoleted, or is only available from another source E: Package 'python-smbus' has no installation candidate

It's probably because I use Python 3.x - so it worked with:

sudo apt-get install python3-smbus

Anonymous user #16

26 months ago
Score 0++
I want a safe shutdown on button press but your code commands 'poweroff' - could you advise on the changes to replace this with 'shutdown now' so everything has time to shutdown correctly?

Lisa

26 months ago
Score 0++

Hi,

The script command we provide is 'x708off'----editable;

'poweroff' is a kernel command.

Anonymous user #15

28 months ago
Score 0++

Hello, I installed the x708 software as indicated, on a Raspberry Pi 4. I got the following error, after the following command. Is there any way to fix this? Thanks

pi@rachel:~ $ python x708bat.py

Traceback (most recent call last): File "x708bat.py", line 25, in <module> print ("Voltage:%5.2fV" % readVoltage(bus)) File "x708bat.py", line 9, in readVoltage read = bus.read_word_data(address, 2)

IOError: [Errno 121] Remote I/O error

Lisa

28 months ago
Score 0++
Hello, Please try to 【python3 x708bat.py】 and test it

Anonymous user #14

28 months ago
Score 0++

There are some problems in the python code with the actully raspberry pi os (raspbian).

If i want to use ``` sudo python3 x708bat.py ``` The system calls: ``` File "/home/pi/x708bat.py", line 24 print "******************" ^ SyntaxError: Missing parentheses in call to 'print'. Did you mean print("******************")? ```

If I change it to print(*******) i had the follow error:

``` File "/home/pi/x708bat.py", line 25 print "Voltage:%5.2fV" % readVoltage(bus) ^ SyntaxError: invalid syntax

```

Any idea how I can fix that?

Thx!

Harry

28 months ago
Score 0++

The syntax of print in python2 and python3 is different, so there will be this error, you can run the following command: python2 x708bat.py or

python x708bat.py

Harry

28 months ago
Score 0++

I have just modify the install.sh for the python 3 because of print function.

You can update the install.sh, run the command 'git pull', then run './uninstall.sh' to uninstall, then reinstall it.

Anonymous user #11

30 months ago
Score 0++

python3 x708pld.py 1.Make sure your power adapter is connected 2.Disconnect and connect the power adapter to test 3.When power adapter disconnected, you will see: AC Power Loss or Power Adapter Failure 4.When power adapter reconnected, you will see: AC Power OK, Power Adapter OK Traceback (most recent call last): File "/root/x708pld.py", line 20, in <module> raw_input("Testing Started")

NameError: name 'raw_input' is not defined

Anonymous user #12

28 months ago
Score 0++
just replace to input() for python3

Anonymous user #11

30 months ago
Score 0++

python3 x728bat.py File "/root/x728bat.py", line 20 print "******************" ^

SyntaxError: Missing parentheses in call to 'print'. Did you mean print("******************")?

Anonymous user #10

30 months ago
Score 0++

Dear Geekworm team, I just set up successfully the X708 board and installedt he software. However, I get the following error at step 6 (on Raspbian) when I try to read the battery level. Any idea?

pi@raspberrypi:~ $ sudo python x708bat.py Traceback (most recent call last): File "x708bat.py", line 21, in <module> bus = smbus.SMBus(1) # 0 = /dev/i2c-0 (port I2C0), 1 = /dev/i2c-1 (port I2C1)

IOError: [Errno 2] No such file or directory

Anonymous user #13

28 months ago
Score 0++

I have the same issue. Geekworm team, please help us

" $ sudo python x708bat.py Traceback (most recent call last): File "x708bat.py", line 21, in <module> bus = smbus.SMBus(1) # 0 = /dev/i2c-0 (port I2C0), 1 = /dev/i2c-1 (port I2C1) IOError: [Errno 2] No such file or directory

"

Anonymous user #13

28 months ago
Score 0++

sudo raspi-config

select "3 Interface Options" and hit enter select "P5 I2C" and hit enter then go to finish

and reboot.

Anonymous user #9

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

Lisa

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

Anonymous user #9

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

Harry

32 months ago
Score 0++
sorry, should be install.sh

Anonymous user #8

32 months 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

32 months 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

33 months ago
Score 0++

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

Thanks

Lisa

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

Anonymous user #6

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

Lisa

33 months ago
Score 0++
Hi,please refer here:X708-Hardware

Anonymous user #5

37 months ago
Score 0++

Guten Tag,

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

Lisa

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

Anonymous user #4

40 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

40 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

41 months ago
Score 0++

Hi,

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

Anonymous user #3

41 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

41 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

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

Georgefeichter

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

Georgefeichter

43 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

43 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

43 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