Reflective Sensor

Hello together, trying to get GrovePi running but so far stuck with following error. There were similar threats but i couldn`t make progress so far. Any help would be much appreciated.

RaspberryPi 4b
GrovePi+ (light is on)
Sensor: Infrared_reflective_sensor
Installed: Python3, Version 3.8.10
Installed: curl -kL dexterindustries.com/update_grovepi | bash -s – --user-local --bypass-gui-installation
Error: ModuleNotFoundError: No module named ‘di_i2c’

Goal: Make the sensor running
Command: sudo python grove_infrared_reflective_sensor.py

Gives me following Error:

pi@rene-rasp1:~/Dexter/GrovePi/Software/Python$ sudo python3 grove_infrared_reflective_sensor.py
Traceback (most recent call last):
File “grove_infrared_reflective_sensor.py”, line 47, in
import grovepi
File “/home/pi/Dexter/GrovePi/Software/Python/grovepi.py”, line 54, in
import di_i2c
ModuleNotFoundError: No module named ‘di_i2c’

1 Like

What OS are you running?

2 Likes

Hi Jim, thanks yours. I just looked it up and apparently the wrong one :slight_smile: ubuntu, i will try to install raspbian and will try it again

2 Likes

Only the archived 32-bit Pi OS Legacy is tested/recommended as base for the GrovePi,

Disclaimer: I do not own a GrovePi+ so this is what I would try if I did:

NOTE: Will not work for Raspberry Pi 5

  1. Download the archived Legacy PiOS 32-bit (Image date: May 3, 2023)
  • Use Raspberry Pi Imager
    • Choose OS → CUSTOM → choose your downloaded archived Legacy PiOS 32-bit file
  • Set it up to connect to your network, select username: pi <–very important
  • Make sure it is fully working
    • setup with attached monitor or remote shell or VNC to the desktop
  1. Follow the GrovePi Setup instructions
2 Likes

Hi there, so i am running the OS you were posting, see below. It is far off the marketed plug and play. I still i get the same error message:

Traceback (most recent call last):
File “grove_infrared_reflective_sensor.py”, line 47, in
import grovepi
File “/home/pi/Dexter/GrovePi/Software/Python/grovepi.py”, line 54, in
import di_i2c
ModuleNotFoundError: No module named ‘di_i2c’

See here also: PRETTY_NAME=“Raspbian GNU/Linux 10 (buster)”
NAME=“Raspbian GNU/Linux”
VERSION_ID=“10”
VERSION=“10 (buster)”
VERSION_CODENAME=buster
ID=raspbian
ID_LIKE=debian

1 Like

You did a reboot after the install?

Perhaps try this:

curl -kL dexterindustries.com/update_sensors | bash
2 Likes

Another thing that I sometimes forget to do is enable i2c in raspi-config. (:man_facepalming:)

If you don’t do that the module won’t load.

2 Likes

it worked, thanks very much, it safed my day. After i spent a whole day trying to bring it online.
I would like to understand what the issue was. i think i tried this command before, so not really sure why suddenly it works.

2 Likes

I totally understand you - I hate “magic” and I want to know what the problem was too when something like that happens to me.

  • Did you change the operating system?
  • Did you re-flash the card?
  • Did you try a different card?
  • Did you try setting something via raspi-config?
  • What brand of SD card are you using?

Maybe it was the reboot after starting up the older O/S?  Sometimes you just don’t know and it drives you crazy!

Glad it’s working!

1 Like

Hi Jim, thanks for raising the right questions. In fact i think what also helped is the reference to the raspi-config. Anyhow it is working now :slight_smile:

2 Likes