Skip to content

Flick large on Raspberry Pi 5 #69

@jmeile

Description

@jmeile

Hi

I'm trying to run this on the Raspberry Pi 5, but as soon as I run the flick-demo, I get:
RuntimeError: Cannot determine SOC peripheral base address

I found that this pi is really different than its predecesors and the main reason is that it isn't compatible with RPi.GPIO (I don't know what this means exactly).

Anyway, I also found that you could solve this by installing lgpio, so, I did it as follows:

sudo apt remove python3-rpi.gpio
pip3 install rpi-lgpio

The command line demos still doesn't work, so, I tried this code:
https://news.sean.co.uk/2017/11/adding-gesture-control-to-raspberry-pi.html

It started to work, but at some point, an exception will be thrown:

Exception in thread Thread-2:
Traceback (most recent call last):
  File "/usr/lib/python3.11/threading.py", line 1038, in _bootstrap_inner
    self.run()
  File "/home/admintv/.flick/lib/python3.11/site-packages/flicklib-0.0.3-py3.11.egg/flicklib.py", line 130, in run
  File "/home/admintv/.flick/lib/python3.11/site-packages/flicklib-0.0.3-py3.11.egg/flicklib.py", line 311, in _do_poll
AttributeError: 'NoneType' object has no attribute 'pop'

The program will keep running, but the coordinates won't be updated. Exiting with CTRL+C and trying to run it again, just shows:
lgpio.error: 'GPIO busy'

I improve the code a little bit and that "busy" error disappeared, but the "AttributeError" exception still happens. In order to make the code work again, I need to exit from the python interpreter, come back and then run it again.

Is there anyway of getting this to be fixed for the Raspberry Pi 5?

Best regards
Josef

Here the improved version of the code:

import RPi.GPIO as GPIO
import os
import flicklib
import time

x_pos, y_pos, z_pos = 0, 0, 0

@flicklib.move()
def move(x, y, z):
  global x_pos, y_pos, z_pos
  x_pos = x
  y_pos = y
  z_pos = z

def print_data():
  while True:
    #os.system('clear')
    print("X:", x_pos)
    print("Y:", y_pos)
    print("Z:", z_pos)
    #Even if the sleeping time is increased, the exception still happens
    time.sleep(0.25)

try:
  print_data()
except KeyboardInterrupt:
  print("Keyboard interrupt, exiting...")
except:
  print("Other error or exception occurred!")
finally:
  GPIO.cleanup()
  print("Cleaning GPIO")

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions