Supporting EAP225 v5

Somewhere I found a script to dump all partitions into tar file.
and for the other: I could successfully flash your Openwrt.
I have changed the default ip address to dhcp, because the device will act as access point, if sometimes the wifi will work...

Great. Did you only use the initramfs or did you also try sysupgrade? It should work with the latest commit but I only tested it on one device. Not sure if there are unknown side effects. Also there is currently no tested way back from OpenWrt after flashing it to ROM.

Is the LAN MAC address correct on your device using OpenWrt? It should be the same one which is printed on the back of the access point.

General information about the MACs on my access point: LAN and 2.4Ghz WiFi use the MAC printed on the back, 5 GHz is the one at the back + 1.

Sysupgrade worked like a charm. I have running r23609 ATM.

Mac address is the same as printed on the sticker.
IĀ“m trying to identify the needed files for wifi and transfer them into running openwrt using modprobe. I'm a man, I can only work on one problem, not several at the same time :-). With second cpu should deal other guys.
BTW: IĀ“m on vacation next 2 weeks w/o buildroot at hand.

1 Like

I fixed the LED configuration in the DTS, it's basically takeover from EAP225v4.
Now there is the default OpenWrt LED behavior (green blinking during startup, amber blinking during firmware upgrade, green active after boot).
GPIO 55 is green
GPIO 56 is amber/yellow

According to the original firmware there is also a port "poe_port1" on GPIO 57, probably not required on this device.

Short overview wat is working and what is not (yet) working.
Working:

  • LAN with original MAC address
  • Sysupgrade
  • LEDs

Not (yet) working:

  • Wireless
  • Flash OpenWrt from OEM image
  • Revert to OEM firmware
  • Second CPU (at least not yet tested by me)
  • Reset Button

Reset button is fixed now

Hey there!
I am also waiting for the v5 firmware to be released. I cannot help much, but I have the device and if there is anything to test just let me know.
Thank you for your work!

I can confirm using build 23729
i) reset button working
ii) led amber/green configurable (one at a time, tried green always off and amber with heart beat)

Nothing new at wifi site

root@EAP225V5:/# modprobe wifi_emi_loader
[  450.001871] wifi_emi_loader: module PLT section(s) missing
1 module could not be probed

Do you have more information regarding this module? What is it for? And what is a PLT section? Is it like the WiFi calibration data like on other devices? As far as I remember there is something which can be set up in the DTS.

Blockquote
Do you have more information regarding this module? What is it for? And what is a PLT section?

The files are extracted from original tp-link firmware

Got it, also saw that it is also included in the GPL package from TP-Link (eap_gpl_code/images/eap/mtk7629_eap245v4_eap225v5_common/rootfs/lib/modules/4.4.198/kernel)

There is also a mt_wifi.ko which seems to be the wifi driver.
PLT stands for Procedure Linkage Table. Is the kernel sarching for it when loading the module?
Maybe it's because of incompatible kernel versions? The latest version in the GPL code is 4.4.198 while (my) OpenWrt uses 5.15.125.

I have copied wifi_emi_loader.ko and mt_wifi.ko to /lib/modules. Both bring the same error message.
May be there are some firmware files missed.

I checked for strings in the binaries from the GPL code package, there is no such string. But I found it in the kernel sources (https://elixir.bootlin.com/linux/v5.15.125/source/arch/arm/kernel/module-plts.c, line 236), there is the error message you currently get.

From my point of view there are currently a few options to get Wifi working:

  • Wait until an open source driver is available (will take some time)
  • Implement a kernel module wrapper to use the existing kernel modules (never done this before and not sure if it's feasible and a good solution. This will probably never be a part of OpenWrt becauseo of the Open Source idea)
  • Implement it by reverse engineering the existing binaries (there I'm not sure if this will cause legal issues). The wifi_emi_loader seems not to be that complex (46 functions with overall about 5000 lines of code according to Ghidra). The wifi driver itself seems to be quite complex (5751 functions with overall about 200000 lines of code)

Update: Seems like there is at least source code for wifi-emi-loader available:

Update: Seems like there is at least source code for wifi-emi-loader available:

I found the same link. Because of tiny docs I have no glue, what to do with it.

I think it has to be compiled as kernel module within OpenWrt. Maybe therefore adaptions for the current kernel version are required. As far as I saw there is also a entry in the device tree required for the module.

I put the extracted files to https://github.com/RolandoMagico/wifi-emi-loader and created a branch for EAP225v5: https://github.com/RolandoMagico/wifi-emi-loader/tree/EAP225v5

There is also a howto for creating kernel modules: https://openwrt.org/docs/guide-developer/packages#creating_packages_for_kernel_modules

I added https://github.com/RolandoMagico/openwrt/blob/EAP225v5-wifi/package/kernel/wifi-emi-loader/Makefile to my repository, now the kernel module appears in make menuconfig under "Kernel Modules" -> "Wireless Drivers":
image

Next step is to get it downloaded and built...

At least somthing is happening during the build:

make[3]: Entering directory '/home/roland/EAP225v5/openwrt/package/kernel/wifi-emi-loader'
Makefile:29: *** DESCRIPTION:= is obsolete, use Package/PKG_NAME/description.  Stop.
make[3]: Leaving directory '/home/roland/EAP225v5/openwrt/package/kernel/wifi-emi-loader'
time: package/kernel/wifi-emi-loader/compile#0.47#0.03#0.50
    ERROR: package/kernel/wifi-emi-loader failed to build.
make[2]: *** [package/Makefile:120: package/kernel/wifi-emi-loader/compile] Error 1

As it currently breaks the build on the EAP225v5 branch, i created another one for this topic:

I have cloned your repo, switched the branch to eap225v5-wifi, but don't have the option kmod-wifi-emi-loader in kernel modules.
git is a mysterium for me :slight_smile:

Strange, it's working here with a fresh clone:

git clone https://github.com/RolandoMagico/openwrt.git -b EAP225v5-wifi
cd openwrt
make menuconfig

The module can be selected in Kernel Modules -> Wireless drivers. Not sure as it is the correct location but this can be changend easily later.

I fixed the problem DESCRIPTION:= is obsolete, use Package/PKG_NAME/description. Stop.

Now, the makefiles must be adapted to work with OpenWrt. Shortcut for building only the kernel module:
make package/kernel/wifi-emi-loader/compile V=s

Currently it complains about missing targets:

make[3]: Entering directory '/home/roland/EAP225v5/openwrt-wifi/build_dir/target-arm_cortex-a7_musl_eabi/linux-mediatek_mt7629/wifi-emi-loader-0.0.1'
make[3]: *** No targets.  Stop.