My LTE USB modem works correctly when hot-plugged after the system is fully booted.
But if the modem is already connected during reboot or cold boot, it is not detected properly — it goes into Qualcomm QHSUSB__BULK / EDL mode instead of switching to RNDIS/ECM/QMI.
Hardware:
Raspberry Pi Zero 2 W
LTE USB modem (Qualcomm-based)
OS:
chirpstack gateway os 4.8.3(custom build by enabling usb drivers)
What I already tried:
/etc/rc.local
sleep 10
logger "Restarting USB host to re-enumerate LTE modem..."
rmmod dwc2
sleep 2
modprobe dwc2
sleep 5
/usr/sbin/usbmode -s
/sbin/hotplug-call usb
But the modem remains in bulk mode after reboot.
Hotplug detection = OK
If I unplug + plug the modem → it immediately registers and works
Boot detection = FAIL
If the modem is connected before powering ON → not detected correctly
It appears you are using firmware that is not from the official OpenWrt project.
When using forks/offshoots/vendor-specific builds that are "based on OpenWrt", there may be many differences compared to the official versions (hosted by OpenWrt.org). Some of these customizations may fundamentally change the way that OpenWrt works. You might need help from people with specific/specialized knowledge about the firmware you are using, so it is possible that advice you get here may not be useful.
Ask for help from the maintainer(s) or user community of the specific firmware that you are using.
Provide the source code for the firmware so that users on this forum can understand how your firmware works (OpenWrt forum users are volunteers, so somebody might look at the code if they have time and are interested in your issue).
If you believe that this specific issue is common to generic/official OpenWrt and/or the maintainers of your build have indicated as such, please feel free to clarify.