0

I am using a Raspberry Pi 5, 40 pin, 4 GB RAM version, with the Grove hat.

I am creating a project where I have connected a moisture sensor to A0 port, relay on D16 port and servomotor on PWM port, everything was working fine, then I thought of adding a temperature and a humidity sensor and it is not showing any output, it is showing the error, Cannot determine SOC peripheral base address.

Earlier it was working just fine, so I tried to re-run my older testing code and now it is also not working.

#!/usr/bin/env python3
import time
from seeed_dht import DHT
from grove.display.jhd1802 import JHD1802
 
def main():
 # Grove - 16x2 LCD(White on Blue) connected to I2C port
 lcd = JHD1802()
 # Grove - Temperature&Humidity Sensor connected to port D5
 sensor = DHT('11', 5)
 while True:
 humi, temp = sensor.read()
 print('temperature {}C, humidity {}%'.format(temp, humi))
 lcd.setCursor(0, 0)
 lcd.write('temperature: {0:2}C'.format(temp))
 lcd.setCursor(1, 0)
 lcd.write('humidity: {0:5}%'.format(humi))
 time.sleep(1)
if __name__ == '__main__':
 main()

I have tried almost every library RPI.GPIO, gpiozero, gpiod but nothing works.

I have tried running it with sudo, but still did not work.

One more scenario is when I tried using my LED button and buzzer sensor, buzzer was connected at PWM and LED button was connected at D5 port, the LED button did not work and buzzer was working, I tried switching the ports but still did not work.

How to debug this issue?

MatsK
2,8833 gold badges18 silver badges22 bronze badges
asked Jan 22 at 11:08
1
  • You have tagged rpi.gpio and mentioned other libraries but don't seem to be using any. Commented Jan 22 at 21:10

1 Answer 1

0

Read this: https://wiki.seeedstudio.com/Grove_Base_Hat_for_Raspberry_Pi/#getting-started

looking at this document, full of good information, it is also clearly written for use on a pi4, so you may have to adapt some of the instructions for a pi 5. Also, where it says run sudo pip install ... don't do that, just do pip install.

Reporting can not find SOC base address suggests that the bus this device communicates on is not active. go into sudo raspi-config and enable the 12c bus, and serial which is what this device reportedly uses. reboot. from their product page:

Please note that we have changed the chip from the original one STM32 to the new one MM32, where the I2C address has changed from 0x04 from 0x08.

As Millways points out, your python code has no reference to a gpio library. You can sudo apt install gpiod if it is not previously installed, this gives you system acess to the gpio. then use the gpio in python, you would install the gpiod library: pip install gpiod Then in your python script import gpiod.

https://pypi.org/project/gpiod/

Some other helpful tools might be: python-is-python3, and i2c-tools.

sudo apt install i2c-tools python-is-python3

notably i2cdump, and i2cdetect can be very helpful in troubleshooting i2c communications.

answered Jan 24 at 2:44
1
  • i used adafruit library, and it worked for me Commented Feb 4 at 8:25

Your Answer

Draft saved
Draft discarded

Sign up or log in

Sign up using Google
Sign up using Email and Password

Post as a guest

Required, but never shown

Post as a guest

Required, but never shown

By clicking "Post Your Answer", you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.