-
Notifications
You must be signed in to change notification settings - Fork 30
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
lgpio.error: 'GPIO not allocated' #26
Comments
Hey - does the demo code from waveshare run?
…On Sat, Nov 9, 2024 at 4:29 PM Andro ***@***.***> wrote:
I am running a Raspberry PI 2W with a 4.2inch Waveshare (Rev2.2)
So far, I have followed all the instructions, and triple checked my pin
setup
when trying to execute
sudo python main.py
I get the following:
epd.config loaded new
Traceback (most recent call last):
File
"/home/zero/zerowriter1/e-Paper/RaspberryPi_JetsonNano/python/examples/main.py",
line 32, in
zero_writer.initialize()
File
"/home/zero/zerowriter1/e-Paper/RaspberryPi_JetsonNano/python/examples/zerowriter.py",
line 156, in initialize
self.epd.init()
File
"/home/zero/zerowriter1/e-Paper/RaspberryPi_JetsonNano/python/examples/waveshare_epd/epd4in2_V2.py",
line 127, in init
if epdconfig.module_init() != 0:
^^^^^^^^^^^^^^^^^^^^^^^
File
"/home/zero/zerowriter1/e-Paper/RaspberryPi_JetsonNano/python/examples/waveshare_epd/epdconfig.py",
line 73, in module_init
self.GPIO.setup(self.CS_PIN, self.GPIO.OUT)
File "/usr/lib/python3/dist-packages/RPi/GPIO/*init*.py", line 704, in
setup
initial = _check(lgpio.gpio_read(_chip, gpio))
^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/lib/python3/dist-packages/lgpio.py", line 903, in gpio_read
return _u2i(_lgpio._gpio_read(handle&0xffff, gpio))
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/lib/python3/dist-packages/lgpio.py", line 458, in _u2i
raise error(error_text(v))
lgpio.error: 'GPIO not allocated'
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File
"/home/zero/zerowriter1/e-Paper/RaspberryPi_JetsonNano/python/examples/main.py",
line 40, in
zero_writer.epd.init()
File
"/home/zero/zerowriter1/e-Paper/RaspberryPi_JetsonNano/python/examples/waveshare_epd/epd4in2_V2.py",
line 127, in init
if epdconfig.module_init() != 0:
^^^^^^^^^^^^^^^^^^^^^^^
File
"/home/zero/zerowriter1/e-Paper/RaspberryPi_JetsonNano/python/examples/waveshare_epd/epdconfig.py",
line 73, in module_init
self.GPIO.setup(self.CS_PIN, self.GPIO.OUT)
File "/usr/lib/python3/dist-packages/RPi/GPIO/*init*.py", line 704, in
setup
initial = _check(lgpio.gpio_read(_chip, gpio))
^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/lib/python3/dist-packages/lgpio.py", line 903, in gpio_read
return _u2i(_lgpio._gpio_read(handle&0xffff, gpio))
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/lib/python3/dist-packages/lgpio.py", line 458, in _u2i
raise error(error_text(v))
lgpio.error: 'GPIO not allocated'
After trying to find a solution for this I am unable to get past this. It
might be a known issue that I cant find documented, so any guidance would
be hugely appreciated here!
—
Reply to this email directly, view it on GitHub
<#26>, or unsubscribe
<https://github.com/notifications/unsubscribe-auth/BEN2POREQT7BNV62JE4KE33Z7Z5CZAVCNFSM6AAAAABRPPY5JCVHI2DSMVQWIX3LMV43ASLTON2WKOZSGY2DMNJVGQYTAOI>
.
You are receiving this because you are subscribed to this thread.Message
ID: ***@***.***>
|
Hi!! Thanks for the speedy reply :) I do not see any activity on the ePaper at this point. |
I would start by going to the waveshare website and running the demo code
for your display -/ this will verify that your wiring is good.
If the demo runs, then I can help take it from there!
…On Sat, Nov 9, 2024 at 5:20 PM Andro ***@***.***> wrote:
Hi!! Thanks for the speedy reply :)
I do not see any activity on the ePaper at this point.
—
Reply to this email directly, view it on GitHub
<#26 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/BEN2POTRW4DXYQJ4KYUB5BLZ72DEDAVCNFSM6AAAAABRPPY5JCVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDINRWGQ4DANBTHA>
.
You are receiving this because you commented.Message ID:
***@***.***>
|
Well this thread is timely! I decided to make a zerowriter as a gift this week and have encountered the same issue after getting everything put together today. Just attempted with the demo code from waveshare to the same result as OP above. After doing some reading. I think it's due to the kernel being 6.6 now? Unless you already have accounted for the GPIO pins being renumbered? The closest thing I can find is this on stack overflow https://stackoverflow.com/a/78605522 |
worth mentioning — using the 2.2 branch? The main branch could throw some
weird errors if you are using a 2.2 display
…On Sat, Nov 9, 2024 at 6:47 PM TCD1138 ***@***.***> wrote:
Well this thread is timely!
I decided to make a zerowriter as a gift this week and have encountered
the same issue after getting everything put together today.
Just attempted with the demo code from waveshare to the same result as OP
above.
After doing some reading. I think it's due to the kernel being 6.6 now?
Unless you already have accounted for the GPIO pins being renumbered? The
closest thing I can find is this on stack overflow
https://stackoverflow.com/a/78605522
—
Reply to this email directly, view it on GitHub
<#26 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/BEN2POQE7PNU5UXY4J574FTZ72NIPAVCNFSM6AAAAABRPPY5JCVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDINRWGUYTGMJTGI>
.
You are receiving this because you commented.Message ID:
***@***.***>
|
Then it may be right that there is some GPIO issues with the more recent
kernel updates — might be something going on with the GPIO handling.
rpi.GPIO is the python library that handles all the under the hood stuff —
it seems that may be broken.
Not sure if there is a simple way to flash with an earlier image, but that
could be a start. Looks like 6.6 came out a week or so ago.
…On Sun, Nov 10, 2024 at 6:17 AM Andro ***@***.***> wrote:
Yes, definitely using the 2.2 branch.
Here is the wiring guide I followed - just to double check that I am
connecting things correctly.
image.png (view on web)
<https://github.com/user-attachments/assets/da85a64e-8099-4e0c-9535-5739a0b06c93>
—
Reply to this email directly, view it on GitHub
<#26 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/BEN2POSZKLRETUSFEVXBH5TZ746EFAVCNFSM6AAAAABRPPY5JCVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDINRWGY4TGMBZGI>
.
You are receiving this because you commented.Message ID:
***@***.***>
|
From my understanding if you can use bookworm 32bit on a 6.1 kernel you’d
avoid it.
raspberrypi/linux#6037
So I would try that as a starting point.
…On Sun, Nov 10, 2024 at 7:47 AM Adam W ***@***.***> wrote:
Then it may be right that there is some GPIO issues with the more recent
kernel updates — might be something going on with the GPIO handling.
rpi.GPIO is the python library that handles all the under the hood stuff —
it seems that may be broken.
Not sure if there is a simple way to flash with an earlier image, but that
could be a start. Looks like 6.6 came out a week or so ago.
On Sun, Nov 10, 2024 at 6:17 AM Andro ***@***.***> wrote:
> Yes, definitely using the 2.2 branch.
> Here is the wiring guide I followed - just to double check that I am
> connecting things correctly.
> image.png (view on web)
> <https://github.com/user-attachments/assets/da85a64e-8099-4e0c-9535-5739a0b06c93>
>
> —
> Reply to this email directly, view it on GitHub
> <#26 (comment)>,
> or unsubscribe
> <https://github.com/notifications/unsubscribe-auth/BEN2POSZKLRETUSFEVXBH5TZ746EFAVCNFSM6AAAAABRPPY5JCVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDINRWGY4TGMBZGI>
> .
> You are receiving this because you commented.Message ID:
> ***@***.***>
>
|
https://downloads.raspberrypi.com/raspios_oldstable_lite_armhf/images/raspios_oldstable_lite_armhf-2024-10-28/2024-10-22-raspios-bullseye-armhf-lite.img.xz
Try this one. (Raspberry pi legacy os lite runing bullseye)
Or possibly an archived version of bookworm:
https://www.raspberrypi.com/software/operating-systems/
I would think this should resolve.
…On Sun, Nov 10, 2024 at 7:57 AM Adam W ***@***.***> wrote:
From my understanding if you can use bookworm 32bit on a 6.1 kernel you’d
avoid it.
raspberrypi/linux#6037
So I would try that as a starting point.
On Sun, Nov 10, 2024 at 7:47 AM Adam W ***@***.***> wrote:
> Then it may be right that there is some GPIO issues with the more recent
> kernel updates — might be something going on with the GPIO handling.
>
> rpi.GPIO is the python library that handles all the under the hood stuff
> — it seems that may be broken.
>
>
> Not sure if there is a simple way to flash with an earlier image, but
> that could be a start. Looks like 6.6 came out a week or so ago.
>
> On Sun, Nov 10, 2024 at 6:17 AM Andro ***@***.***> wrote:
>
>> Yes, definitely using the 2.2 branch.
>> Here is the wiring guide I followed - just to double check that I am
>> connecting things correctly.
>> image.png (view on web)
>> <https://github.com/user-attachments/assets/da85a64e-8099-4e0c-9535-5739a0b06c93>
>>
>> —
>> Reply to this email directly, view it on GitHub
>> <#26 (comment)>,
>> or unsubscribe
>> <https://github.com/notifications/unsubscribe-auth/BEN2POSZKLRETUSFEVXBH5TZ746EFAVCNFSM6AAAAABRPPY5JCVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDINRWGY4TGMBZGI>
>> .
>> You are receiving this because you commented.Message ID:
>> ***@***.***>
>>
>
|
Thanks! This is super helpful. Everything I have been digging up seems to indicate some gpio conflicts! Let me give this a go!!! Appreciate it! |
Using the release from this link fixed the GPIO issue for me, hopefully will for OP as well! Thank you! |
I tried the arched Bookworm release (from March 2024) and this resolved the GPIO issue for me also! Thank you!! |
I am running a Raspberry PI 2W with a 4.2inch Waveshare (Rev2.2)
So far, I have followed all the instructions, and triple checked my pin setup
when trying to execute
sudo python main.py
I get the following:
After trying to find a solution for this I am unable to get past this. It might be a known issue that I cant find documented, so any guidance would be hugely appreciated here!
The text was updated successfully, but these errors were encountered: