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

Increase limit for GPIO number #45

Merged
merged 9 commits into from
Mar 9, 2024

Conversation

outlying
Copy link
Contributor

@outlying outlying commented Mar 9, 2024

In my case, I've done a migration from https://github.com/outlying/MMM-PIR-Sensor (deprecated) to this project. Until now, I have configured my system to use GPIO 23. It really gave me a headache as to why it was not working since it worked with the previous module and when tested from the CLI.

I'm using an RPi3 (which is OK for MM), and for the RPi3, the GPIO pins go as far as 29. For the RPi4 and RPi5, the maximum GPIO is 27.

The artificial limit of 21 used in this project makes no sense at all in any case for past and present RPis.

I also checked the https://github.com/gpiozero/gpiozero/blob/master/gpiozero/input_devices.py#L525 project that is used to get the sensor state, and it also does not limit the GPIO number in any way.

When I changed this restriction, my sensor started working simply because there was no assertion error.

@outlying outlying marked this pull request as draft March 9, 2024 20:58
@bugsounet bugsounet changed the base branch from master to dev March 9, 2024 20:58
@bugsounet
Copy link
Owner

humpf... sorry you have right !
Thanks for correct it !

@outlying
Copy link
Contributor Author

outlying commented Mar 9, 2024

I jumped to conclusions too fast, there is assertion error but screen is not waking up - probably another error

Please accept this correction to assertion and meanwhile I will work on other issue

@outlying outlying marked this pull request as ready for review March 9, 2024 21:00
@bugsounet
Copy link
Owner

Sure, You can run the python script manually for debuging (without MM²)

inside components folder
execute python MotionSensor.py -g <gpio> (replace by your own number)
when a motion is detected, you will see Detected

@bugsounet bugsounet merged commit 8ae4201 into bugsounet:dev Mar 9, 2024
3 checks passed
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

Successfully merging this pull request may close these issues.

2 participants