[Solved] Error Running the basic_robot.py example

here is the log I am pasting in this mail:

pi@raspberrypi:~/GoPiGo/Setup pi@raspberrypi:~/GoPiGo/Setup sudo ./install.sh


| __ \ | |
| | | | _____ | | ___ _ __
| | | |/ _ \ / / / _ \ '|
| || | /> <| || / |
|
/ _
//___|| _ _
|
| | | | | ()
| | _ __ | | _ | | _ __ _ ___ ___
| | | ’
\ / \ | | | / __| | '| |/ _ / __|
| || | | | (
| | |
| _
\ || | | | /_
|
___|
| ||_,|_,|/_|| ||_||/


| ____ | | |] | | ____ | |
|
| || | | || |_____|
Welcome to GoPiGo Installer.
Please ensure internet connectivity before running this script.
NOTE: Raspberry Pi wil reboot after completion.Special thanks to Joe
Sanford at Tufts University. This script was derived from his work. Thank
you Joe! Must be running as Root user
Press ENTER to begin…
Check for internet connectivity…
Connected
Installing Dependencies
Reading package lists… Done
Building dependency tree
Reading state information… Done
arduino is already the newest version.
git is already the newest version.
libnss-mdns is already the newest version.
minicom is already the newest version.
python-dev is already the newest version.
python-pip is already the newest version.
python-serial is already the newest version.
i2c-tools is already the newest version.
libi2c-dev is already the newest version.
python-rpi.gpio is already the newest version.
python-smbus is already the newest version.
The following packages were automatically installed and are no longer
required:
libasn1-8-heimdal libftdi1 libgssapi3-heimdal libhcrypto4-heimdal
libheimbase1-heimdal libheimntlm0-heimdal libhx509-5-heimdal
libkrb5-26-heimdal libroken18-heimdal libwind0-heimdal libxfce4ui-1-0
xfce-keyboard-shortcuts
Use ‘apt-get autoremove’ to remove them.
0 upgraded, 0 newly installed, 0 to remove and 10 not upgraded.
Requirement already up-to-date: RPi.GPIO in /usr/lib/python2.7/dist-packages
Cleaning up…
Dependencies installed
running install
running bdist_egg
running egg_info
writing GoPiGo.egg-info/PKG-INFO
writing top-level names to GoPiGo.egg-info/top_level.txt
writing dependency_links to GoPiGo.egg-info/dependency_links.txt
reading manifest file 'GoPiGo.egg-info/SOURCES.txt’
writing manifest file ‘GoPiGo.egg-info/SOURCES.txt’
installing library code to build/bdist.linux-armv7l/egg
running install_lib
running build_py
creating build/bdist.linux-armv7l/egg
copying build/lib.linux-armv7l-2.7/gopigo.py -> build/bdist.linux-armv7l/egg
byte-compiling build/bdist.linux-armv7l/egg/gopigo.py to gopigo.pyc
creating build/bdist.linux-armv7l/egg/EGG-INFO
copying GoPiGo.egg-info/PKG-INFO -> build/bdist.linux-armv7l/egg/EGG-INFO
copying GoPiGo.egg-info/SOURCES.txt -> build/bdist.linux-armv7l/egg/EGG-INFO
copying GoPiGo.egg-info/dependency_links.txt ->
build/bdist.linux-armv7l/egg/EGG-INFO
copying GoPiGo.egg-info/top_level.txt ->
build/bdist.linux-armv7l/egg/EGG-INFO
zip_safe flag not set; analyzing archive contents…
creating ‘dist/GoPiGo-0.0.0-py2.7.egg’ and adding
’build/bdist.linux-armv7l/egg’ to it
removing ‘build/bdist.linux-armv7l/egg’ (and everything under it)
Processing GoPiGo-0.0.0-py2.7.egg
Removing /usr/local/lib/python2.7/dist-packages/GoPiGo-0.0.0-py2.7.egg
Copying GoPiGo-0.0.0-py2.7.egg to /usr/local/lib/python2.7/dist-packages
GoPiGo 0.0.0 is already the active version in easy-install.pth
Installed /usr/local/lib/python2.7/dist-packages/GoPiGo-0.0.0-py2.7.egg
Processing dependencies for GoPiGo==0.0.0
Finished processing dependencies for GoPiGo==0.0.0
running install
running bdist_egg
running egg_info
writing Adafruit_DHT.egg-info/PKG-INFO
writing top-level names to Adafruit_DHT.egg-info/top_level.txt
writing dependency_links to Adafruit_DHT.egg-info/dependency_links.txt
reading manifest file 'Adafruit_DHT.egg-info/SOURCES.txt’
writing manifest file ‘Adafruit_DHT.egg-info/SOURCES.txt’
installing library code to build/bdist.linux-armv7l/egg
running install_lib
running build_py
running build_ext
creating build/bdist.linux-armv7l/egg
creating build/bdist.linux-armv7l/egg/Adafruit_DHT
copying build/lib.linux-armv7l-2.7/Adafruit_DHT/Test.py ->
build/bdist.linux-armv7l/egg/Adafruit_DHT
copying build/lib.linux-armv7l-2.7/Adafruit_DHT/common.py ->
build/bdist.linux-armv7l/egg/Adafruit_DHT
copying build/lib.linux-armv7l-2.7/Adafruit_DHT/init.py ->
build/bdist.linux-armv7l/egg/Adafruit_DHT
copying build/lib.linux-armv7l-2.7/Adafruit_DHT/Raspberry_Pi.py ->
build/bdist.linux-armv7l/egg/Adafruit_DHT
copying build/lib.linux-armv7l-2.7/Adafruit_DHT/Raspberry_Pi_2.py ->
build/bdist.linux-armv7l/egg/Adafruit_DHT
copying build/lib.linux-armv7l-2.7/Adafruit_DHT/Beaglebone_Black.py ->
build/bdist.linux-armv7l/egg/Adafruit_DHT
copying build/lib.linux-armv7l-2.7/Adafruit_DHT/Raspberry_Pi_2_Driver.so ->
build/bdist.linux-armv7l/egg/Adafruit_DHT
copying build/lib.linux-armv7l-2.7/Adafruit_DHT/platform_detect.py ->
build/bdist.linux-armv7l/egg/Adafruit_DHT
byte-compiling build/bdist.linux-armv7l/egg/Adafruit_DHT/Test.py to Test.pyc
File “build/bdist.linux-armv7l/egg/Adafruit_DHT/Test.py”, line 22
import .Test_Driver as driver
^
SyntaxError: invalid syntax
byte-compiling build/bdist.linux-armv7l/egg/Adafruit_DHT/common.py to
common.pyc
byte-compiling build/bdist.linux-armv7l/egg/Adafruit_DHT/init.py to
init.pyc
byte-compiling build/bdist.linux-armv7l/egg/Adafruit_DHT/Raspberry_Pi.py to
Raspberry_Pi.pyc
byte-compiling build/bdist.linux-armv7l/egg/Adafruit_DHT/Raspberry_Pi_2.py
to Raspberry_Pi_2.pyc
byte-compiling
build/bdist.linux-armv7l/egg/Adafruit_DHT/Beaglebone_Black.py to
Beaglebone_Black.pyc
byte-compiling build/bdist.linux-armv7l/egg/Adafruit_DHT/platform_detect.py
to platform_detect.pyc
creating stub loader for Adafruit_DHT/Raspberry_Pi_2_Driver.so
byte-compiling
build/bdist.linux-armv7l/egg/Adafruit_DHT/Raspberry_Pi_2_Driver.py to
Raspberry_Pi_2_Driver.pyc
creating build/bdist.linux-armv7l/egg/EGG-INFO
copying Adafruit_DHT.egg-info/PKG-INFO ->
build/bdist.linux-armv7l/egg/EGG-INFO
copying Adafruit_DHT.egg-info/SOURCES.txt ->
build/bdist.linux-armv7l/egg/EGG-INFO
copying Adafruit_DHT.egg-info/dependency_links.txt ->
build/bdist.linux-armv7l/egg/EGG-INFO
copying Adafruit_DHT.egg-info/top_level.txt ->
build/bdist.linux-armv7l/egg/EGG-INFO
writing build/bdist.linux-armv7l/egg/EGG-INFO/native_libs.txt
zip_safe flag not set; analyzing archive contents…
creating ‘dist/Adafruit_DHT-1.2.0-py2.7-linux-armv7l.egg’ and adding
’build/bdist.linux-armv7l/egg’ to it
removing ‘build/bdist.linux-armv7l/egg’ (and everything under it)
Processing Adafruit_DHT-1.2.0-py2.7-linux-armv7l.egg
Removing
/usr/local/lib/python2.7/dist-packages/Adafruit_DHT-1.2.0-py2.7-linux-armv7l.egg
Copying Adafruit_DHT-1.2.0-py2.7-linux-armv7l.egg to
/usr/local/lib/python2.7/dist-packages
Adafruit-DHT 1.2.0 is already the active version in easy-install.pth
Installed
/usr/local/lib/python2.7/dist-packages/Adafruit_DHT-1.2.0-py2.7-linux-armv7l.egg
Processing dependencies for Adafruit-DHT==1.2.0
Finished processing dependencies for Adafruit-DHT==1.2.0
fatal: destination path ‘wiringPi’ already exists and is not an empty
directory.
wiringPi Build script

WiringPi Library
[UnInstall]
make: Nothing to be done for ‘all’.
[Install Headers]
[Install Dynamic Lib]
WiringPi Devices Library
[UnInstall]
make: Nothing to be done for ‘all’.
[Install Headers]
[Install Dynamic Lib]
GPIO Utility
make: Nothing to be done for ‘all’.
[Install]
All Done.
NOTE: To compile programs with wiringPi, you need to add:
-lwiringPi
to your compile line(s) To use the Gertboard, MaxDetect, etc.
code (the devLib), you need to also add:
-lwiringPiDev
to your compile line(s).
wiringPi Installed
Removing blacklist from /etc/modprobe.d/raspi-blacklist.conf . . .
I2C removed from blacklist
SPI removed from blacklist
Adding I2C-dev and SPI-dev in /etc/modules . . .
I2C-dev already there
i2c-bcm2708 added
spi-dev added
Making I2C changes in /boot/config.txt . . .
Making changes to Arduino . . .
–2016-08-31 12:48:59–
http://project-downloads.drogon.net/gertboard/avrdude_5.10-4_armhf.deb
Resolving project-downloads.drogon.net (project-downloads.drogon.net)…
188.246.205.22, 2a03:9800:10:7b::2
Connecting to project-downloads.drogon.net
(project-downloads.drogon.net)|188.246.205.22|:80…
connected.
HTTP request sent, awaiting response… 200 OK
Length: 202814 (198K) [application/x-debian-package]
Saving to: ‘avrdude_5.10-4_armhf.deb’
avrdude_5.10-4_armhf.deb
100%[==========================================================================================================================================>]
198.06K --.-KB/s in 0.001s
2016-08-31 12:49:01 (143 MB/s) - ‘avrdude_5.10-4_armhf.deb’ saved
[202814/202814]
(Reading database … 123678 files and directories currently installed.)
Preparing to unpack avrdude_5.10-4_armhf.deb …
Unpacking avrdude (1:5.10-4) over (1:5.10-4) …
Setting up avrdude (1:5.10-4) …
Processing triggers for man-db (2.7.0.2-5) …
–2016-08-31 12:49:17–
http://project-downloads.drogon.net/gertboard/setup.sh
Resolving project-downloads.drogon.net (project-downloads.drogon.net)…
188.246.205.22, 2a03:9800:10:7b::2
Connecting to project-downloads.drogon.net
(project-downloads.drogon.net)|188.246.205.22|:80…
connected.
HTTP request sent, awaiting response… 200 OK
Length: 1870 (1.8K) [application/x-sh]
Saving to: ‘setup.sh
setup.sh
100%[==========================================================================================================================================>]
1.83K --.-KB/s in 0s
2016-08-31 12:49:18 (76.1 MB/s) - ‘setup.sh’ saved [1870/1870]
Setting up Raspberry Pi to make it work with the Gertboard
and the ATmega chip on-board with the Arduino IDE.
Checking …
Avrdude: OK
Arduino IDE: OK
Fetching files:
boards.txt
programmers.txt
avrsetup
Replacing/updating files:
inittab: cp: cannot stat ‘inittab’: No such file or directory
./setup.sh: line 61: inittab: No such file or directory
mv: cannot stat ‘/tmp/inittab.6115’: No such file or directory
OK
cmdline.txt: Backup exists: not overwriting
boards.txt: Backup of boards.txt exists, not overwriting
programmers.txt: Backup of programmers.txt exists, not overwriting
All Done.
Check and reboot now to apply changes.
no crontab for root
rm: cannot remove ‘/tmp/di_update’: No such file or directory
The user pi' is already a member ofi2c’.
chmod: cannot access
‘/home/pi/Desktop/GoPiGo/Software/Scratch/GoPiGo_Scratch_Scripts/*.sh’: No
such file or directory
Please restart the Raspberry Pi for the changes to take effect
Please restart to implement changes!


| __ | |/ | |/\ | __ _ |
| |
) | |
| (
| | / \ | |) | | |
| _ /| | _ \ | | / /\ \ | _ / | |
| | \ | |
__ ___) | | |/ ____ | | \ \ | |
|
| __
|__/ |// __| _\ |_|
Please restart to implement changes!
To Restart type sudo reboot
pi@raspberrypi:~/GoPiGo/Setup $

Thanks for pasting the log in. It’s a surefire method and now we can see it properly. Those forums are brand new, maybe there’s an issue in their configuration. Sorry about that, we’ll look into that specific issue (of not seeing the log file)

As for the log itself, it seems perfectly fine. There are couple of error messages in it, but those errors do not matter.
Could you run a test for me if you don’t mind?
Open up a terminal window
Type python and return
On the very first line, there will be a version number for python. Could you confirm that it’s a version that starts with 2, and not 3? (most likely it will be 2.7.9)
You’ll have a new prompt that will look like this: >>>
type in import gopigo and return
Are you getting an error message then?

Thanks for your patience on this as we work through the issue.

Cleo

Python version is 2.7.9 also, after I type in import gopigo and return, I
don’t get any error message.

Can you try out this example: https://github.com/DexterInd/GoPiGo/blob/master/Software/Python/basic_test_all.py and give the f command first and see if it works.

Can you also run i2cdetect -y 1 in the terminal and paste what you get.

I finally made it to work, but now another problem till my gopigo and
raspberry pi is connected to usb cable, it works and accepts the commands
for movement.
As soon as I disconnect the usb cable and connect the battery power, it
doesn’t work and my putty session also gets disconnected.

Any help?

What was causing the problems and what made them go away.

Coming to the power issue, are your batteries fresh and have voltage greater than 9V. It might have restarted, can you turn of the GoPiGo and power it from the batteries and see if you are able to connect via putty in a minute or so and are you using Ethernet or wifi to connect.

it works now, your line “connect via putty in a minute or” worked…

thanks for the time.

Great to hear that.

I am still wondering what your initial error was from. Do you have any more pointers on what might be causing it and what ended up solving it. It would really help us to improve our documentation.

Thanks a lot for your patience with the problem and sorry for the initial hiccups. I hope you have a great experience with the GoPiGo.

I just executed all the steps again what I shared with you earlier, no
change in my steps. But one thing I should have bought “Rapsbian for
Robots” SD card.

You know as I am using same SD card of RaspberryPI to install gopigo also.

Thanks to your team for continuous support. I have got another 2 to make
now.

You can follow the instructions here and download and set up Raspbian for Robots on your own SD card.

This topic was automatically closed after 24 hours. New replies are no longer allowed.