Program error reporting

Hello everyone, I’m a primary school student. When I set up Grove_Base_Hat and Temperature_Sensor_V1.2 on raspberry pi 4, I ran the wiki program and reported an error. What should I do???

Hi @n3em3o
Can you take a picture of the error information?

pi@raspberrypi:~/grove.py/grove $ python grove_temperature_sensor.py 0
Traceback (most recent call last):
  File "grove_temperature_sensor.py", line 48, in <module>
    main()
  File "grove_temperature_sensor.py", line 36, in main
    sh = SlotHelper(SlotHelper.ADC)
  File "/usr/local/lib/python2.7/dist-packages/grove/helper/helper.py", line 47, in __init__
    adc = ADC()
  File "/usr/local/lib/python2.7/dist-packages/grove/adc.py", line 59, in __init__
    self.bus = grove.i2c.Bus()
  File "/usr/local/lib/python2.7/dist-packages/grove/i2c.py", line 51, in __init__
    Bus.instance = smbus.SMBus(bus)
  File "/usr/local/lib/python2.7/dist-packages/smbus2/smbus2.py", line 279, in __init__
    self.open(bus)
  File "/usr/local/lib/python2.7/dist-packages/smbus2/smbus2.py", line 308, in open
    self.fd = os.open(filepath, os.O_RDWR)
OSError: [Errno 2] No such file or directory: '/dev/i2c-1'

Hi @n3em3o
Please use sudo raspi-config enter raspberry pi software configuration tool, click interfacing options—>P5 i2c to enable i2c.enableI2C

But it will still report a mistake. What should I do?
error:
OSError: [Errno 2] No such file or directory: '/dev/i2c-1'

@n3em3o Did you installed the grove.py on the raspberry pi? if not please do that first.

with the single command below, we can install/update all dependencies and latest grove.py.

curl -sL https://github.com/Seeed-Studio/grove.py/raw/master/install.sh | sudo bash -s -

and try again! please not that, the Seeed Temperature_Sensor_V1.2 is Analog one so you should temperature sensor to port A0 of the Base Hat. like image below.

More information:

Grove Base Hat for Raspberry Pi (https://wiki.seeedstudio.com/Grove_Base_Hat_for_Raspberry_Pi/)

Grove - Temperature Sensor V1.2(https://wiki.seeedstudio.com/Grove-Temperature_Sensor_V1.2/)

What shou I do?

Check you internet connection, if everything goes well, you will see the following notice.

Successfully installed grove.py-0.5
#######################################################
Lastest Grove.py from github install complete !!!
#######################################################

My network is connected.

But I’ve run it before grove.py Under folder install.sh

That also works! and you also need to enable the Raspberry Pi I2C
mentioned by @jiachenglumentioed.

1 Like

I tried, but it didn’t work

Ok, that’s very strange, can you try to reset the Raspberry pi or try to install new OS.

I installed the latest Raspberry Pi OS.It’s not Raspbian

That’s fine, raspbian is the new name for the os, can you try to re-install it.

Ok ! I will try re-install it.

The program doesn’t report an error. It’s OK. thank you very much!!!!!:smiley::smiley::smiley: :pray::pray::pray:

请问怎么样重置raspberry pi呢

重装系统重装系统重装系统重装系统为了凑字数!

是重新烧录吗?是重新烧录吗???????????