Configuracion y uso de GPIO BPI-M2 Zero

excellent Arturo, the callback script can be found in gpio_examples? 2 questions I didn’t understand correctly:

  1. the setting to 0 (sudo gpio -1 mode 7 down) must be launched only the first time, then the pin is kept at 0 even after restarting the machine?

  2. Regarding the defect, I didn’t quite understand what can happen, the programmed GPIO pin controlled by the button can suddenly change the GPIO.input state without any operator pushing the button?

hello well to your questions no the callback script is not yet in examples,

Next, the configuration of 0 in the gpio is already by default at 0 from the restart after the installation and with respect to the last question, it is not that it changes due to the use of a button, but rather that, since it is not very stable, it is either an LED a button or another actuator can change in a surprising way, for example you have a led on suddenly it can turn off and continue running the program and with the button it would be the same it can be pressed but at the mere hour it can appear as not pressed when pressed.

hi Arturo, I suffered an uboot kernel boot block on the Rom Armbian Focal Trunk. The machine does not boot anymore (file system) I wanted to ask if you have the .deb file of this trunk image or other way to repair this broken Armbian image. The machine boot uboot control directly from the serial COM port.

boot_error_block_1.mp4 (505,5 KB)

It block here (serial connection):

Loading, please wait…

Starting version 245.4-4ubuntu3.15

Begin: Loading essential drivers … done.

Begin: Running /scripts/init-premount … done.

Begin: Mounting root file system … Begin: Running /scripts/local-top … done.

Begin: Running /scripts/local-premount … done.

Begin: Will now check root file system … fsck from util-linux 2.34

[/usr/sbin/fsck.ext4 (1) – /dev/mmcblk0p1] fsck.ext4 -a -C0 /dev/mmcblk0p1 /dev/mmcblk0p1: recovering journal …===> Block

Now during uboot startup I pressed the 0 key, now unfortunately I can’t even start uboot anymore: no_uboot

Here the Armbian OS recovery info but the .deb file of this image would be needed: https://docs.armbian.com/User-Guide_Recovery/

Hi, sorry I’m late, look, I think I know where this is going. Something similar happened to me a while ago, but it was because the dtb file was corrupt.

That’s why I think I could have two solutions for you, the first is to replace the dtb file inside mnt/boot/dtbs/ with the one I leave here

sun8i-h2-plus-bananapi-m2-zero.dtb (21,3 KB)

linux-u-boot-bananapim2zero-current_21.08.1_armhf.deb (209,4 KB)

linux-u-boot-current-bananapim2zero_21.02.3_armhf.deb (209,5 KB)

linux-u-boot-current-bananapim2zero_21.05.1_armhf.deb (212,8 KB)

armbian-bsp-cli-bananapim2plus_21.08.8_armhf.deb (406,6 KB)

armbian-bsp-cli-bananapim2plus_22.02.1_armhf.deb (409,4 KB)

and the other is to make a copy of your sd, first you will have to prepare another sd with the same system you are running and replace the root content with the one that was corrupt

anyway if it gets complicated you can send me a message anyway try to keep a backup in case something happens

hi, I have now done a check but /mnt is an empty folder:

I wanted to understand the cause that triggered the crash to avoid it in the future, whether it depends on my webApp software running (I left the banana pi on trial for one night and then it frizzled in the morning) or something on the u-boot file system. Armbian Focal Minimal image.

The best solution is the first option (dtb file)?

in /boot/dtb/ there is a file “sun8i-h2-plus-bananapi-m2-zero.dtb” is the right one that needs to be replaced to fix future u-boot boot blocks?

hello sorry for the late reply but I’m a bit busy but I think seeing everything maybe the server you were running has already damaged the uboot of your image,

The truth is that I recommend you to do the second option that I proposed on how to repair the uboot,

since I really can’t do much without having a copy of your image I have a few ideas but it’s trial and error of various commands and combinations,

What you should try is to download the uboot and load it through ftp using tftpboot (ip address of the network folder example: 192.168.1.12, without parentheses) (name of the uboot without parentheses) or use help boot to see parameters to configure.

hi, the file uboot healthy good what is it? can you send me the example command to upload?

You have solved on the banana pi no longer the boot block occurs?

You would like to understand why it breaks, I have apps running.

claro mira seria algo asi

tftpboot 192.168.1.12 u-boot-sunxi-with-spl.bin

y ya solo seria esperar a que lo carge y lo escriba

Hello, by loading the your file.dtb can you tell me if you have solved the boot block of the Armbian Trunk file system on the banana pi?

I rewrote the Armbian trunk image again, I am ready to upload your .dtb file, it would be great if I could permanently fix the OS boot block error with file “sun8i-h2-plus-bananapi-m2-zero.dtb” good fixed -

Hello, I’ve been a bit busy, but look, I’m in the process of finishing compiling new images, once they’re ready, you could try them, I hope the new ones are more stable and can help you.

Good, if you can permanently fix this Ubuntu Armbian system boot error right in the new img that would be great. Today I have a test on the banana pi zero if you can upload a good image let me know. a thousand thanks

great job In the video i see that you have
armbian 21-08-3 focal with linux 5.10.60-sunxi But on the armbian download page i can only download armbian 21-08-1 focal with linux 5.10.60-sunxi is there a download for your version 21-08-03 ? please a link many thanks

Build yourself an image: https://docs.armbian.com/Developer-Guide_Build-Preparation/

hello look at the image I no longer have it available because they reported the link to me a while ago so for the moment only the ones on my git page are available,

but soon I hope to be able to upload new, more updated compilations

Hello Roxas, I tested armbian 21-08-1 focal with linux 5.10.60-sunxi with your script version 1.2 . all looks good but errors on examples python3 scripts?

then I tested your link ​Ubuntu Focal GPIO configured rev1.3 28-03-22 And all works great, all python3 examples i tested and works great.

Then i add my bme280 i2c temp en pressure device. 76 roxas@bananapim2zero:~$ i2cdetect -y 0 0 1 2 3 4 5 6 7 8 9 a b c d e f 00: – -- – -- – -- – -- – -- – -- – 10: – -- – -- – -- – -- – -- – -- – -- – -- 20: – -- – -- – -- – -- – -- – -- – -- – -- 30: – -- – -- – -- – -- – -- – -- – -- – -- 40: – -- – -- – -- – -- – -- – -- – -- – -- 50: – -- – -- – -- – -- – -- – -- – -- – -- 60: – -- – -- – -- – -- – -- – -- – -- – -- 70: – -- – -- – -- 76 –

the 76 is oke detected. so i download script https://github.com/bortek/bme280/blob/master/bme280_file.py line with bus = smbus.SMBus(1) # changed to 0

roxas@bananapim2zero:~$ sudo python3 bitb-bme280.py Temperature : 24.37 C Pressure : 1001.37 hPa roxas@bananapim2zero:~$

so i want you to know that bme280 also works fine .

Good morning friend, I tell you that I think you did not review all my article or you do not review all my video since what you tell me is part of the secondary confirmations not being configured, I leave you the link for that part so you can solve it

and really it is not an error just that you have not enabled the configuration, that is something that is done manually and my script does not do it automatically

Hello everyone, I hope you are well. Soon I will publish in git the new images for the banana pi m2 zero here I show you a small preview of the new images based on ubuntu and debian, so stay tuned because as soon as I have some time I will finish compressing them and uploading them to mediafire, in addition to When I publish them, I will publish a small video on YouTube so that you are aware.

Captura%20de%20pantalla%20de%202022-05-30%2001-21-38

New Images