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

Issues getting up and running on RPi5 #1

Open
spectre1989 opened this issue Feb 1, 2024 · 4 comments
Open

Issues getting up and running on RPi5 #1

spectre1989 opened this issue Feb 1, 2024 · 4 comments

Comments

@spectre1989
Copy link

Hi there,

I'm having some issues getting running on a RPi5 with 3.7in waveshare display, when I run startpapertty.sh I get these errors:

gpiozero found - using that instead of RPi.GPIO
Setting spacing to 0.
/home/joe/.local/share/papertty-init_venv/lib/python3.11/site-packages/gpiozero/devices.py:295: PinFactoryFallback: Falling back from lgpio: No module named 'lgpio'
  warnings.warn(
Traceback (most recent call last):
  File "/home/joe/.local/share/papertty-init_venv/lib/python3.11/site-packages/gpiozero/pins/pi.py", line 408, in pin
    pin = self.pins[info]
          ~~~~~~~~~^^^^^^
KeyError: PinInfo(number=11, name='GPIO17', names=frozenset({'BCM17', 17, 'BOARD11', 'WPI0', '17', 'GPIO17', 'J8:11'}), pull='', row=6, col=1, interfaces=frozenset({'', 'dpi', 'spi', 'gpio', 'uart'}))

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/home/joe/.local/share/papertty-init_venv/lib/python3.11/site-packages/papertty/drivers/drivers_base.py", line 121, in setup
    GPIO.pins[str(pin)] = OutputDevice(pin)
                          ^^^^^^^^^^^^^^^^^
  File "/home/joe/.local/share/papertty-init_venv/lib/python3.11/site-packages/gpiozero/devices.py", line 103, in __call__
    self = super().__call__(*args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/joe/.local/share/papertty-init_venv/lib/python3.11/site-packages/gpiozero/output_devices.py", line 74, in __init__
    super().__init__(pin, pin_factory=pin_factory)
  File "/home/joe/.local/share/papertty-init_venv/lib/python3.11/site-packages/gpiozero/mixins.py", line 75, in __init__
    super().__init__(*args, **kwargs)
  File "/home/joe/.local/share/papertty-init_venv/lib/python3.11/site-packages/gpiozero/devices.py", line 549, in __init__
    pin = self.pin_factory.pin(pin)
          ^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/joe/.local/share/papertty-init_venv/lib/python3.11/site-packages/gpiozero/pins/pi.py", line 410, in pin
    pin = self.pin_class(self, info)
          ^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/joe/.local/share/papertty-init_venv/lib/python3.11/site-packages/gpiozero/pins/rpigpio.py", line 101, in __init__
    GPIO.setup(self._number, GPIO.IN, self.GPIO_PULL_UPS[self._pull])
RuntimeError: Cannot determine SOC peripheral base address

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/home/joe/.local/share/papertty-init_venv/bin/papertty", line 8, in <module>
    sys.exit(cli())
             ^^^^^
  File "/home/joe/.local/share/papertty-init_venv/lib/python3.11/site-packages/click/core.py", line 829, in __call__
    return self.main(*args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/joe/.local/share/papertty-init_venv/lib/python3.11/site-packages/click/core.py", line 782, in main
    rv = self.invoke(ctx)
         ^^^^^^^^^^^^^^^^
  File "/home/joe/.local/share/papertty-init_venv/lib/python3.11/site-packages/click/core.py", line 1259, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
                           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/joe/.local/share/papertty-init_venv/lib/python3.11/site-packages/click/core.py", line 1066, in invoke
    return ctx.invoke(self.callback, **ctx.params)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/joe/.local/share/papertty-init_venv/lib/python3.11/site-packages/click/core.py", line 610, in invoke
    return callback(*args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/joe/.local/share/papertty-init_venv/lib/python3.11/site-packages/click/decorators.py", line 33, in new_func
    return f(get_current_context().obj, *args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/joe/.local/share/papertty-init_venv/lib/python3.11/site-packages/papertty/papertty.py", line 1344, in terminal
    ptty = settings.get_init_tty()
           ^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/joe/.local/share/papertty-init_venv/lib/python3.11/site-packages/papertty/papertty.py", line 1059, in get_init_tty
    tty.init_display()
  File "/home/joe/.local/share/papertty-init_venv/lib/python3.11/site-packages/papertty/papertty.py", line 249, in init_display
    self.driver.init(partial=self.partial, vcom=self.vcom, enable_a2=self.enable_a2, enable_1bpp=self.enable_1bpp, mhz=self.mhz)
  File "/home/joe/.local/share/papertty-init_venv/lib/python3.11/site-packages/papertty/drivers/drivers_full.py", line 342, in init
    if self.epd_init() != 0:
       ^^^^^^^^^^^^^^^
  File "/home/joe/.local/share/papertty-init_venv/lib/python3.11/site-packages/papertty/drivers/drivers_base.py", line 308, in epd_init
    GPIO.setup(self.RST_PIN, GPIO.OUT)
  File "/home/joe/.local/share/papertty-init_venv/lib/python3.11/site-packages/papertty/drivers/drivers_base.py", line 127, in setup
    rpiGPIO.setup(pin, rpiGPIO.OUT)
RuntimeError: Cannot determine SOC peripheral base address

Looks like it can't find lgpio? Let me know if this is a common issue, otherwise I'll start digging

@mcarr823
Copy link
Owner

mcarr823 commented Feb 8, 2024

I don't have a pi5 to test with, but a quick bit of googling suggests that lgpio may be needed for the pi5 (whereas the fallback works fine for older raspberry pis).
You could try installing the lgpio library in the venv and then try again.
eg.
/home/joe/.local/share/papertty-init_venv/bin/pip3 install lgpio

@spectre1989
Copy link
Author

Yeah I did try that, for some reason that installs a really old version of lgpio. I compiled it and created a wheel myself and installed that, still no dice - though a different error message that time. From the sounds of it though papertty hasn't been tested with the 5, so I've made a fork and I'll see if I can make some headway

@mcarr823
Copy link
Owner

mcarr823 commented Feb 8, 2024

I don't know what the situation is like elsewhere, but in my country at least the rpi5 is totally sold out even at inflated prices.
I might be able to get one when the 1GB models come out, but right now it doesn't seem likely.
So yeah, I don't think anyone's tested with the rpi5 yet. The change from rpigpio to gpiozero was necessary for rpi5 support, but I guess there's still more work to be done.

@BTomiii
Copy link

BTomiii commented Sep 15, 2024

Any update here?

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

3 participants