Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Problem for Orange Pi zeros 2 detection on Debian #285

Open
ed-auvinet opened this issue Mar 24, 2023 · 10 comments
Open

Problem for Orange Pi zeros 2 detection on Debian #285

ed-auvinet opened this issue Mar 24, 2023 · 10 comments

Comments

@ed-auvinet
Copy link

Hi there,

The detection script had a problem with the detection of the orange pi board.

With the modification of the board.py file at line 612 "orange pi" => "orangepi" all come back to normal.

@makermelissa
Copy link
Contributor

Since it's been that way for 2 years without issue, it might be wise to just check for either value to avoid breaking it for others.

@ed-auvinet
Copy link
Author

ed-auvinet commented Mar 24, 2023 via email

@Foxelix
Copy link

Foxelix commented May 1, 2023

Prosím řeším následují problém na mém zařízení Orangepi 3 lts viz. chybové hlášení: Už jsem zkoušel několikrát přeinstalovat a upravit ...bohužel pořád se objevuje stejná chyba :

orangepi@orangepi3-lts:~$ /bin/python3 "/home/orangepi/Desktop/kontrola knihovny Adafruit_CircuitPython_PCF8574.py"
Traceback (most recent call last):
  File "/home/orangepi/Desktop/kontrola knihovny Adafruit_CircuitPython_PCF8574.py", line 2, in <module>
    import board
  File "/home/orangepi/.local/lib/python3.9/site-packages/board.py", line 351, in <module>
    raise NotImplementedError(
NotImplementedError: 
        Adafruit-PlatformDetect version 3.45.1 was unable to identify the board and/or
        microcontroller running the Linux platform. Please be sure you
        have the latest packages running:
        'pip3 install --upgrade adafruit-blinka adafruit-platformdetect'

Předem děkuji za pomoc a radu jak odstranit.
Zdá se že vaše poslední verze stále neobsahuje řešení pro orangepi 3 lts. našel jsem úpravy ale nevím jak přesně instalovat. Šlo by provést aktualizaci stávající verze? Děkuji moc

@makermelissa
Copy link
Contributor

Could either of you provide some more details such as the OS that you are running. If armbian, I'm surprised https://github.com/adafruit/Adafruit_Python_PlatformDetect/blob/main/adafruit_platformdetect/board.py#L359-L360 isn't detecting the Orange Pi Zero 2 and https://github.com/adafruit/Adafruit_Python_PlatformDetect/blob/main/adafruit_platformdetect/board.py#L341-L342 isn't detecting the Orange Pi 3 LTS.

If it's a different OS, place respond with the results of cat /proc/device-tree/model.

@Foxelix
Copy link

Foxelix commented May 2, 2023

Sorry I didn't list my OS.
My orange pi 3 lts runs Debian. I tried reinstalling and upgrading several times but it didn't help.
I will try the link to the code you provided to see if I can reinstall board.py

@kaangoksal
Copy link
Contributor

kaangoksal commented May 5, 2023

@makermelissa

this is also not detected, I think this is a new batch of raspberry pis

(venv) pi@raspberrypi:~ $ uname -a
Linux raspberrypi 6.1.21-v7+ #1642 SMP Mon Apr  3 17:20:52 BST 2023 armv7l GNU/Linux

(venv) pi@raspberrypi:~ $ cat /proc/device-tree/model
Raspberry Pi 3 Model B Plus Rev 1.4(venv)
Traceback (most recent call last):
  File "/home/pi/project/src/main.py", line 7, in <module>
    from peripherals.LedController import LedController
  File "/home/pi/project/src/peripherals/LedController.py", line 2, in <module>
    import neopixel
  File "/home/pi/project/src/venv/lib/python3.9/site-packages/neopixel.py", line 16, in <module>
    import board
  File "/home/pi/project/src/venv/lib/python3.9/site-packages/board.py", line 351, in <module>
    raise NotImplementedError(
NotImplementedError: 
        Adafruit-PlatformDetect version 3.45.1 was unable to identify the board and/or
        microcontroller running the Linux platform. Please be sure you
        have the latest packages running:
        'pip3 install --upgrade adafruit-blinka adafruit-platformdetect'

>>> detector.board._pi_rev_code()
'a020d4'

@Foxelix
Copy link

Foxelix commented May 6, 2023

Even after installing patch 288, see your link, the problem with determining the SCK and SDA pins persists. Is it possible that changing the operating system would solve the problem? I'm using a whole bunch of libraries installed on my device, but most of the code is giving me an adafruit-blinka problem.
Please help.
Traceback (most recent call last):
File "/usr/lib/python3.9/runpy.py", line 197, in _run_module_as_main
return _run_code(code, main_globals, None,
File "/usr/lib/python3.9/runpy.py", line 87, in _run_code
exec(code, run_globals)
File "/home/orangepi/.vscode/extensions/ms-python.python-2023.6.1/pythonFiles/lib/python/debugpy/adapter/../../debugpy/launcher/../../debugpy/main.py", line 39, in
cli.main()
File "/home/orangepi/.vscode/extensions/ms-python.python-2023.6.1/pythonFiles/lib/python/debugpy/adapter/../../debugpy/launcher/../../debugpy/../debugpy/server/cli.py", line 430, in main
run()
File "/home/orangepi/.vscode/extensions/ms-python.python-2023.6.1/pythonFiles/lib/python/debugpy/adapter/../../debugpy/launcher/../../debugpy/../debugpy/server/cli.py", line 284, in run_file
runpy.run_path(target, run_name="main")
File "/home/orangepi/.vscode/extensions/ms-python.python-2023.6.1/pythonFiles/lib/python/debugpy/_vendored/pydevd/_pydevd_bundle/pydevd_runpy.py", line 321, in run_path
return _run_module_code(code, init_globals, run_name,
File "/home/orangepi/.vscode/extensions/ms-python.python-2023.6.1/pythonFiles/lib/python/debugpy/_vendored/pydevd/_pydevd_bundle/pydevd_runpy.py", line 135, in _run_module_code
_run_code(code, mod_globals, init_globals,
File "/home/orangepi/.vscode/extensions/ms-python.python-2023.6.1/pythonFiles/lib/python/debugpy/_vendored/pydevd/_pydevd_bundle/pydevd_runpy.py", line 124, in _run_code
exec(code, run_globals)
File "/home/orangepi/Desktop/test zarizeni imu senzor a gps.py", line 8, in
i2C = busio.I2C(5, board.SDA)
AttributeError: module 'board' has no attribute 'SDA'

@kaangoksal
Copy link
Contributor

@Foxelix you can use the pin number instead of board.SDA

Which orange pi is this?

@Foxelix
Copy link

Foxelix commented May 6, 2023

So I reinstalled a new Debian system. Installed all necessary libraries. Including adafruit blinka. Unfortunately, I still have the problem that "DigitalIout" is not defined. I also installed pull 288, just everything and I don't know what the problem could be :(

orangepi@orangepi3-lts:~$ /bin/python3 "/home/orangepi/Desktop/test zařízení imu senzor a gps.py"
Traceback (most recent call last):
File "/home/orangepi/Desktop/test zařízení imu senzor a gps.py", line 5, in
import adafruit_bmp280
File "/usr/local/lib/python3.9/dist-packages/adafruit_bmp280.py", line 475, in
class Adafruit_BMP280_SPI(Adafruit_BMP280):
File "/usr/local/lib/python3.9/dist-packages/adafruit_bmp280.py", line 520, in Adafruit_BMP280_SPI
def init(self, spi: SPI, cs: DigitalInOut, baudrate=100000) -> None:
NameError: name 'DigitalInOut' is not defined

@makermelissa makermelissa changed the title Problem for Orange Pi zeros 2 detection Problem for Orange Pi zeros 2 detection on Debian May 8, 2023
@makermelissa
Copy link
Contributor

To reiterate:

The original issue was about boards with the following chipsets not being detected in the self._allwinner_variants_id() function:

  • H5
  • H616

This was noticed on the Orange Pi Zero 2 with the H616 specifically, though I'm not sure which OS this was on.

The issue has sort of expanded about possibly adding better detection for boards not running Armbian which are using the self._armbian_id() function. This includes boards with the following detected chipsets:

  • SUN4I
  • SUN7I
  • A10
  • A20
  • H6
  • D1_RISCV

The board mentioned was the Orange Pi 3 LTS with the H6 running Debian.

Is it possible that changing the operating system would solve the problem?

I think for the Orange Pi 3 LTS, it was specifically added for running Armbian.

The Raspberry Pi 3 was an unrelated issue and was already addressed in #291.

A lot of the issues mentioned here stem from certain boards working only with a certain OS and no easy way to determine which OS it was tested with for the average user. Perhaps a markdown page that lists the OS that the board was tested with may be helpful. I'll try and bring this up in the CircuitPython meeting today.

For now though, improving on the allwinner_variants seems like a good solution and perhaps it could supplant the armbian_id function altogether so that it works on more systems.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants