Banana Pi BPI-R3 OpenWRT image

@dangowrt

I was running openwrt from sdcard using autopart and it works fine. Than I started to use eMMC and uvol can´t create a volume. Looks like it´s trying to create the volume on NAND. Is it possible to target mmcblk0 instead of mtdblock0 on uvol ?

# uvol create storage 3000000000 rw
ubimkvol: error!: UBI device does not have free logical eraseblocks

# uvol total
124436480

# lsblk
NAME            MAJ:MIN RM   SIZE RO TYPE MOUNTPOINTS
mtdblock0        31:0    0 122.5M  0 disk
mtdblock1        31:1    0     2M  1 disk
mtdblock2        31:2    0     3M  0 disk
mtdblock3        31:3    0   512K  1 disk
mmcblk0         179:0    0   7.3G  0 disk
|-mmcblk0p1     179:1    0     4M  0 part
|-mmcblk0p2     179:2    0   512K  0 part
|-mmcblk0p3     179:3    0     2M  0 part
|-mmcblk0p4     179:4    0     4M  0 part
|-mmcblk0p5     179:5    0    32M  0 part
|-mmcblk0p6     179:6    0    20M  0 part
|-mmcblk0p7     179:7    0   104M  0 part
|-mmcblk0p65    259:0    0  33.4M  1 part /rom
`-mmcblk0p66    259:1    0  65.4M  0 part /overlay
mmcblk0boot0    179:8    0     4M  1 disk
mmcblk0boot1    179:16   0     4M  1 disk
ubiblock0_2     254:0    0  10.3M  0 disk
`-ubiblock0_2p1 259:2    0     5M  1 part

Strange, it looks like autopart didn’t create the partition for the LVM2 physical volume. Maybe this was due to

Can you try with a more recent snapshot which includes this change (ie. version of uvol and autopart should be 0.9)? If that doesn’t help, I would like to debug why autopart doesn’t work for you.

Once autopart succeeds uvol will then automatically use the LVM2 backend once it becomes available.

Already using a recent snapshot.

PKG_NAME:=uvol
PKG_VERSION:=0.9
PKG_RELEASE:=1

What I did:

dip switch to sdcard
boot from sdcard
fw_setenv bootcmd "run ubi_init ; env default bootcmd ; saveenv ; reset"
reboot

dip switch to nand
fw_setenv bootcmd "run emmc_init ; env default bootcmd ; saveenv ; saveenv ; reset"
reboot

dip switch to emmc

# uvol create storage 3000000000 rw
ubimkvol: error!: UBI device does not have free logical eraseblocks

# uvol total
124436480

There is something I should look for in dmesg or logread ?

… and autopart is installed there as well, I assume, right?

Yes, please share logread of first boot, we’ll see if autopart actually does anything.

yes, I’ve been using autopart before with this build…

Ok, if I revert back the “uvol: fix regression in handling fractional megabytes free” it works…

I think it’s calculating free space wrong

with this patch:
# uvol total
124436480

# uvol create storage 4000000000 rw
ubimkvol: error!: UBI device does not have free logical eraseblocks


autopart.defaults reverted back:
# uvol total
7751073792

# uvol create storage 4000000000 rw
  WARNING: Logical volume owrt-volumes-58c409036a6eed70/wp_storage not zeroed.

    F2FS-tools: mkfs.f2fs Ver: 1.15.0 (2022-05-13)

Info: Disable heap-based policy
Info: Debug level = 0
Info: Label = storage
Info: Trim is enabled
Info: Segments per section = 1
Info: Sections per zone = 1 ...

The free space reported in case of autopart failing is the free space on the NAND flash.

The cause of the problem was a missing quote in the recent patch of @pprindeville. I’ve now fixed it, see

Hi @ned14, can you tell me which Openwrt Image version you use to get your fibre SFP devices working? I’m currently using latest Openwrt Snapshot and I’m not able to get my Optical Transceiver Modules working.

for details you can check: https://forum.openwrt.org/t/sfp-on-banana-pi-bpi-r3-not-receiving-traffic-with-openwrt-snapshot-23-1-2023/149211/5

Probably something different but I’m not able to make working a simple H!Fiber 1Gbs rj45 sfp module.

All I obtain is these report log on eth1 (the same on Sfp2 cage):

root@OpenWrt:/# [  449.290202] sfp sfp1: module OEM              SFP-GE-T         rev      sn CSGExxxxxxx      dc 211028
[  449.357105] mtk_soc_eth 15100000.ethernet eth1: validation with support 0000000,00000000,00000000 failed: -22
[  449.367095] sfp sfp1: sfp_add_phy failed: -22

I do not fine any reference for error -22

Anyone have a simple 1Gbps RJ45 Sfp module working? It’s mine incompatible or broken?

It was the latest snapshot from https://downloads.openwrt.org/snapshots/targets/mediatek/filogic/ from about one week before I posted two weeks ago. So, whatever the snapshot was three weeks ago.

I can confirm that the fibre modules reported receiving packets, and moreover, the count of packets sent by one exactly equalled the count of packets received by the other.

Mine are < 1w modules with only a 2km range, so your issues could be simply due to insufficient power? I agree it seems weird yours can transmit and not receive if it were insufficient power. I hope you figure it out.

I first suspected the same thing, but I also got the message about not enough power on the Mikrotik, and it works there.

The message about too little power only occurs with 20km devices. The other 3 devices I tested are all 10km modules that didn’t have this message.

And the remote station next to me is only 1.5km away.

It’s all very strange.

Hi,

I think the Makefile of this device need some patching. Its not building Ext4 images, and the Rootfs partition size is not working.

https://forum.openwrt.org/t/bananapi-bpi-r3-there-is-a-way-to-use-ext4

Relatedly, besides this topic, is there anywhere that documents what the LEDs mean?

I typically get a red power LED followed by solid then blinking green as OpenWRT starts up, but this morning I was seeing the red power LED followed by solid blue and the green LED was off. The device responded to pings but it didn’t appear any of the services were started.

I haven’t looked at debug UART, but is there any obvious meaning to the blue LED during startup?

blue LED on startup means the device has started the recovery image. This happens (intentionally) in case there has been a kernel crash. Check /sys/fs/pstore for details.

No OpenWRT 22.x or 23.x release anytime soon?

What command does emmc use? Do I put the firmware files on a USB stick or upload them somewhere?

root@OpenWrt:/mnt/sda1# ls
System Volume Information                                         openwrt-mediatek-filogic-bananapi_bpi-r3-nor-preloader.bin
openwrt-mediatek-filogic-bananapi_bpi-r3-initramfs-recovery.itb   openwrt-mediatek-filogic-bananapi_bpi-r3-squashfs-sysupgrade.itb
openwrt-mediatek-filogic-bananapi_bpi-r3-nor-bl31-uboot.fip
root@OpenWrt:/mnt/sda1# modprobe mtd-rw i_want_a_brick=1
failed to find a module named mtd-rw
root@OpenWrt:/mnt/sda1# mtd write openwrt-mediatek-filogic-bananapi_bpi-r3-nor-preloader.bin bl2
Could not open mtd device: bl2
Can't open device for writing!
root@OpenWrt:/mnt/sda1#

Have you solved your problem?

opkg update
opkg install mmc-utils kmod-mtd-rw

Thank you for my firmware lack of many dependency packages, how to use the serial port to brush openwrt official firmware root@OpenWrt:~# opkg install mmc-utils kmod-mtd-rw Package mmc-utils (2019-10-10-73d6c59a-2) installed in root is up to date. Unknown package ‘kmod-mtd-rw’. Collected errors:

  • opkg_install_cmd: Cannot install package kmod-mtd-rw. root@OpenWrt:~#

As you have the serial port connected, why don’t you just use the bootloader menu to install to whatever bootmedia you like?

Edit: Now I understand :slight_smile: The version of mmc-utils was a clear hint that this is impossibly official OpenWrt you are currently running – it’s from 2019 and hence you must be running SinoVoip’s build of MediaTek SDK and not really OpenWrt.

To start using the real OpenWrt, please follow the instructions further up in this thread: Banana Pi BPI-R3 OpenWRT image

For the initial installation you will need a microSD card and use that microSD to boot the R3. As you have the serial port connected you can then use the bootloader menu to install OpenWrt to NAND or NOR, and when booting from NAND you can install to eMMC (you cannot install directly from microSD to eMMC as they cannot be accessed at the same time).