BPI-R4 using OpenWRT mainline image TX Power low-problem solution

When using the OpenWRT mainline image with BPI-R4+BE14, the 2.4G/5G TX power was found to be low, only 6dBm and 7dBm respectively. The following is the solution:

  1. Prepare a Linux host.
  2. Download the source code for the corresponding mainline branch.
  3. Place the patch file in the package/kernel/mt76/patches/ directory.
  4. Execute the following command:
make clean
make
  1. Burn the compiled image to SD/NAND/eMMC and boot.
  2. Update and install the web page.
opkg update
opkg install luci

/etc/init.d/uhttpd enable
/etc/init.d/uhttpd start
  1. Go to the web page and turn on WiFi. Then use the iw dev command to see that the WiFi speed is now 20dBm.

bpi-r4_iw_dev_check_tx_power.png

2 Likes

thanks, i also apply it to my repo

is this patch sent to upstream mt76 mailinglist?

There very long threads about this in OpenWRT GH org

There were som discussions about submitting a patch upstream and Felix Fietkau which is one of the Mediatek wireless drives also briefly replied in the thread https://github.com/openwrt/openwrt/pull/19503#issuecomment-3292133645 IMHO this will be a hard patch to send to the kernel itself, seems a bit hacky for an hardware / very specific issue, maybe Openwrt will eventually get some patch in.

@frank-w I believe you are a kernel or Debian contributor, do you think is still acceptable to use an MTD partition, I have a proof of concept in one of that GH issues but never found time to wrap that up for a potential PR

I use debian with self built kernel with some collected and own patches and then share this…some patches are upstreamed by me too.

For what do you want to use mtd? For the eeprom data? I don’t think this will be accepted as there are many other ways (passing via dts,file in rootfs,…). I think patch above could be upstreamed,but i’m no maintainer.

1 Like

The only reason why I looked at MTD is because openers still uses it. I’m just a holiest and not sure what is the best way tbh, not an use fan of backing the eprom in the DTS or overlay and not sure what you mean by file in rootfs, is that supported already? I looked at the driver and seems to support only 3 options: dts, mtd and nvmem.

Thought openwrt does support that already,but afair i had added this feature some time ago by myself

1 Like

Any chance you can submit that upstream :pray: ?

I didn’t know that would be a good option, to read from the filesystem.

you still need a valid eeprom file to load…is there any?

iirc i already tried that but it was rejected long time ago

The eeprom baked in the board seems to be faulty, and this is an issue for a lot of people, and so far there is no other way around it. To the best of my knowledge he eeprom’s provided in the official repo work fine openwrt/feeds/mtk-openwrt-feeds - Gitiles

We inquired with them, but it seems there are no plans to add this patch to the MT76 mainline.

The eeprom in that repo doesn’t work either (in my experience). I was only able to solve by doing a different, but similarly hacky patch that won’t get accepted.

Just to clarify one thing, you need the patch to use the eeprom from the filesystem, otherwise it will use the one in the board. The patch proves that it works with that eeprom,

Isn’t it possible to reprogram the eeprom, or to solder a new eeprom chip with correct power values? Looks like it would be easier and faster way than bringing that patch to the kernel mainline