Banana pi BPI-R3 no CIFS module

Managed to use USB Serial by adding some modules that were referencing that… so not a problem anymore. But wifi still not working

So this is the output of iw dev wlan0 scan:

root@bpi-r3:/etc/systemd/system# ifconfig wlan0 up
root@bpi-r3:/etc/systemd/system# iw dev wlan0 scan
BSS 00:06:91:78:d5:a0(on wlan0)
        last seen: 1422.948s [boottime]
        TSF: 11944142129558 usec (138d, 05:49:02)
        freq: 2412
        beacon interval: 100 TUs
        capability: ESS Privacy ShortSlotTime (0x0411)
        signal: -67.00 dBm
        last seen: 1270 ms ago
        Information elements from Probe Response frame:
        SSID: Guests-2.4
        Supported rates: 1.0* 2.0* 5.5* 11.0* 18.0 24.0 36.0 54.0 
        DS Parameter set: channel 1
        ERP: <no flags>
        Extended supported rates: 6.0 9.0 12.0 48.0 
        RSN:     * Version: 1
                 * Group cipher: TKIP
                 * Pairwise ciphers: CCMP TKIP
                 * Authentication suites: PSK
                 * Capabilities: 16-PTKSA-RC 1-GTKSA-RC (0x000c)
        BSS Load:
                 * station count: 0
                 * channel utilisation: 43/255
                 * available admission capacity: 0 [*32us]
        Measurement Pilot Transmission:
                 * interval: 0 TUs
        HT capabilities:
                Capabilities: 0x8ad
                        RX LDPC
                        HT20
                        SM Power Save disabled
                        RX HT20 SGI
                        TX STBC
                        No RX STBC
                        Max AMSDU length: 7935 bytes
                        No DSSS/CCK HT40
                Maximum RX AMPDU length 65535 bytes (exponent: 0x003)
                Minimum RX AMPDU time spacing: 4 usec (0x05)
                HT RX MCS rate indexes supported: 0-23
                HT TX MCS rate indexes are undefined
        HT operation:
                 * primary channel: 1
                 * secondary channel offset: no secondary
                 * STA channel width: 20 MHz
                 * RIFS: 1
                 * HT protection: no
                 * non-GF present: 1
                 * OBSS non-GF present: 0
                 * dual beacon: 0
                 * dual CTS protection: 0
                 * STBC beacon: 0
                 * L-SIG TXOP Prot: 0
                 * PCO active: 0
                 * PCO phase: 0
        Overlapping BSS scan params:
                 * passive dwell: 20 TUs
                 * active dwell: 10 TUs
                 * channel width trigger scan interval: 300 s
                 * scan passive total per channel: 200 TUs
                 * scan active total per channel: 20 TUs
                 * BSS width channel transition delay factor: 5
                 * OBSS Scan Activity Threshold: 0.25 %
        Extended capabilities:
                 * HT Information Exchange Supported
                 * Extended Channel Switching
                 * BSS Transition
                 * Operating Mode Notification
        WPS:     * Version: 1.0
                 * Wi-Fi Protected Setup State: 2 (Configured)
                 * Response Type: 3 (AP)
                 * UUID: 69cb2e76-0d6c-46d2-9051-d5c1aad01967
                 * Manufacturer: PTIN
                 * Model: PTIN
                 * Model Number: GR241AG
                 * Serial Number: 5054494E9178D59F
                 * Primary Device Type: 6-0050f204-1
                 * Device name: devName
                 * Config methods: Label, Display
                 * RF Bands: 0x3
                 * Version2: 2.0
        WPA:     * Version: 1
                 * Group cipher: TKIP
                 * Pairwise ciphers: CCMP TKIP
                 * Authentication suites: PSK
        WMM:     * Parameter version 1
                 * u-APSD
                 * BE: CW 15-1023, AIFSN 3
                 * BK: CW 15-1023, AIFSN 7
                 * VI: CW 7-15, AIFSN 2, TXOP 3008 usec
                 * VO: CW 3-7, AIFSN 2, TXOP 1504 usec
BSS 00:06:91:78:d5:a2(on wlan0)
        last seen: 1422.950s [boottime]
        TSF: 11944142137771 usec (138d, 05:49:02)
        freq: 2412
        beacon interval: 100 TUs
        capability: ESS ShortSlotTime (0x0401)
        signal: -68.00 dBm
        last seen: 1260 ms ago
        Information elements from Probe Response frame:
        SSID: MEO-WiFi
        Supported rates: 1.0* 2.0* 5.5* 11.0* 18.0 24.0 36.0 54.0 
        DS Parameter set: channel 1
        ERP: <no flags>
        Extended supported rates: 6.0 9.0 12.0 48.0 
        BSS Load:
                 * station count: 1
                 * channel utilisation: 43/255
                 * available admission capacity: 0 [*32us]
        Measurement Pilot Transmission:
                 * interval: 0 TUs
        HT capabilities:
                Capabilities: 0x8ad
                        RX LDPC
                        HT20
                        SM Power Save disabled
                        RX HT20 SGI
                        TX STBC
                        No RX STBC
                        Max AMSDU length: 7935 bytes
                        No DSSS/CCK HT40
                Maximum RX AMPDU length 65535 bytes (exponent: 0x003)
                Minimum RX AMPDU time spacing: 4 usec (0x05)
                HT RX MCS rate indexes supported: 0-23
                HT TX MCS rate indexes are undefined
        HT operation:
                 * primary channel: 1
                 * secondary channel offset: no secondary
                 * STA channel width: 20 MHz
                 * RIFS: 1
                 * HT protection: no
                 * non-GF present: 1
                 * OBSS non-GF present: 0
                 * dual beacon: 0
                 * dual CTS protection: 0
                 * STBC beacon: 0
                 * L-SIG TXOP Prot: 0
                 * PCO active: 0
                 * PCO phase: 0
        Overlapping BSS scan params:
                 * passive dwell: 20 TUs
                 * active dwell: 10 TUs
                 * channel width trigger scan interval: 300 s
                 * scan passive total per channel: 200 TUs
                 * scan active total per channel: 20 TUs
                 * BSS width channel transition delay factor: 5
                 * OBSS Scan Activity Threshold: 0.25 %
        Extended capabilities:
                 * HT Information Exchange Supported
                 * Extended Channel Switching
                 * BSS Transition
                 * Operating Mode Notification
        WMM:     * Parameter version 1
                 * u-APSD
                 * BE: CW 15-1023, AIFSN 3
                 * BK: CW 15-1023, AIFSN 7
                 * VI: CW 7-15, AIFSN 2, TXOP 3008 usec
                 * VO: CW 3-7, AIFSN 2, TXOP 1504 usec
BSS 02:92:bf:14:3d:65(on wlan0)
        last seen: 1423.309s [boottime]
        TSF: 6279650509464 usec (72d, 16:20:50)
        freq: 2437
        beacon interval: 100 TUs
        capability: ESS Privacy ShortPreamble ShortSlotTime RadioMeasure (0x1431)
        signal: -87.00 dBm
        last seen: 910 ms ago
        SSID: Visitors-HFA
        Supported rates: 1.0* 2.0* 5.5* 11.0* 6.0 9.0 12.0 18.0 
        DS Parameter set: channel 6
        TIM: DTIM Count 0 DTIM Period 1 Bitmap Control 0x1 Bitmap[0] 0xec (+ 1 octet)
        ERP: <no flags>
        Extended supported rates: 24.0 36.0 48.0 54.0 
        BSS Load:
                 * station count: 1
                 * channel utilisation: 22/255
                 * available admission capacity: 31250 [*32us]
        RM enabled capabilities:
                Capabilities: 0x73 0xd0 0x00 0x00 0x0c
                        Link Measurement
                        Neighbor Report
                        Beacon Passive Measurement
                        Beacon Active Measurement
                        Beacon Table Measurement
                        LCI Measurement
                        Transmit Stream/Category Measurement
                        Triggered Transmit Stream/Category
                        FTM Range Report
                        Civic Location Measurement
                Nonoperating Channel Max Measurement Duration: 0
                Measurement Pilot Capability: 4
        HT capabilities:
                Capabilities: 0x41ac
                        HT20
                        SM Power Save disabled
                        RX HT20 SGI
                        TX STBC
                        RX STBC 1-stream
                        Max AMSDU length: 3839 bytes
                        No DSSS/CCK HT40
                        40 MHz Intolerant
                Maximum RX AMPDU length 65535 bytes (exponent: 0x003)
                Minimum RX AMPDU time spacing: 8 usec (0x06)
                HT TX/RX MCS rate indexes supported: 0-23
        HT operation:
                 * primary channel: 6
                 * secondary channel offset: no secondary
                 * STA channel width: 20 MHz
                 * RIFS: 1
                 * HT protection: no
                 * non-GF present: 1
                 * OBSS non-GF present: 0
                 * dual beacon: 0
                 * dual CTS protection: 0
                 * STBC beacon: 0
                 * L-SIG TXOP Prot: 0
                 * PCO active: 0
                 * PCO phase: 0
        Overlapping BSS scan params:
                 * passive dwell: 20 TUs
                 * active dwell: 10 TUs
                 * channel width trigger scan interval: 300 s
                 * scan passive total per channel: 200 TUs
                 * scan active total per channel: 20 TUs
                 * BSS width channel transition delay factor: 5
                 * OBSS Scan Activity Threshold: 0.25 %
        Extended capabilities:
                 * HT Information Exchange Supported
                 * Extended Channel Switching
                 * TFS
                 * WNM-Sleep Mode
                 * TIM Broadcast
                 * BSS Transition
                 * SSID List
                 * Operating Mode Notification
        WMM:     * Parameter version 1
                 * BE: CW 15-1023, AIFSN 3
                 * BK: CW 15-1023, AIFSN 7
                 * VI: CW 7-15, AIFSN 2, TXOP 3008 usec
                 * VO: CW 3-7, AIFSN 2, TXOP 1504 usec
        RSN:     * Version: 1
                 * Group cipher: CCMP
                 * Pairwise ciphers: CCMP
                 * Authentication suites: PSK
                 * Capabilities: 1-PTKSA-RC 1-GTKSA-RC (0x0000)
BSS fa:92:bf:14:3d:65(on wlan0)
        last seen: 1423.309s [boottime]
        TSF: 6279650511990 usec (72d, 16:20:50)
        freq: 2437
        beacon interval: 100 TUs
        capability: ESS Privacy ShortPreamble ShortSlotTime RadioMeasure (0x1431)
        signal: -89.00 dBm
        last seen: 910 ms ago
        SSID: Hfa
        Supported rates: 12.0* 18.0 24.0* 36.0 48.0 54.0 
        DS Parameter set: channel 6
        TIM: DTIM Count 0 DTIM Period 1 Bitmap Control 0x0 Bitmap[0] 0x0
        ERP: <no flags>
        BSS Load:
                 * station count: 0
                 * channel utilisation: 22/255
                 * available admission capacity: 31250 [*32us]
        RM enabled capabilities:
                Capabilities: 0x73 0xd0 0x00 0x00 0x0c
                        Link Measurement
                        Neighbor Report
                        Beacon Passive Measurement
                        Beacon Active Measurement
                        Beacon Table Measurement
                        LCI Measurement
                        Transmit Stream/Category Measurement
                        Triggered Transmit Stream/Category
                        FTM Range Report
                        Civic Location Measurement
                Nonoperating Channel Max Measurement Duration: 0
                Measurement Pilot Capability: 4
        HT capabilities:
                Capabilities: 0x41ac
                        HT20
                        SM Power Save disabled
                        RX HT20 SGI
                        TX STBC
                        RX STBC 1-stream
                        Max AMSDU length: 3839 bytes
                        No DSSS/CCK HT40
                        40 MHz Intolerant
                Maximum RX AMPDU length 65535 bytes (exponent: 0x003)
                Minimum RX AMPDU time spacing: 8 usec (0x06)
                HT TX/RX MCS rate indexes supported: 1-23
        HT operation:
                 * primary channel: 6
                 * secondary channel offset: no secondary
                 * STA channel width: 20 MHz
                 * RIFS: 1
                 * HT protection: no
                 * non-GF present: 1
                 * OBSS non-GF present: 0
                 * dual beacon: 0
                 * dual CTS protection: 0
                 * STBC beacon: 0
                 * L-SIG TXOP Prot: 0
                 * PCO active: 0
                 * PCO phase: 0
        Overlapping BSS scan params:
                 * passive dwell: 20 TUs
                 * active dwell: 10 TUs
                 * channel width trigger scan interval: 300 s
                 * scan passive total per channel: 200 TUs
                 * scan active total per channel: 20 TUs
                 * BSS width channel transition delay factor: 5
                 * OBSS Scan Activity Threshold: 0.25 %
        Extended capabilities:
                 * HT Information Exchange Supported
                 * Extended Channel Switching
                 * TFS
                 * WNM-Sleep Mode
                 * TIM Broadcast
                 * BSS Transition
                 * SSID List
                 * Operating Mode Notification
        WMM:     * Parameter version 1
                 * BE: CW 15-1023, AIFSN 3
                 * BK: CW 15-1023, AIFSN 7
                 * VI: CW 7-15, AIFSN 2, TXOP 3008 usec
                 * VO: CW 3-7, AIFSN 2, TXOP 1504 usec
        RSN:     * Version: 1
                 * Group cipher: CCMP
                 * Pairwise ciphers: CCMP
                 * Authentication suites: PSK
                 * Capabilities: 1-PTKSA-RC 1-GTKSA-RC (0x0000)
BSS fa:92:bf:14:3c:64(on wlan0)
        last seen: 1423.706s [boottime]
        TSF: 11952009423982 usec (138d, 08:00:09)
        freq: 2462
        beacon interval: 100 TUs
        capability: ESS Privacy ShortPreamble ShortSlotTime RadioMeasure (0x1431)
        signal: -83.00 dBm
        last seen: 510 ms ago
        SSID: Hfa
        Supported rates: 12.0* 18.0 24.0* 36.0 48.0 54.0 
        DS Parameter set: channel 11
        TIM: DTIM Count 0 DTIM Period 1 Bitmap Control 0x0 Bitmap[0] 0x0
        ERP: <no flags>
        BSS Load:
                 * station count: 0
                 * channel utilisation: 22/255
                 * available admission capacity: 31250 [*32us]
        RM enabled capabilities:
                Capabilities: 0x73 0xd0 0x00 0x00 0x0c
                        Link Measurement
                        Neighbor Report
                        Beacon Passive Measurement
                        Beacon Active Measurement
                        Beacon Table Measurement
                        LCI Measurement
                        Transmit Stream/Category Measurement
                        Triggered Transmit Stream/Category
                        FTM Range Report
                        Civic Location Measurement
                Nonoperating Channel Max Measurement Duration: 0
                Measurement Pilot Capability: 4
        HT capabilities:
                Capabilities: 0x41ac
                        HT20
                        SM Power Save disabled
                        RX HT20 SGI
                        TX STBC
                        RX STBC 1-stream
                        Max AMSDU length: 3839 bytes
                        No DSSS/CCK HT40
                        40 MHz Intolerant
                Maximum RX AMPDU length 65535 bytes (exponent: 0x003)
                Minimum RX AMPDU time spacing: 8 usec (0x06)
                HT TX/RX MCS rate indexes supported: 1-23
        HT operation:
                 * primary channel: 11
                 * secondary channel offset: no secondary
                 * STA channel width: 20 MHz
                 * RIFS: 1
                 * HT protection: no
                 * non-GF present: 1
                 * OBSS non-GF present: 0
                 * dual beacon: 0
                 * dual CTS protection: 0
                 * STBC beacon: 0
                 * L-SIG TXOP Prot: 0
                 * PCO active: 0
                 * PCO phase: 0
        Overlapping BSS scan params:
                 * passive dwell: 20 TUs
                 * active dwell: 10 TUs
                 * channel width trigger scan interval: 300 s
                 * scan passive total per channel: 200 TUs
                 * scan active total per channel: 20 TUs
                 * BSS width channel transition delay factor: 5
                 * OBSS Scan Activity Threshold: 0.25 %
        Extended capabilities:
                 * HT Information Exchange Supported
                 * Extended Channel Switching
                 * TFS
                 * WNM-Sleep Mode
                 * TIM Broadcast
                 * BSS Transition
                 * SSID List
                 * Operating Mode Notification
        WMM:     * Parameter version 1
                 * BE: CW 15-1023, AIFSN 3
                 * BK: CW 15-1023, AIFSN 7
                 * VI: CW 7-15, AIFSN 2, TXOP 3008 usec
                 * VO: CW 3-7, AIFSN 2, TXOP 1504 usec
        RSN:     * Version: 1
                 * Group cipher: CCMP
                 * Pairwise ciphers: CCMP
                 * Authentication suites: PSK
                 * Capabilities: 1-PTKSA-RC 1-GTKSA-RC (0x0000)
BSS 02:92:bf:14:3c:64(on wlan0)
        last seen: 1423.808s [boottime]
        TSF: 11952009523584 usec (138d, 08:00:09)
        freq: 2462
        beacon interval: 100 TUs
        capability: ESS Privacy ShortPreamble ShortSlotTime RadioMeasure (0x1431)
        signal: -86.00 dBm
        last seen: 410 ms ago
        SSID: Visitors-HFA
        Supported rates: 1.0* 2.0* 5.5* 11.0* 6.0 9.0 12.0 18.0 
        DS Parameter set: channel 11
        TIM: DTIM Count 0 DTIM Period 1 Bitmap Control 0x1 Bitmap[0] 0x1c
        ERP: <no flags>
        Extended supported rates: 24.0 36.0 48.0 54.0 
        BSS Load:
                 * station count: 1
                 * channel utilisation: 22/255
                 * available admission capacity: 31250 [*32us]
        RM enabled capabilities:
                Capabilities: 0x73 0xd0 0x00 0x00 0x0c
                        Link Measurement
                        Neighbor Report
                        Beacon Passive Measurement
                        Beacon Active Measurement
                        Beacon Table Measurement
                        LCI Measurement
                        Transmit Stream/Category Measurement
                        Triggered Transmit Stream/Category
                        FTM Range Report
                        Civic Location Measurement
                Nonoperating Channel Max Measurement Duration: 0
                Measurement Pilot Capability: 4
        HT capabilities:
                Capabilities: 0x41ac
                        HT20
                        SM Power Save disabled
                        RX HT20 SGI
                        TX STBC
                        RX STBC 1-stream
                        Max AMSDU length: 3839 bytes
                        No DSSS/CCK HT40
                        40 MHz Intolerant
                Maximum RX AMPDU length 65535 bytes (exponent: 0x003)
                Minimum RX AMPDU time spacing: 8 usec (0x06)
                HT TX/RX MCS rate indexes supported: 0-23
        HT operation:
                 * primary channel: 11
                 * secondary channel offset: no secondary
                 * STA channel width: 20 MHz
                 * RIFS: 1
                 * HT protection: no
                 * non-GF present: 1
                 * OBSS non-GF present: 0
                 * dual beacon: 0
                 * dual CTS protection: 0
                 * STBC beacon: 0
                 * L-SIG TXOP Prot: 0
                 * PCO active: 0
                 * PCO phase: 0
        Overlapping BSS scan params:
                 * passive dwell: 20 TUs
                 * active dwell: 10 TUs
                 * channel width trigger scan interval: 300 s
                 * scan passive total per channel: 200 TUs
                 * scan active total per channel: 20 TUs
                 * BSS width channel transition delay factor: 5
                 * OBSS Scan Activity Threshold: 0.25 %
        Extended capabilities:
                 * HT Information Exchange Supported
                 * Extended Channel Switching
                 * TFS
                 * WNM-Sleep Mode
                 * TIM Broadcast
                 * BSS Transition
                 * SSID List
                 * Operating Mode Notification
        WMM:     * Parameter version 1
                 * BE: CW 15-1023, AIFSN 3
                 * BK: CW 15-1023, AIFSN 7
                 * VI: CW 7-15, AIFSN 2, TXOP 3008 usec
                 * VO: CW 3-7, AIFSN 2, TXOP 1504 usec
        RSN:     * Version: 1
                 * Group cipher: CCMP
                 * Pairwise ciphers: CCMP
                 * Authentication suites: PSK
                 * Capabilities: 1-PTKSA-RC 1-GTKSA-RC (0x0000)
BSS 08:3a:2f:15:e7:e0(on wlan0)
        last seen: 1423.983s [boottime]
        TSF: 1408617251 usec (0d, 00:23:28)
        freq: 2472
        beacon interval: 100 TUs
        capability: ESS Privacy ShortSlotTime (0x0411)
        signal: -90.00 dBm
        last seen: 230 ms ago
        SSID: NVR083a2f15e7e0
        Supported rates: 1.0* 2.0* 5.5* 11.0* 6.0 9.0 12.0 18.0 
        DS Parameter set: channel 13
        TIM: DTIM Count 0 DTIM Period 1 Bitmap Control 0x0 Bitmap[0] 0x0
        ERP: Barker_Preamble_Mode
        Extended supported rates: 24.0 36.0 48.0 54.0 
        RSN:     * Version: 1
                 * Group cipher: CCMP
                 * Pairwise ciphers: CCMP
                 * Authentication suites: PSK
                 * Capabilities: 16-PTKSA-RC 1-GTKSA-RC (0x000c)
        HT capabilities:
                Capabilities: 0x2c
                        HT20
                        SM Power Save disabled
                        RX HT20 SGI
                        No RX STBC
                        Max AMSDU length: 3839 bytes
                        No DSSS/CCK HT40
                Maximum RX AMPDU length 65535 bytes (exponent: 0x003)
                Minimum RX AMPDU time spacing: 2 usec (0x04)
                HT RX MCS rate indexes supported: 0-15
                HT TX MCS rate indexes are undefined
        HT operation:
                 * primary channel: 13
                 * secondary channel offset: no secondary
                 * STA channel width: 20 MHz
                 * RIFS: 0
                 * HT protection: no
                 * non-GF present: 1
                 * OBSS non-GF present: 0
                 * dual beacon: 0
                 * dual CTS protection: 0
                 * STBC beacon: 0
                 * L-SIG TXOP Prot: 0
                 * PCO active: 0
                 * PCO phase: 0
        WMM:     * Parameter version 1
                 * u-APSD
                 * BE: CW 15-1023, AIFSN 3
                 * BK: CW 15-1023, AIFSN 7
                 * VI: CW 7-15, AIFSN 2, TXOP 2976 usec
                 * VO: CW 3-7, AIFSN 2, TXOP 1472 usec
root@bpi-r3:/etc/systemd/system# 

i cannot find hostapd2 service: image

This next command makes me think that system thinks that wlan0 is wired interface: image

Ok,if you use the base image without the additional services files from the gdrive then you have only one hostapd.

For iwconfig I guess you miss kernel option CONFIG_CFG80211_WEXT

OK. Added such module. image

Turns out iwconfig cannot connect to WPA networks… installed wpa_supplicant Still have errors though: image

OK after playing around a bit, finally could connect to wifi network! (WiFi blue LEDs still toggle in a funny way though)

Only thing left i think is the booting problems… any thoughts on this?

Maybe this is a stupid idea but, is it possible to put a really simple program that is executed if boot fails, which just sends “panic” to u-boot console so board reboots?

Also, can you point me to a tool to shrink images created from your base image? I used to use pishrink on a raspberry pi images but we tested on this and did not work.

What have you changed to get it working? What is strange with leds?

Which booting problems?

Linux kernel has a function to reboot at kernel crash,imho openwrt sets it by default,but don’t remember the config key

But this depends on linux loaded…only issue i know is the gpt sometimes cannot be read in uboot and imho fixed so far by the sgdisk-commands for backup+restore…here linux is not loaded as this happens in uboot

Why do you want to shrink it? Image is done in a 7G img file…do you mean you flash my image to a larger card and want to get the old filesize when dd from the card (depends on not changed partition size)? This can be done with truncate command which simply cuts off data from file after a specific size

Documented way to shrink image based on partitionlayout here,but this is only fdisk for old mbr,not gpt so maybe this has to be adjusted a bit

https://wiki.fw-web.de/doku.php?id=en:bpi-r2:ubuntu&s[]=truncate#create_the_image

But if you have not changed partitionlayout you can cut off after 7000MB

The image file is already packed with gzip. If you unpack/flash it with:

gunzip -c  ~/some-image.img.gz | sudo dd of=/dev/mmcblkX

Then you never need to unpack and handle the large .img file yourself.

No matter what the .img file size will be, the .img.gz will be approx the same.

I guess he has flashed my image,replaced kernel,configured system and want to get a such small image again from his card

But yes,you can also dd from the card and directly pack it

dd if=/dev/sdx | gzip > file.img.gz

And restore like eric wrote…but maybe not compatible with other cards (different size) and writes more data than necessary

Exactly. I flashed yours, replaced kernel and mediatek firmware, configured and want to shrink it now because dd created img with SD card size (32GB).

Regarding tweaking wifi, i installed wpa_supplicant, wireless-tools, rfkill, netplan

All networking is configured in netplan, i believe (i have wpa supplicant file but only should work for 1 interface and i have both connected to different networks, as per netplan configuration).

Sent some more iw and ip commands which i cannot enumerate for sure but this is my shell history: image

The issue im addressing is the GPT yes. Your fix with sgdisk commands did not work for me. Tried several times in several images. In this case, i assume such function you mentioned to reboot at kernel crash will not work as kernel does not even load, right?

Is there a way to put that functionality in uboot? or do any kind of failsafe boot that would load just that panic/reboot command?

You have done the fix on card,not in the img,right? Because this backups the main gpt and restores it to the back too (at the end of disk).

And yes you are in uboot which cannot read gpt and so not load kernel.

You can change my uboot to make a reboot when kernel cannot be loaded…but gpt error can’t be fixed by a reboot in my tests and also not by powercycle so it makes debugging harder

if run loadkernel; then bootm ${kaddr}${bootconf}; fi

This can have an else part where you can call “reset” or something other. If it fails at this position…have not debugged it further

When do you still get booting problems? Do you mean

*** ERROR: Can’t read GPT Entries *** find_valid_gpt: *** ERROR: Invalid GPT ***

Do you get it after some changes? Or do you get it randomly? Did you try another SD card?

We noticed high probability of this happening after reboots. With just power cycles it happens occasionally if we re-power it right after, if we wait a while it reduces significantly the probability of it happening.

We do need to make changes like installing software and pyhton packages. We also tried many SD cards from SandDisk (Industrial) and it happens to all of them.

Do you know why this happens to the GPT? We can’t tell if it’s a hardware thing or an software issue. To me its not software as it is sort of random and its mitigated with wait time between power cycle.

In my experience uboot is confused on reboot when main gpt (from image) does not match backup gpt (not overridden by image because at end of disk). In my tests rewriting the gpt had fixed it for me…but maybe there is an additional trigger

@frank-w truncate did the trick. Thanks once again!

Regarding GPT issue. We tried several SD cards and images… could not get rid of this.

It just goes to uboot console i write cmd “panic” so it reboots… eventually boots ok.

Do you think problems are minimized if we write firmware to emmc instead of booting via SD card?

I have done the gdisk trick on the sd yes… the way that you initially wrote it.

uboot trick may worth to be tested.

One question. Do i only need to chage uEnv.txt or does this require any further compilation?

Im a bit confused because when i mount flashed SD card, there is a uEnv.txt in boot partition but only contains

fit=6.1.12-main.itb

Normally my uboot loads uEnv.txt from card and extends/overrides builtin environment (which is uEnv_r3.txt in the repo)…but here the BPI-BOOT partition is not found so to archive this you have to compile/flash uboot. Note: for r3 (and r64) uboot is packed into atf…so you have first to compile uboot and then switch to mtk-atf branch and compile again to get the right binaries…there you can use install function of build.sh to flash

See github actions config on how to compile

Normally the GPT table is only written to, when there are changes made to the partition setup.

So if nothing is being changed to the partiton table and the gpt error still occurs, it must be a read error.

Can you find anything about mmc errors with dmesg? (but then already passed uboot, so perhapse not.)

Edit: Just a thought, did you try CONFIG_MMC_QUIRKS in uboot?

I could not find any emmc related log in dmesg.

@frank-w To see if i get this right.

1- So first i clone that repo switch to the branch you mentioned (2023-01-bpi) and edit uEnv_r3.txt, that line you highlighted to:

newboot=run checkrd; run setbootconf; run buildargs;if printenv fit;then setenv kernel ${fit};if run loadkernel; then bootm ${kaddr}${bootconf}; else reset; fi;fi;

2- Run your github action commands which will build uboot, change git branch and build atf (or pack uboot into atf??):

    sed -i 's/#\(board=bpi-r3\)/\1/' build.conf #change board to r3
    bash build.sh importconfig
    bash build.sh build
    bash build.sh rename
    git stash #stash build.conf

    git checkout mtk-atf
    echo -e "board=bpi-r3\ndevice=sdmmc" > build.conf
    bash build.sh build
    bash build.sh rename
    bash build.sh createimg non-interactive
    rm build.conf

OR do i need to run the entire action. So everything under

- name: Build for BananaPi-R3
        run: |

After this, i will get files to replace directly (copy paste) into the SD card that holds your Debian 11 img with custom kernel?

@ericwoud That is an option when compiling u-boot? I did not compile u-boot yet. will try now to implant that reset instruction

Mmc is both sd or emmc :slight_smile: both are handled via the mmc-controller (only one can be used at one time…currently sd)

Basicly you have to (first uboot,then atf)

  • change build.conf (like you did for kernel)
  • run build.sh importconfig
  • run build.sh (building uboot)
  • switch branch to mtk-atf which will require stash or checkout build.conf
  • change build.conf again to right device
  • build atf with u-boot.bin for the right device (sd is default)
  • run build.sh install to flash atf/uboot to your card
  • rename is optional,i do this to not override files with later compilations (ci do all bootdevices for r3…thats why there are same steps 4 times…only changing config different)

Ah ok. So emmc boot will not do any change i guess.

So that is basically executing this (your) commands, after cloning your repo and checkout to 2023-01-bpi right?:

    sed -i 's/#\(board=bpi-r3\)/\1/' build.conf #change board to r3
    bash build.sh importconfig
    bash build.sh build
    bash build.sh rename
    git stash #stash build.conf

    git checkout mtk-atf
    echo -e "board=bpi-r3\ndevice=sdmmc" > build.conf
    bash build.sh build
    bash build.sh rename
    bash build.sh createimg non-interactive
    rm build.conf

Then, to copy to SD card:

build.sh install

Since bootloader uses different partition, (partition 1, i guess), i can insert SD card with my already customized img and swap bootloader with this previous command, right?