Due to high demand, expect some shipping delays at this time - orders may not ship for up to 2-3 business days.
0

RuntimeError: Could not determine default I2C bus for platfo
Moderators: adafruit_support_bill, adafruit

Forum rules
Talk about Adafruit Raspberry Pi® accessories! Please do not ask for Linux support, this is for Adafruit products only! For Raspberry Pi help please visit: http://www.raspberrypi.org/phpBB3/
Please be positive and constructive with your questions and comments.

RuntimeError: Could not determine default I2C bus for platfo

by r0760589 on Fri May 13, 2022 8:40 am

Hi

I am using a raspberry pi 4 running on ubuntu and I am trying to create an analog singnal. I am doing this by using a MCP4725 connected to my raspberry pi. But I keep getting the same error even after trying multiple solutions I found on the web. The project is to send the signal to a frequencydrive to alter the speed of a motor. This to build an autonomous boat for my master thesis.

dac=Adafruit_MCP4725.MCP4725(adress=0x62)

This is the line of code in my python script where the error occurs.

Kind regards

r0760589
 
Posts: 5
Joined: Fri May 13, 2022 8:36 am

Re: RuntimeError: Could not determine default I2C bus for pl

by dastels on Fri May 13, 2022 8:59 am

Do you have I2C enabled on the Pi?

Dave

dastels
 
Posts: 9693
Joined: Tue Oct 20, 2015 3:22 pm

Re: RuntimeError: Could not determine default I2C bus for pl

by r0760589 on Fri May 13, 2022 9:03 am

yes, and when I check it in the config file it also says it's enabled

r0760589
 
Posts: 5
Joined: Fri May 13, 2022 8:36 am

Re: RuntimeError: Could not determine default I2C bus for pl

by dastels on Fri May 13, 2022 9:31 am

If this is a cut & paste from your code: dac=Adafruit_MCP4725.MCP4725(adress=0x62)...
address, not adress

Dave

dastels
 
Posts: 9693
Joined: Tue Oct 20, 2015 3:22 pm

Re: RuntimeError: Could not determine default I2C bus for pl

by r0760589 on Fri May 13, 2022 10:24 am

Hi, I indeed wrongly typed it in the topic, in the code it is written as address.
Kind regards

r0760589
 
Posts: 5
Joined: Fri May 13, 2022 8:36 am

Re: RuntimeError: Could not determine default I2C bus for pl

by dastels on Fri May 13, 2022 4:33 pm

Try scanning I2C and see what gets reported: https://learn.adafruit.com/scanning-i2c-addresses/raspberry-pi.

Dave

dastels
 
Posts: 9693
Joined: Tue Oct 20, 2015 3:22 pm

Re: RuntimeError: Could not determine default I2C bus for pl

by r0760589 on Fri May 13, 2022 5:55 pm

Dear

It gives me as a result that on my 62 address I have my MCP4725 connected. And if I disconnect my MCP4725 the address 62 disappears. So I am sure that my configuration is set correctly.

r0760589
 
Posts: 5
Joined: Fri May 13, 2022 8:36 am

Re: RuntimeError: Could not determine default I2C bus for pl

by dastels on Fri May 13, 2022 7:05 pm

Can you paste the output if you run the code in the REPL.

Dave

dastels
 
Posts: 9693
Joined: Tue Oct 20, 2015 3:22 pm

Re: RuntimeError: Could not determine default I2C bus for pl

by r0760589 on Sat May 14, 2022 5:34 am

We’ve fixed it! Thanks for the help anyway Dave.
Kind regards

r0760589
 
Posts: 5
Joined: Fri May 13, 2022 8:36 am

Please be positive and constructive with your questions and comments.