Cudy P2 5G support

So do you have access to internet on it ? And does it still use rndis_host driver ?

It uses rndis_host, but I can't get internet on it even if the modem gets an IP and i can ping that address that was configured on modem's wan side.

Then, i don't know what's wrong. How is it possible that when someone uses vendor drivers it just works, and when you use OpenWRT drivers, it doesn't. I had this happen to me on several wwan modems and routers. But, i guess we need to keep working on it ...:neutral_face:

Update:

rndis_host is used whenever I do AT+QCFG="usbnet",1 or 3 or 5 which is not correct

modem can be pinged at 192.168.42.1 from any 192.168.42.x address regardless of AT+QCFG="nat" mode. It has three open tcp port: 9997, 10056 and 10057 but I tried connecting and sending text but got no response (the connection didn't close).

I even copied quectel-cm binary over to openwrt and ran it. The modem successfully connected and it detected usb0 as the lan interface, but it still doesn't get an address.

I can ping the "wan configured address" and even add a direct on-link route to it and it shows up in ip neigh :

192.168.42.1 dev usb0 lladdr f6:4e:e7:b0:60:ee ref 1 used 0/0/0 probes 1 REACHABLE
10.134.151.13 dev usb0 lladdr f6:4e:e7:b0:60:ee ref 1 used 0/0/0 probes 4 REACHABLE

I also ran tcpdump and I don't see any DHCP server responses coming back.

Do you have an idea how to enable debugging / adb / logging - quectel-qlog dectects /dev/ttyUSB0 as a debugging port but doesn't save any log files.

I can't seem to enable adb: AT+QCFG="usbcfg",0x2c7c,0x0800,1,1,1,1,1,1,0 returns an error.

Interestingly, when changing usbnet and resetting using AT+CFUN=1,1 when the device comes back, I don't see any change in lsusb -v.

For sprd_pcie, it looks like the driver doesn't receive "SMSG_TYPE_DONE" from the modem so it always returns EINVAL when trying to enable pcie0 interface. I'll investigate that further. Have you managed to build this driver with 6.12 kernel?

Yep, i have it on my router with kernel 6.12. I build a image with your version on 6.18, but it doesn't boot and i have kernel panic. I will send you sprd package that i'm using on 6.12. BTW, i don't think quectel-cm is used even on Cudy firmware. Yes, it's there, but it's not managing any connections. That's what SPRD PCIe driver is for.

Ok, I used your sprd_pcie 1.1.9 and updated it to compile on 6.18 and it now works (it worked on two boot attempts but not on five - it didn't open the control channels) but I'm not yet sure why - I'll try more tomorrow.

I have tested with debug mode and/or msix interrupts so I'm not sure which combination worked...

What I am sure is:

  • AT+QCFG="usbnet", "ethernet", "multiusbnet", "usbcfg" don't really change anything with the modem:
  • lsusb lists exactly the same endpoints regardless of the configuration
  • That probably means that usb0 (rndis_host) is not really useful unless we figure out how to make it actually apply the settings

Is it possible that Cudy has locked down these settings?

It's the same on my end. Modem works only in one mode and it won't change into another. I think it just doesn't have other modes. I mean, Quectel also customize these modems for manufacturers, so that may be the case here. BTW, can you send me the updated sprd package that you made for 6.18 after you test it ? I want to check it out on my end :slight_smile:

I have managed to get it working again, and this time with 5G NSA and N78 available (although it's not in a ideal location).

Good, it's working on mine with 6.18 kernel as well. BTW, how much free memory do you have ? I have right now 45-55 RAM free. On kernel 6.12 i have about 80-100, and i don't know why...

Currently it says "62.25 MB" available, but this is with initramfs that has a lot of packages (for debugging) installed, more memory will be free when it's installed to the flash.

Right now i have that on 6.12 as well. And i have my images flashed to nand already, it's working great. To get more free memory sometimes i have to flash a image 2 or 3 times, don't know why that's happening.