12Next
Return to list
View: 3692|Reply: 10

Rasptank: Could not determine default I2C bus for platform

[Copy link]

1

Threads

1

Posts

11

Credits

Newbie

Rank: 1

Credits
11
Post time 2022-3-1 00:05:38 | Show all posts |Read mode
Edited by 1645975525 at 2022-3-1 12:08 AM

Hi All,
I was trying to debug the servos and nothing happened. Wen I run webServer.py, server.py, serverTest.py and just about anything I get an error like the one below. There are a number of similar problems all over the internet with no clear fix. Can someone please help?

pi@pi:~/adeept_rasptank $ python3 initPosServos.py
Traceback (most recent call last):
  File "/home/pi/adeept_rasptank/initPosServos.py", line 9, in <module>
    pwm = Adafruit_PCA9685.PCA9685()
  File "/usr/local/lib/python3.9/dist-packages/Adafruit_PCA9685/PCA9685.py", line 74, in __init__
    self._device = i2c.get_i2c_device(address, **kwargs)
  File "/usr/local/lib/python3.9/dist-packages/Adafruit_GPIO/I2C.py", line 63, in get_i2c_device
    busnum = get_default_bus()
  File "/usr/local/lib/python3.9/dist-packages/Adafruit_GPIO/I2C.py", line 55, in get_default_bus
    raise RuntimeError('Could not determine default I2C bus for platform.')
RuntimeError: Could not determine default I2C bus for platform


Thanks very much,
James
Reply

Use magic Report

0

Threads

1

Posts

12

Credits

Newbie

Rank: 1

Credits
12
Post time 2022-3-5 02:59:56 | Show all posts
遇到同样的问题!
Reply

Use magic Report

11

Threads

6

Posts

460

Credits

Administrator

Adeept

Rank: 9Rank: 9Rank: 9

Credits
460
Post time 2022-3-8 18:23:41 | Show all posts
It may be due to the incompatibility between the latest image file of raspberry pie and some dependent libraries.
Please try to burn the image file of the official old version of raspberry pie (2021-05-07),
the image download link (zip file):https://downloads.raspberrypi.or ... s_armhf-2021-05-28/]





Reply

Use magic Report

0

Threads

1

Posts

4

Credits

Newbie

Rank: 1

Credits
4
Post time 2022-5-27 10:36:42 | Show all posts
It because Adeept's product does not support latest Raspberry PI 4.

the Adafruit_PCA9685 you are using is a quite old module, which has been deprecated for a long time. In its source code, there is no 'BCM2711' which is being used by Raspberry PI 4, so it cannot recognise Pi 4 at all.

one workaround is edit this file:
/usr/local/lib/python3.9/dist-packages/Adafruit_GPIO/Platform.py

Search:
elif match.group(1) == 'BCM2835':

replace it with:
elif match.group(1) == 'BCM2711':

Reply

Use magic Report

1

Threads

3

Posts

13

Credits

Newbie

Rank: 1

Credits
13
Post time 2022-8-12 23:42:16 | Show all posts
I encountered the same issue (and some others), so i wrote a little step-by-step guide (for Rasptank) and modified setup.py script (https://www.adeept.com/forum/thread-866-1-1.html).
Reply

Use magic Report

0

Threads

1

Posts

6

Credits

Newbie

Rank: 1

Credits
6
Post time 2022-9-2 23:05:52 | Show all posts
1653618562 replied at 2022-5-27 10:36 AM
It because Adeept's product does not support latest Raspberry PI 4.

the Adafruit_PCA9685 you are us ...

What should I do to edit platform.py?
I was going to edit the file, but contents for change was not saved.
Reply

Use magic Report

0

Threads

2

Posts

14

Credits

Newbie

Rank: 1

Credits
14
Post time 2022-9-6 10:06:16 | Show all posts
Reply

Use magic Report

0

Threads

2

Posts

6

Credits

Newbie

Rank: 1

Credits
6
Post time 2022-10-30 04:19:10 | Show all posts
1662130188 replied at 2022-9-2 11:05 PM
What should I do to edit platform.py?
I was going to edit the file, but contents for change was no ...

I have got the same issue. Have you solved the issue? Thank you very much.
Reply

Use magic Report

0

Threads

6

Posts

30

Credits

Newbie

Rank: 1

Credits
30
Post time 2022-11-11 10:51:23 From the mobile phone | Show all posts
Type "sudo nano platform.py"   This will open up the nano editor as the superuser and give you temporary permission to save changes.
Reply

Use magic Report

0

Threads

6

Posts

30

Credits

Newbie

Rank: 1

Credits
30
Post time 2022-11-11 10:53:17 From the mobile phone | Show all posts
Then CTRL^X. To exit    Y to agree to save.  Press Enter key to save filename as "platform.py"
Reply

Use magic Report

12Next
Return to list
You have to log in before you can reply Login | Sign Up

Points Rules