Unable to use the compass module

Hello again,

I can’t use the GoPiGo compass module, apparently the python module “grove_compass_lib” can’t be found. I am using the v1.3 of the software and firmware.

I tried to make the example work (compass_bot.py), without modifying a single thing, and the module can not be imported.

Is there an update I should do?

Hey,
Can you try compying the library for https://github.com/DexterInd/GrovePi/blob/master/Software/Python/grove_compass_lib.py to the example folder and see if that works.

-Karan

I had it working a few weeks ago. I think i copied the files as Karan mentioned.
Klaus

Hello,

I have added the library found on the github and now it is working fine
I don’t know why the file was not already on the Raspberry, but at least now everything works great, thanks for the help!

Hi I’m also having this issue. I was wondering why the library can’t be imported from the grovepi package, something like:

from grovepi import grove_compass_lib

I’ve a number of directories and I don’t want local copies of the library in them all… Is there a way to copy it into the parent package?

Hi @tom.a.broughton,

You can try import grove_compass_lib that will work directly as we have made our grovepi libraries accessible from anywhere inside the Pi. If this doesn’t work, do a software update on your Pi and it will work.

-Shoban