I am discovering that using the hard copy instructions was a bad idea.
Those instructions say to do the git from “an appropriate location” on page 7. Instead it would have been clearer if it said to do the git clone from the ~pi/Desktop directory.
The problem is that the script install.sh is hard coded to copy grove.pth from ~pi/Desktop/GrovePi/ and that the grove.pth contains the path hardcoded to be from the …Desktop directory as well.
The install.sh script error is tough to spot as it happens as nearly the last step before the install.sh script reboots the pi, unless you break out of it.
There are a couple of ways to fix the problem:
move the GrovePi directory to the Desktop and then run the …Script/install.sh again,
symbolically link ~pi/GrovePi ~pi/Desktop/GrovePi together
Switch to a DEX pi-image
-OR-
sudo cp ~pi/GrovePi/Script/grove.pth to /usr/lib/python2.7/dist-packages/grove.pth
then edit the file to the as-installed correct paths
of course, a supplement of the install.sh script to the github repo to do some error checking would be even better.
I can make some suggestions if desired. ( the test function [ -x comes to mind …as well as some sed strings to work from $PWD in case some folks like me hate having directories littered all over the desktop )
Furthermore the examples from the hardcopy instructions are riddled with mistakes. My favorite so far is page 22, where the words say to use a buzzer and the rotary, but the example is about using the Ultrasonic and Relay sensors… LOL. The pictures work… However, the code for that example seems very flakey once you get it running. The sensors do not seem to work properly, but that is a whole other topic…
Anyway, I have it SOLVED for myself for now, and the next re-image I will know what to watch out for.
Trust me when I say learning how python parses the paths is not very easy. But ultimately i found that if you run python interactively on the shell,as shown below you can see the difference that the grove.pth file makes.
----Here’s the clue I got from python.org, ignore that it is python 2.3 as it’s clearly a very old man page
$ python
Python 2.2 (#11, Oct 3 2002, 13:31:27)
[GCC 2.96 20000731 (Red Hat Linux 7.3 2.96-112)] on linux2
Type “help”, “copyright”, “credits” or “license” for more information.
>>> import sys
>>> sys.path
[’’, ‘/usr/local/lib/python2.3’, ‘/usr/local/lib/python2.3/plat-linux2’,
’/usr/local/lib/python2.3/lib-tk’, ‘/usr/local/lib/python2.3/lib-dynload’,
’/usr/local/lib/python2.3/site-packages’]
>>>
After I fixed it, my actual result:
pi@barium:~ $ python
Python 2.7.9 (default, Mar 8 2015, 00:52:26)
[GCC 4.9.2] on linux2
Type “help”, “copyright”, “credits” or “license” for more information.
>>> import sys
>>> sys.path
[’’, ‘/usr/lib/python2.7’, ‘/usr/lib/python2.7/plat-arm-linux-gnueabihf’, ‘
/usr/lib/python2.7/lib-tk’, ‘/usr/lib/python2.7/lib-old’, ‘/usr/lib/python2
.7/lib-dynload’, ‘/usr/local/lib/python2.7/dist-packages’, ‘/usr/lib/python
2.7/dist-packages’, ‘/home/pi/GrovePi/Software/Python/grove_i2c_adc’, ‘/hom
e/pi/GrovePi/Software/Python/grove_rgb_lcd’, ‘/home/pi/GrovePi/Software/Pyt
hon/grove_accelerometer_16g’, ‘/home/pi/GrovePi/Software/Python/grove_barom
eter_sensors/barometric_sensor_bmp085’, ‘/home/pi/GrovePi/Software/Python/g
rove_barometer_sensors/barometric_sensor_bmp180’, ‘/home/pi/GrovePi/Softwar
e/Python/grove_i2c_digital_light_sensor’, ‘/home/pi/GrovePi/Software/Python
/grove_i2c_oled_128_64’, ‘/home/pi/GrovePi/Software/Python/grove_i2c_sunlig
ht_sensor’, ‘/home/pi/GrovePi/Software/Python/grove_i2c_touch’, ‘/home/pi/G
rovePi/Software/Python/grove_ir_receiver’, ‘/home/pi/GrovePi/Software/Pytho
n/grove_oled’, ‘/home/pi/GrovePi/Software/Python’, ‘/usr/lib/python2.7/dist
-packages/gtk-2.0’, ‘/usr/lib/pymodules/python2.7’]
>>>
Not the prettiest path environment, again, a re-write to make a single directory with the final modules would be much cleaner. Again that is a repo organization, or better yet make a clean package for grovepi might be worth a little time.
apologies if I missed that this was already documented as known issue.