Configuracion y uso de GPIO BPI-M2 Zero

Hello, in fact something like this I already imagined could happen but it is the fault of the RPi.GPIO library since as far as the problem goes is the identification of the board I tried to try it in many ways and the only solution I saw in one was With resistors, I’m still going to tell you that the solutions I tried and that worked for me was to take the original ROi.GPIO apo and make changes to it with respect to the sinovic version to go to version 0.6.4 where event detection already worked for me,

Another solution that I could use is to modify my own library that is based on Adafruit Blick, where it only performs copulation on /dev directories, even though I think that any of them can work for you. Also, I will tell you that this problem does not only happen on this board, but I also had it on the raspberry pi Zero w with gpiozero but I solved it by changing gpiozero to RPi.GPIO in addition to changing the gpio bms register of the raspberry pi Zero w the 3b+ although at the time of loading the library I had to make modifications when doing the installation

if I do a clean reinstall via script.sh the Rpio.GPIO library update to make callback event calls work correctly?

No Resistor 10k: To avoid the use of the 10k resistor it is possible to do something, I forced with calls python set pulldown on the pin but no solution: GPIO.setup (31, GPIO.IN, pull_up_down = GPIO.PUD_DOWN) without resistor but GPIO.input on the pin returns to reading 0-1 random values

The truth is that I had tried it but the use of gpio was broken worse I did it with old images I never tried it with my images so it could work or I could send you the error that it is only for RPi

and it still returns you like this because it detects the pin in false as if it had nothing connected, that’s why the value is random

hey look I took a moment to check if you really couldn’t put the pins in pull-down and it turns out that if it’s okay what happened when I gave you the gpio command -g write 7 1

estaba mal era gpio -1 write 7 1 hay fue mi error pero en efecto funciona muy bien igual si quieres le di una actualizacion rapida a mi repo para que tengas mas detalles

Captura%20de%20pantalla%20(430)

Captura%20de%20pantalla%20(431)

Captura%20de%20pantalla%20(432)

Captura%20de%20pantalla%20(434)

hello, script reinstalled now.

I write type down on physical pin board = 7, but button_state_m2z.py always reads only low state in input, no change of state detected when the wires are joined : pin7 + pin39 (gnd).

No use resistance 10k.

look I took a few minutes to review it and if it worked correctly :thinking:

Screenshot_20220330-142722

do you join the physical pin 7 to a gnd (read event change of state) without using a 10k resistor? you can post a drawing whith pin GPIO use.

i don’t understand why i don’t change state , here it doesn’t work change state GPIO.input on my board

look right now I can’t post a drawing but it’s the same as before just connect one pin of your button to GND and the other to pin 7 and that’s it

also in the capture that the post does not use any 10k resistor :thinking: I find it strange that it does not work for you, could you check if your wiring is properly connected first or maybe your button was damaged :sweat_smile:

Hello I have reviewed and tightened the wiring in fact now it works, I change GPIO.input captured!:slightly_smiling_face:

sudo gpio -1 mode 7 down

Is there a permanent way of definitive setting from Rpio.GPIO library?

Still error code for GPIO.add_event_detect () calls:Failed%20to%20add%20edge%20detection

GPIO.add_event_detect (pin, GPIO.BOTH, call back = myFunction)

GPIO.add_event_detect (pin, GPIO.FALLING, call back = myFunction)

Well, as I mentioned before, remember that what I basically did was about writing the library, obviously it is not going to be perfect and it has its ups and downs, and about your other question about whether the pins can be established without forcing the start, the answer is yes, but why At the moment I don’t have the time to make modifications to the current library, I have my own as I mentioned, but I don’t release it because it still has many bugs. In fact, mine does have edge detection on the board, but I haven’t corrected the value either. of the pins that’s the reason I haven’t released it yet

ok do you expect a long time to release a first version?

Alternative libraries Python with GPIO.add_event_detect on armbian are there?

to get the first version out maybe in a few months and about other libraries I couldn’t tell you what I can tell you is that if you know the c++ language you can create a program that reads the input of the buttons with wiringpi

Hi Arturo, the Rpio.GPIO_BP have the callback functions ADD.event detect operative help me to make them work with your downloaded ones?

The Python 3.7 script in production must urgently use the callback event detect:

GPIO.add_event_detect (pin, GPIO.BOTH, call back = myFunction)

GPIO.add_event_detect (pin, GPIO.FALLING, call back = myFunction)

If you want we can speak privately for assistance thank you

tried running LeMaker’s add_event_detect.py but same error: RuntimeError: Failed to add edge detection GPIO_BP_lib_Failed%20to%20add%20edge%20detection

First of all, good night, you grabbed me before I went to sleep. I’ll tell you, my friend, I already knew about the library that you mentioned before and in fact, if you realize it in the references of my repository, I added it since it was with your library that I was able to overlay the another RPi.GPIO library so it’s still not going to work for you and if you want to talk in private without any issue just let me look for a while but the truth is if you’re looking for a fast library that solves everything quickly it’s somewhat complicated I’ll give you time solution to edge detection with a new library but it will take a while

and if you like tomorrow, remind me with a comment and I could show you that I already have a library that works but with bugs I sacrificed several functions for edge detection

thank you so much tomorrow, here it is now morning

what I don’t understand is not clear to me is that LeMaker has officially released the callback functions as working from github …:faccia_con_monocolo:

Hello as soon as you release the beta version for edge detection let me know, tomorrow I’ll try to run my callback script thank you very much friend!

sorry for the time is that today several things came together but I still have time to show you how my library works. The first change we have is that the event detection already works.

Captura%20de%20pantalla%20(447)

also that in my library there is a new command for gpio readall correction now in this library is gpioread giving us a correction in the BCM number.

Captura%20de%20pantalla%20(445)

Captura%20de%20pantalla%20(446)

also the state of the pins is kept at 0 from the beginning

Captura%20de%20pantalla%20(448)

but it has faults such as the identification of pins that in the case of physical pins can change at times, in addition to the fact that it can present faults in the output of these, activating others as a consequence, among other things.