-
-
Notifications
You must be signed in to change notification settings - Fork 11k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
FS#1252 - No IP Assigned to Interface with QMI on Quectel EC-25A #6196
Comments
lynxis: can you try to do:
|
johnfzc: Here's the version information for the lede release I'm running.
|
johnfzc: It's raw_ip, here's the output:
|
lynxis: so you can not change it? |
johnfzc: Sorry, I misread the commands, I've tried the set but it doesn't take:
|
johnfzc: My issue came from the modem being configured to autoconnect. I was able to disable it with the following command (which isn't network specific, and will instead stop all automatic modem connections):
With this disabled the QMI protocol worked as expected and was able to drive the mobile connection. I wonder if there's a way to detect that the modem is configured to autoconnect and disable or warn when this happens. You can find more info on this command here: |
johnfzc: My problems were caused by two different issues. My modem does not work if it's not set in raw-ip mode. Additionally, if the modem is not cleanly shut down (e.g. hard power off) when it's powered back on it will remain in autoconnect mode. This will prevent the connection from functioning properly. I've prepared a patch that you can find here: This patch addresses both issues, if the modem can't be set to 802.3 format then the interface will be adjusted to use raw-ip mode. It also integrates the --stop-network command required to disable autoconnect. |
lynxis: Hi, Best, |
xback: Hi, My patch got merged. [1] Please let me know asap. Thanks, Koen [1] https://git.openwrt.org/?p=openwrt/openwrt.git;a=commit;h=7488be701029a86259dcd297a3c665eb65bdac6e |
xback: Hi, I just tried on the latest master: ============================Fri Jan 19 09:33:07 2018 daemon.notice netifd: lte (2215): Stopping network lte Network Config: config interface 'lte' Firewall config: config zone Hardware used: |
yurtesen: This card works for me with latest code if I disable autoconnect with But, out of the box, it did not receive IP address in QMI mode and I spent hours trying to figure out why it didn't work. I think |
xback: The strange item is that the command you mention is already present in the script and is being invoked. I'll try to have a closer look later this week. Will keep you posted .. |
johnfzc: I noticed that the 0xffffffff was present in the script, however for me it was only effective with the decimal value. In my commit I left both in because I wasn't certain if the 0xffffffff value might work in specific cases. To test for this issue connect to the cellular network and then unplug your device from power. If you are able to reconnect once power is restored then the stop auto-connect is working properly. I had considered testing to see if the cellular network showed as connected before forcing the disconnect. I'll update my patch to remove the fixes included in Koen's and the 0xffffffff stop-network if it's not needed. |
xback: Can you do 1 more test please?
Maybe there is a bug in interpreting the 0xffffffff :) Thanks, Koen |
yurtesen: I think it is not an issue with 0x hex value. Because I can confirm that I see this command in several places in qmi.sh but could it be that they are not executed? I am a total noob at this but is it so that qmi.sh is executed by daemon? but /dev/cdc-wdm0 has owner/root read/write access only? crw------- 1 root root 180, 176 Jan 25 18:09 /dev/cdc-wdm0 Could that be the reason of not seeing the effect? |
xback: Hi, In qmi.sh, add the following line on line 2:
Then start a second terminal window, and execute:
When this is done, bringup the interface:
Here is the full log: And here are the uqmi commands filtered out:
In this example it works nicely .. but I see the potential issue in your case. |
yurtesen: @Koen Vandeputte , I thought it was working and I see the same log lines. But after I put a different card, it stopped working again. I don't actually know what is the problem right now. I will try to run some more tests and return back. Also, should script set interface name with _4 because I am having some problems with that. First LuCI doesn't show the IP and then other programs rely on IP being set on interface name fails. -> https://bugs.lede-project.org/index.php?do=details&task_id=1304 |
xback: Hi, I've just posted a patch series which fixes more qmi issues: [[http://patchwork.ozlabs.org/project/lede/list/?series=27352|External Link]] Attached the qmi script which contains these. Replace the current one, and make sure it's set executable:
|
yurtesen: It works everytime I start the router. Great work! Now the only problem is that the IP address does not appear in LuCI and for example DDNS client does not work unless I set the interface name_4 manually in the config (since it is impossible to select this from LuCI). Just a small nuisance... |
xback: Thank you for testing. I'll try to have a look at the remaining issues tomorrow .. (no promises) |
yurtesen: Noob question, how do I do the 'tested-by' thingy? |
yurtesen: @Koen Vandeputte I found some other problems now. My provider normally gives private IP but if I use APN "opengate" it gives me public IP. I found out that this does not work with I made a separate report for it: https://bugs.lede-project.org/index.php?do=details&task_id=1363 See:
|
xback: Hi, Is this with the latest master branch? Thanks, Koen |
yurtesen: Sorry I couldn't respond earlier. I just build the newest build with last commit from march 19 -> commit 8e1065d I can see your commits there in the log also. But the APN is NOT working. I needed to change
< ${autoconnect:+--autoconnect}) |
xback: Hi, Thanks for testing. I've also spend a few weeks testing this extensively and noticed following:
I'll cook up another QMI script and post it here for you to test. I'll try to do it this week. Koen |
xback: Hi, Can you test again using attached qmi script please? Thanks, Koen |
yurtesen: No, it does not work as it is. But it works if I remove
After reboot (fail, got generic IP):
If I remove
|
xback: Hi, Thanks again for testing. I'll try to check if something can be fixed at all within uqmi to use the proper APN. Koen |
yurtesen: Koen, if uqmi is broken, why can't we remove Because that is the change I made and device seem to connect at boot without intervention and get correct IP. I can re-test that but it has been working fine now for a while. |
xback: Hi Evren, An overview of my test setup for this: I have hardware mounted (LTE + WiFi) in the mast of multiple ships. I've tested your suggestion for a few weeks in the lab, and onboard these vessels in the field. A few weeks of testing both in the lab and in the field yielded following conclusions: *** Leaving out --autoconnect introduced issues when the vessels sail back in. They never re-connected. Initial dial-in works very good now.** *** Replacing --autoconnect with --set-autoconnect introduces the same issues**
Summarized:
Using this workaround solves an issue but introduces a more severe one. I hope this clarifies the situation a bit. Koen |
yurtesen: @Koen , unfortunately I do not have a way to block the signal to test re-connection. I am able to test initial connection. In my card, it works same as you described. Perhaps it is a bug in either ec25 or uqmi. Hopefully it would be fixed at some point. It would have been easier to test if I somebody who has another hardware which uses QMI could help testing. By the way, I had a problem after 36 days uptime that QMI would not respond at all anymore. It felt like it was crashed. I had to send So I found out that the sure way to fix the issue once for all was to not rely on so called autoconnect. Instead now I use a script to check internet connectivity and do a full reset upon failure. Actually I used to use this script with NCM connection and [[https://wiki.openwrt.org/doc/recipes/ethernetoverusb_ncm#troubleshooting|put it to OpenWRT wiki way back]], just had to modify it for purpose... In case it comes handy, my poor man's solution is here :)
|
xback: Hi Evren, Thanks for sharing. fyi, I'm also hoping to find some time to get a proper look at uqmi and hope the issue can be fixed there .. maybe within a few weeks .. Thanks, Koen |
yurtesen: @Koen found a better solution? I still think that since the modems seem to be unreliable, it is perhaps best to use an external script to determine interface status and restart accordingly. I actually found a new problem in my setup. I am using a SIM card which can receive voice calls. Every time I receive a voice call, the SIM reduces network to 3G. (since 4G can't do circuit switching) This is useless because I can't answer the call anyway :) I found out that I need to execute a command in the modem to disable CS mode. AT+QCFG="servicedomain",1,1 I am not sure which script to set this with. I put it in /etc/hotplug.d/iface and I run it when interface wwan goes up. It resets at every restart and I could not manage to get modem to store it permantenly :( |
xback: I currently have some time to take another look at uqmi and the apn issue. |
finas: man, can't believe how much time I spent dealing with this. |
finas: @evern, can you share your modified script to test connection and reconnect when connection is lost? |
Gektor: Seems to be that i have same issue with EG25 modem (same as EC25), internet did not works in LAN (DNS did not resolve and IPs can't ping), but in SSH command line of OpenWRT i can access internet (ping 8.8.8.8, even opkg update works and i can install all packages). Can't resolve this issue... update update2 root@OpenWrt:~# uqmi -d /dev/cdc-wdm0 --get-current-settings
DHCP lease can't update automatically by system, need to make "service network restart" to get "fresh" IP (10.81.148.43) from QMI/modem:
|
Frans: Dmitry |
yurtesen: @pedro the script I use is just above. Recently I added the following line only
Because my SIM card is clone of my normal card and when my phone rings the EC-25 switch to 3G and stay. With this line, it rejects all voice calls. I made copy of the qmi.sh script and well I am not updating the router! That is it, this issue is quite annoying. In addition I found out EC-25 just freezes when it is under load for half a minute every few minutes. I don't know if it effects you guys too. My AT+GMR command returns EC25EFAR02A08M4G I just ordered a ME909s-120 for hopefully replacing EC-25. I had much less problems when I used NCM earlier. It seems to work so much smoother! Update: While NCM works great with my USB stick. It has a small problem with ME909s-120 I just switched the card and perhaps it was for good to depart from EC-25. Now I used ME909s-120 for few days and no problems whatsoever. The best part is that I had problems with EC-25 when there was high bandwidth upload/download going on. With ME909s, no problems and it even feels faster. It is possible that EC-25 I had was working badly more than the visible problems. |
Frankedinven01: The problem with missing IP address for EC-25 Modems is also present for other QMI (Rmnet) raw-IP modems. This is the case for 18.06 as well as 19.07 versions of openwrt. It seems that although qmi.sh tries to set the correct mode (at least in 19.07.03) it either detects incorrectly or there is a permission or timing issue. If however you add the setting of the driver attribute during local startup (in rc.local) it will work: echo "Y" > /sys/class/net/$ifname/qmi/raw_ip (replace $ifname with the actual if name. Look it up on your router) This work around has been tested with MC7455, EM7455 (defaults to MBIM, you must set QMI mode by AT command), SIM7600E-H, SIM7612G and EC25-E with openwrt 17.06.03 on a ZBT-WE826 router. for 802.3 IP modems (eg. MC7304, SIM7100E) it seems to work, but you may add: echo "N" > /sys/class/net/$ifname/qmi/raw_ip Be aware that on some devices the SIM slot is not initialized on hotplug. You need to power off/on. |
bgiboudeau: I have exactly the same problem as @dmitry: IP refresh every 12 hours. Every 12 hours my ISP (Free_Mobile a French provider) change the IP of the interface and the DHCP-Client still get the old IP Address even if "uqmi -d /dev/cdc-wdm0 –get-current-settings" give me the new valid ip address. It's reproductible as every 12 hours the bug occur. Every 12 hours: I don't know if it's a bug in the firmware of the modem or a problem within OpenWRT. The script provided by @Frans is a workaround but fixing the issue would be way better. I can provide more details if needed and this problem happen with my two 4G routers one with EC-25 and another one with BroadMobi BM806. |
Joshun: I am having this issue too with Quectel EC20. Interestingly, in Quectel's official connection manager, they seem to periodically check if the QMI IP address has changed, and if so they reconnect: https://github.com/kmilo17pet/quectel-cm/blob/2c623ffc8a1a8a7054b695956eb343e37b04727b/main.c#L487 I wonder if this is to work around a bug in modem firmware, or perhaps a quirk with how IP addresses are allocated on certain mobile networks? |
johnfzc:
I'm attempting to use QMI on a GL.Inet MiFi equipped with a Quectel EC-25A cellular modem.
When I configure the interface using qmi I am able to connect to the cellular network at the radio layer, however my wwan0 interface is not assigned an IP address. Here's my configuration from /etc/config/network:
And some commands showing the device behaviour. You'll note that raw_ip needs to be set to Y. I've integrated this patch to have qmi.sh set the raw_ip mode when required.
If I manually use the uqmi command to connect to the cellular network I can then drive the wwan0 interface using dhcp successfully. Here's my /etc/config/network.
And the resulting successful network connection:
I believe that for some reason the dhcp client isn't being run on the wwan0 interface by qmi.sh once it's online but I'm not able to determine how this is supposed to work. I'm eager to address this issue and submit the resulting patches. Please let me know if you can help.
The text was updated successfully, but these errors were encountered: