Problems installing DI Sensor


#1

Hi,

I am new to using the GoPiGo and I cannot install the DI Sensor.

I have tried installing the DI sensor on the command line of the pi using the instructions from this link but I get an error on the command line when I type in curl etc

https://di-sensors.readthedocs.io/en/master/quickstart.html#how-to-install-the-di-sensors

If I try and import the sensors in python, I get this error


I am really new to using the GoPiGo so just trying to figure out how to use Python to program the sensors, if anyone can offer advice on how to solve this problem and point me in the right direction, I would be grateful

Many thanks

Rob


#2

Here are my steps on Raspian for Robots (are you on R4R or DexterOS?):

=== Update GoPiGo3 software to latest:

curl -kL dexterindustries.com/update_gopigo3 | bash

=== Update DI Sensors

curl -kL dexterindustries.com/update_sensors | bash

then cd into Examples/GoPiGo3/

and ran

python easy_Distance_Sensor.py


#3

Hi

I am using the standard DexterOS that came with the gopigo, I have tried this but I still get the error I mentioned earlier.

Any suggestions? What are the differences in Raspian for robots and the dexter OS?


#4

Sorry - I should have asked the OS question first. I have not ventured into DexterOS. It may be that DexterOS already has the DI sensor code installed.

(Do any of the examples that import easygopigo3 work (instead of importing the DI sensors package)?

Like this:

import easygopigo3 as easy
import time

# create an "easy gopigo" instance
egpg = easy.EasyGoPiGo3()

# create a distance sensor instance
my_ds = egpg.init_distance_sensor()

while True:
    # Directly print the values of the sensor.
    print("Distance Sensor Reading: {} mm ".format(my_ds.read_mm()))
    time.sleep(5)

#5

I tried the code you mentioned, below is the error I got once I ran the code

If I download raspbian for robots, would it be easier? I found this link last night and downloaded the image, can you confirm if it is the right image?

If I am running raspbian for robots, can I still connect to the gopigo using wifi and type in mygopigy.com and use the programming environment created by Dexter?

The sensor is working if I use bloxter but it isnt working using the commands I have online in Python.

If you could direct me to a guide for raspbian for robots, I am hoping I will then have more luck.

Thank you again for your reply, really appreciated.

Rob


#6

Please let the DI folks have a shot at helping you in the environment you have already invested time to become familiar with. They can get your environment configured to use the distance sensor in python in DexterOS. The fact that it works in Bloxter, which is a visual layer over python, means you are very close, with working hardware.


#7

Hi,

Thank you, appreciate your reply. I have tried absolutely everything but really getting stuck with making sure the DI sensor is installed. Hopefully someone replies to this thread soon as I think this is going to the same problem for all sensors. Whilst I wait for someone to reply, can you direct me to somewhere that will show me a list of python commands for the Dexter OS? I have their pdf guide so want to check that it is not a NOOB mistake.

Appreciate you taking the time to reply.

Rob


#8

Hello there,
I’ll try to help as much as I can
First, are you on DexterOS or on Raspbian for Robots?

My guess is that you are using a pretty old version of DexterOS. Your image in the original post shows the Adafruit_WebIDE folder which we no longer use.

Your best bet would be to get DexterOS 2.2.2 here.


#9

That is great, I am logged on now, one small issues, what is the password? Please see the attached.

Can you also direct me to a website with up to date instructions for the Dexter OS in Python so I can start programming again?

Thanks for your reply


#12

jupyter user doesn’t have the permissions to use elevated permissions (sudo).
If you were to type in the password, it would still not work. And just for the record, the jupyter's password is jupyter.


#14

What changes do you want to do in raspi-config? DexterOS is all set up for you already.

The documentation is available to you :


#15

Hi,

thank you all for your replies, everything is built in so I do not need to make any changes, the older version I edited the setup but can see it is not required here.

I am using the documentation to measure the distance so the robot then responds, can some advise what the issue is here?

Thank you all of your help, trying to get used to this environment.


#16

Are you getting any errors ?

Also I would advice not to use time.sleep(1) after the gpg.forward() in your forever loop.
If an obstacle shows up during that time, it would not get detected.
Sleep for a tiny amount (like 0.05 seconds) just to keep the loop from looping too fast.


#17

Yes, there was an error. I tried the below as well

I will send the error in the next thread


#18

This is the error from the above code. At the moment, we just need to measure the distance, then stop, go back then left.

Any pointers, I would be grateful


#19

Looks like you are moving along well now.

(pointer: compare your “if” statement now and before…)


#20

Thanks all, moving along quite quickly now. Appreciate all the help, thanks again