hi Arturo,
can you load it now on the new images repo?
As I told you, the linux banana pi card is connected to the power supply of the industrial machine, so when I unplug the power cable to the machine several times a day, the linux banana pi card also turns off / on several times a day. I would like to avoid the operating system crash.
Which new best image should I upload from the repo?
A thousand thanks
Interisting, do you have the code of the new library on your github, couldn’t find it!?
Even it is not stable, I would be interested interested especially in the ‘gpio readall’ fix for the BCM numbers.
On the ‘pull-up’ problem I found a working fork of the BPI-SINOVOIP RPI-GPIO code:
With this I was able to activate the pull-ups I need for my LISY boards
see code below
#!/usr/bin/python
import RPi.GPIO as GPIO
GPIO.setmode(GPIO.BCM)
GPIO.setup(10, GPIO.IN, pull_up_down=GPIO.PUD_UP)
print(‘pull up on GPIO.12 (Sound/DIP2) set’)
GPIO.setup(6, GPIO.IN, pull_up_down=GPIO.PUD_UP)
print(‘pull up on GPIO.22 (TEST/DIP6) set’)
GPIO.setup(13, GPIO.IN, pull_up_down=GPIO.PUD_UP)
print(‘pull up on GPIO.23 (DEBUG/DIP7) set’)
GPIO.setup(5, GPIO.IN, pull_up_down=GPIO.PUD_UP)
print(‘pull up on GPIO.21 (Autostart/DIP8) set’)
Hello Botango,
I take up the quote from Roxas on the current instability (physical pins Library GPIO)
If you want you can test the add_event_detect functions on those Python GPIO libraries, you can do it with a Button connected to the physical GPIO pin of banana pi M2 Zero.
I am attaching the Python script that triggers commands (bash script) when it detects callback events on the Python GPIO function buttonStateChanged () ==> buttonPressed> = 5 secbuttonCallback_1.py (1,4 KB)
only change I made is that I used
GPIO.setmode(GPIO.BCM) instead of GPIO.setmode(GPIO.BOARD)
and set pin=5 which is GPIO.21
because I’m not sure about the pin numbering with setmode(GPIO.BOARD)
Edit: happy to help you with this library, but if you further questions better open a new thread and I will answer you there, I do not want to ‘enter’ Roxas thread here and we are drifting away a bit from the original topic …
Good friend, look, I hope before Thursday or Friday I can upload the new image for you to test it, but if you want you can take a look at git so you can check the new changes to the script, since I have added the corrections and the library of the friend @ bontango
sure friend look now i have updated the git repository and add a function to fix the gpio table now the command you can use to query is (sudo gpioread)
the same for me it worked well but I think it would be better if you use sub process and there is no issue that they publish it here so we will have more info of any problem friend
Yes, thanks to the help of the friend Bontango, I updated the script with the new library and new examples that I quickly checked and carried out, in addition to the new sudo gpioread command for the new gpio and alrato table, I would only do a simple update to the repos like around 10 or 11 pm
Ok I await your new Ubuntu Armbian Minimal image release for Bpi-M2-Zero to recompile and reinstall everything inside with the script.sh.
Thanks to Bontango for the callback
ah, I see … you are using the original output of ‘gpio readall’ and doing a ‘sed translation’.
Based on your work I spend some hours to look into the BPI-WiringPi2 code and did the same thing there
by adding a special translation table for M2-Zero
I will try to ix also the ‘pull-up’ bug, but I guess that will take some time …
You can find my fork of BPI-WiringPi2 on my github
On Raspberry I was using " gpio wfi rising/falling/both within a shell script. gpio wfi do also use the WiringPiISR library function. ( Errormessage: wiringPiISR: wait for support (5) )
For Banana PI I was able to replace that with a small python script which uses the library below ( GPIO.add_event_detect(pin, GPIO.BOTH, callback=buttonStateChanged) )
hello friend Bontango,
i am trying to execute callback_1.py from root banana pi, but i get error no rpi module.
I installed your library by following your simple board.sh file editing steps
which library did you install? for the callback_1.py you need to install the RPI.GPio library from my link above. My library gives you a new version of WiringPI2!
New image for banana m2 zero with experimental parks for the use of uart ttyS0 not yet tested, I will only leave it available for a while until I reach the final solution