Giter Club home page Giter Club logo

Comments (11)

makermelissa avatar makermelissa commented on September 25, 2024

Hmm, mysterious. What do you get when you run the script here? https://github.com/adafruit/Adafruit_Python_PlatformDetect/blob/master/bin/detect.py

from adafruit_python_platformdetect.

makermelissa avatar makermelissa commented on September 25, 2024

Could you please try again with the latest version of PlatformDetect? I added some caching, so I'm hoping that may have fixed it.

from adafruit_python_platformdetect.

Petross404 avatar Petross404 commented on September 25, 2024

Could you please try again with the latest version of PlatformDetect? I added some caching, so I'm hoping that may have fixed it.

I will as soon as my shifts at work aren't changed constantly :) Thank you for the interest.

from adafruit_python_platformdetect.

CrazyIvan359 avatar CrazyIvan359 commented on September 25, 2024

I also experienced this issue running v2.17.0 on Ubuntu 20.04 inside a VBox VM. Works fine on RPi3B and Orange Pi Zero LTS I have though.

The problem is the overriden __getattr__ in chip.Chip. I'm making a PR to fix it.

from adafruit_python_platformdetect.

jczacharia avatar jczacharia commented on September 25, 2024

It looks like this issue is still ongoing. I'm using a Google Coral dev board with balena OS and running a py file with import board gives me this:

File "/app/hardware-logic/api.py", line 34, in <module>
  import board
File "/usr/local/lib/python3.9/dist-packages/board.py", line 22, in <module>
    from adafruit_blinka.agnostic import board_id, detector
File "/usr/local/lib/python3.9/dist-packages/adafruit_blinka/agnostic/__init__.py", line 21, in <module>
  chip_id = detector.chip.id
File "/usr/local/lib/python3.9/dist-packages/adafruit_platformdetect/chip.py", line 419, in __getattr__
    if self.id == attr:
File "/usr/local/lib/python3.9/dist-packages/adafruit_platformdetect/chip.py", line 419, in __getattr__
    if self.id == attr:
File "/usr/local/lib/python3.9/dist-packages/adafruit_platformdetect/chip.py", line 419, in __getattr__
    if self.id == attr:
  [Previous line repeated 974 more times]
File "/usr/local/lib/python3.9/dist-packages/adafruit_platformdetect/chip.py", line 158, in id
    self._chip_id = self._linux_id()
File "/usr/local/lib/python3.9/dist-packages/adafruit_platformdetect/chip.py", line 293, in _linux_id
    hardware = self.detector.get_cpuinfo_field("Hardware")
File "/usr/local/lib/python3.9/dist-packages/adafruit_platformdetect/__init__.py", line 44, in get_cpuinfo_field
    cpuinfo = infile.read().split("\n")   RecursionError: maximum recursion depth exceeded while calling a Python object

I'm using these dependencies

pandas==1.4.1
ipython==8.4.0
smbus2==0.4.2
python-periphery==2.4.1
adafruit-blinka==8.19.0
adafruit-circuitpython-vl53l0x==3.6.9

I'm not sure if this is a balena issue I'm still encountering this. Any insight on a fix?

from adafruit_python_platformdetect.

jczacharia avatar jczacharia commented on September 25, 2024

Apparently, this infinite loop happens when no chip or board can be detected. Balena deletes data from /proc/cpuinfo and thus the infinite loop. There should be a better way to handle this instead of getting this recursion error but for anyone that has this issue, you might need to fork the repo and manually set the chip and board ids manually.

from adafruit_python_platformdetect.

CrazyIvan359 avatar CrazyIvan359 commented on September 25, 2024

@jczacharia can you provide the output of cat /proc/cpuinfo for your board

from adafruit_python_platformdetect.

jczacharia avatar jczacharia commented on September 25, 2024

@CrazyIvan359

processor       : 0
BogoMIPS        : 16.66
Features        : fp asimd evtstrm aes pmull sha1 sha2 crc32 cpuid
CPU implementer : 0x41
CPU architecture: 8
CPU variant     : 0x0
CPU part        : 0xd03
CPU revision    : 4

processor       : 1
BogoMIPS        : 16.66
Features        : fp asimd evtstrm aes pmull sha1 sha2 crc32 cpuid
CPU implementer : 0x41
CPU architecture: 8
CPU variant     : 0x0
CPU part        : 0xd03
CPU revision    : 4

processor       : 2
BogoMIPS        : 16.66
Features        : fp asimd evtstrm aes pmull sha1 sha2 crc32 cpuid
CPU implementer : 0x41
CPU architecture: 8
CPU variant     : 0x0
CPU part        : 0xd03
CPU revision    : 4

processor       : 3
BogoMIPS        : 16.66
Features        : fp asimd evtstrm aes pmull sha1 sha2 crc32 cpuid
CPU implementer : 0x41
CPU architecture: 8
CPU variant     : 0x0
CPU part        : 0xd03
CPU revision    : 4

I'm using a Google Coral and the chip and board should be set to:

chip_id = "IMX8MX"
board_id = "CORAL_EDGE_TPU_DEV"

Note I took a look at your fix #104 and that worked (as in no more infinite recursion) but it failed to recognize the chip and board and threw an appropriate error saying such.

from adafruit_python_platformdetect.

CrazyIvan359 avatar CrazyIvan359 commented on September 25, 2024

Yeah they really strip a lot of info out of that. What about cat /proc/device-tree/compatible

from adafruit_python_platformdetect.

jczacharia avatar jczacharia commented on September 25, 2024
fsl,imx8mq-phanbellfsl,imx8mq

With no line break at eof

from adafruit_python_platformdetect.

CrazyIvan359 avatar CrazyIvan359 commented on September 25, 2024

Ok this is a different issue but it ends up giving the same symptoms because PlatformDetect cannot identify your board. Please open a new a new issue and reference one of your posts in this issue (click the 3 dots on your post, there is an option to Reference in new issue).

Since I've come this far I'm working on a little PR to get this board to be detected. You'll see my PR tagged in your new issue when I push it.

from adafruit_python_platformdetect.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.