Adding OpenWrt support for Xiaomi AX3600 (Part 1)

OpenWrt actually updates Hostapd semi-regularly, as hostapd releases are so far apart that hashes are used instead.
Even when it's not updated backport patches are used.

Ok, that could easily be some kind of failsafe behaviour, who can tell with so many wpa_supplicant variants

True, you're right.
If you need anymore help with any of this just say so, I'm always watching the forum.

Yeah, I have no idea what to tell you, it's driving me crazy trying to figure out what's wrong...

About the failsafe feature, I believe I have found the issue, I believe it's because, when failsafe is triggered only stuff in the preinit folder run, and I believe the ethernet driver isn't being started when this happens, could that be it? And what can be added to the preinit folder to fix this?
This is an example, but I need to know what's the basic setup that needs to be done so that networking can be configured.

Do you have any idea?

1 Like

Are you guys sure that SSDK and the rest of QCA soup gets loaded when failsafe is triggered?
That seems like the most likely reason why it wouldn't work, as well as ifname not being set

I believe they aren't, that isn't standard failsafe initialization, OpenWrt expects the kernel to have all the required drivers, as modules shouldn't be loaded for obvious reasons.
Now, I can create a preinit file that can runs only in case the preinit was triggered and load the required stuff for networking, but I need to know what that is and how to load it ie. What commands to run inside the script. Is it just an insmod for the nss-dp and ssdk?

Just modprobe the qca-nss-dp it will load ssdk as dependency

1 Like

You quoted this some time ago in other thread (Roaming Issues Xiaomi AX3600 - #83 by psi-c) relating the FBD problem, maybe helps:

It pretty much sums up the issue, but their solution is to use one more NSS module which requires even more kernel modifications to solve it.

This is an issue when you are trying to pretend that the underlying switch doesn't exist, I am kind of tempted to see around hacking that without the bridge module.
There has got to be a way of registering to the notifications about new entry and just deleting the existing one

1 Like

I see, thanks!
I'll give it a try and report back as soon as I can.
One question, if I can't make a script that loads ONLY if the failsafe is triggered, is there an issue if I just load the modules in preinit?
I can do:

  1. Load module
  2. If the system isn't in failsafe unload the module
  3. Let the system proceed as usual (and load the module which is already loaded)

Is this a problem?

Since we are dealing with extremely fragile things they must be in order, that is why they are staged one after another.

So, if possible it would be best to not mess with loading anything unless failsafe is triggered

Got it!

I'll give it a try maybe tomorrow!

Awesome, nice to see community engagement

2 Likes

Well we have lift-off! I managed to get wired working in failsafe.

set_preinit_net_module() {

	# Load the required networking modules for failsafe
	/sbin/modprobe /lib/modules/*/qca-nss-dp.ko
}

boot_hook_add failsafe set_preinit_net_module

This works in failsafe and doesn't break regurlar boot (from what I can tell it really only runs in failsafe.
Would you like me to do a pull request to your branch?

The thing is, it only works on the first lan port, in this case, lan1 or eth1, is that ok?

1 Like

You don't need:
/sbin/modprobe /lib/modules/*/qca-nss-dp.ko

modprobe qca-nss-dp should work just fine.

This is what worked for me this morning:

. /lib/functions.sh

load_networking_drivers() {
	modprobe qca-nss-dp
}

boot_hook_add failsafe load_networking_drivers

Failsafe interface can be set per device like IPQ40xx does it

From my testing we do, in the boot log errors get thrown out in the log if modprobe qca-nss-dp is used though I didn't try modprobe /lib/modules/*/qca-nss-dp.ko only /sbin/modprobe qca-nss-dp

Do we need to set a interface? by default it gets the first lan interface from the board.json, this should work for all devices

EDIT: I don't know how you managed to do it, it didn't work for me :sweat_smile:

I can confirm no leaking memory. After 24 hours I have more than 120 MB free memory. Awesome!

1d 6h here, no memory leaks, I didn't see ram below 115MB

Could you share a compiled ssdk_sh binary, please?

Sure, let's do this in PM, to not create offtopic.

Could you send me binary too? Thanks

Returned to latest release of robimarko's firmware, and discovered old annoying problems: some l2 roaming issue: no connectivity for few minutes after switching cable > wifi, and iphone problem, mentioned here earlier: unstable connectivity / disconnects wifi, while radio signal is full.

Are improvements expected in this place?