adafruit / Adafruit_CircuitPython_ServoKit

CircuitPython helper library for the PWM/Servo FeatherWing, Shield and Pi HAT kits.
MIT License
71 stars 31 forks source link

Using Adafruit_CircuitPython_ServoKit in a container #31

Open mmatesic01 opened 3 years ago

mmatesic01 commented 3 years ago

Hello, I have no issues installing and enabling and using Adafruit_CircuitPython_ServoKit locally (outside container) on Jetson Nano. I run this simple code (and servos move):

from adafruit_servokit import ServoKit

_kit = ServoKit(channels=16) pan = 90 tilt = 90

kit.servo[0].angle = pan kit.servo[1].angle = tilt_

But when installing it inside container and running the same code, I get the next message:

_Traceback (most recent call last): File "/home/marko/Desktop/pyProg/NVIDIA/servotest.py", line 1, in from adafruit_servokit import ServoKit File "/usr/local/lib/python3.6/dist-packages/adafruit_servokit.py", line 35, in import board File "/usr/local/lib/python3.6/dist-packages/board.py", line 33, in from adafruit_blinka.agnostic import board_id, detector File "/usr/local/lib/python3.6/dist-packages/adafruit_blinka/agnostic/init.py", line 18, in chip_id = detector.chip.id File "/usr/local/lib/python3.6/dist-packages/adafruit_platformdetect/chip.py", line 350, in getattr if self.id == attr: File "/usr/local/lib/python3.6/dist-packages/adafruit_platformdetect/chip.py", line 350, in getattr if self.id == attr: File "/usr/local/lib/python3.6/dist-packages/adafruit_platformdetect/chip.py", line 350, in getattr if self.id == attr: [Previous line repeated 320 more times] File "/usr/local/lib/python3.6/dist-packages/adafruit_platformdetect/chip.py", line 154, in id self._chip_id = self._linux_id() File "/usr/local/lib/python3.6/dist-packages/adafruit_platformdetect/chip.py", line 235, in _linux_id hardware = self.detector.get_cpuinfo_field("Hardware") File "/usr/local/lib/python3.6/dist-packages/adafruit_platformdetect/init.py", line 49, in get_cpuinfofield with open("/proc/cpuinfo", "r") as infile: File "/usr/lib/python3.6/codecs.py", line 309, in init IncrementalDecoder.init(self, errors) RecursionError: maximum recursion depth exceeded

What else am I missing in my container?

"i2cdetect -y -r 1" shows me that PCF9685 controler is visible inside container. 0 1 2 3 4 5 6 7 8 9 a b c d e f 00: -- -- -- -- -- -- -- -- -- -- -- -- -- 10: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 20: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 30: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 40: 40 -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 50: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 60: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 70: -- -- -- -- -- -- -- --

tekktrik commented 2 years ago

This looks to be an issue with Blinka rather than the library, as it's struggling to import the board module. If you update to the latest version of Blinka, do you still see it? You may want to file this issue there if so: https://github.com/adafruit/Adafruit_Blinka