Modify

Opened 4 years ago

Closed 3 years ago

#16724 closed defect (no_response)

qmi: Unable to connect, check APN and authentication

Reported by: dantonov@… Owned by: developers
Priority: normal Milestone: Chaos Calmer 15.05
Component: packages Version: Trunk
Keywords: proto, qmi Cc: malaakso@…

Description

But my E392 has "connected".

root@OpenWrt:~# uqmi -s -d /dev/cdc-wdm0 --get-data-status
Failed to open device
root@OpenWrt:~# ifup wan
root@OpenWrt:~# logread | tail
Sat Jun  7 12:28:05 2014 kern.info kernel: [ 4320.070000] usb 1-1: new high-speed USB device number 6 using ehci-platform
Sat Jun  7 12:28:05 2014 kern.info kernel: [ 4320.230000] qmi_wwan 1-1:1.1: cdc-wdm0: USB WDM device
Sat Jun  7 12:28:05 2014 kern.info kernel: [ 4320.240000] qmi_wwan 1-1:1.1 wwan0: register 'qmi_wwan' at usb-ehci-platform-1, WWAN/QMI device, 00:a0:c6:00:00:00
Sat Jun  7 12:28:05 2014 daemon.notice netifd: Interface 'wan' is enabled
Sat Jun  7 12:28:05 2014 daemon.notice netifd: Network device 'wwan0' link is up
Sat Jun  7 12:28:05 2014 daemon.notice netifd: Interface 'wan' has link connectivity
Sat Jun  7 12:28:05 2014 daemon.notice netifd: Interface 'wan' is setting up now
Sat Jun  7 12:28:08 2014 daemon.info qmi[2110]: Waiting for network registration
Sat Jun  7 12:28:13 2014 daemon.info qmi[2110]: Starting network internet.beeline.ru
Sat Jun  7 12:28:13 2014 daemon.err qmi[2110]: Unable to connect, check APN and authentication
root@OpenWrt:~# uqmi -s -d /dev/cdc-wdm0 --get-data-status
"connected"
root@OpenWrt:

Attachments (1)

network (645 bytes) - added by dantonov@… 4 years ago.
/etc/config/network

Download all attachments as: .zip

Change History (13)

Changed 4 years ago by dantonov@…

/etc/config/network

comment:1 Changed 4 years ago by dantonov@…

If I add 2 lines:

lasterr=$?
logger -p daemon.err -t "qmi[$$]" "DEBUG: pdh=\""$pdh"\" \$\?=\""$lasterr"\""

on 80th line of /lib/netifd/proto/qmi.sh I can get connection to internet with some more info and unknown dhcpc's errors in log:

Sat Jun  7 13:03:10 2014 daemon.info qmi[1377]: Starting network internet.beeline.ru
Sat Jun  7 13:03:10 2014 daemon.err qmi[1377]: DEBUG: pdh=""No effect"" $\?="255"
Sat Jun  7 13:03:10 2014 daemon.info qmi[1377]: Connected, starting DHCP
Sat Jun  7 13:03:10 2014 daemon.notice netifd: Interface 'wan' is now up
Sat Jun  7 13:03:10 2014 daemon.notice netifd: Network alias 'wwan0' link is up
Sat Jun  7 13:03:10 2014 daemon.notice netifd: Interface 'wan_dhcp' is enabled
Sat Jun  7 13:03:10 2014 daemon.notice netifd: Interface 'wan_dhcp' has link connectivity
Sat Jun  7 13:03:10 2014 daemon.notice netifd: Interface 'wan_dhcp' is setting up now
Sat Jun  7 13:03:10 2014 daemon.notice netifd: wan (1377): Command failed: Unknown error
Sat Jun  7 13:03:10 2014 daemon.notice netifd: Interface 'wan_dhcpv6' is enabled
Sat Jun  7 13:03:10 2014 daemon.notice netifd: Interface 'wan_dhcpv6' has link connectivity
Sat Jun  7 13:03:10 2014 daemon.notice netifd: Interface 'wan_dhcpv6' is setting up now
Sat Jun  7 13:03:10 2014 daemon.notice netifd: wan (1377): Command failed: Unknown error
Sat Jun  7 13:03:11 2014 daemon.notice netifd: wan_dhcp (1428): udhcpc (v1.22.1) started
Sat Jun  7 13:03:11 2014 daemon.notice odhcp6c[1435]: (re)starting transaction on wwan0
Sat Jun  7 13:03:11 2014 daemon.notice odhcp6c[1435]: Starting SOLICIT transaction (timeout 4294967295s, max rc 0)
Sat Jun  7 13:03:11 2014 user.notice firewall: Reloading firewall due to ifup of wan (wwan0)
Sat Jun  7 13:03:11 2014 daemon.notice netifd: wan_dhcp (1428): Sending discover...
Sat Jun  7 13:03:11 2014 daemon.notice netifd: wan_dhcp (1428): Sending select for 10.221.130.45...
Sat Jun  7 13:03:11 2014 daemon.notice netifd: wan_dhcp (1428): Lease of 10.221.130.45 obtained, lease time 7200
Sat Jun  7 13:03:11 2014 daemon.notice netifd: Interface 'wan_dhcp' is now up
Sat Jun  7 13:03:41 2014 daemon.info dnsmasq[1031]: reading /tmp/resolv.conf.auto
Sat Jun  7 13:03:41 2014 daemon.info dnsmasq[1031]: using local addresses only for domain lan
Sat Jun  7 13:03:41 2014 daemon.info dnsmasq[1031]: using nameserver 217.118.66.243#53
Sat Jun  7 13:03:41 2014 daemon.info dnsmasq[1031]: using nameserver 217.118.66.244#53

comment:2 follow-up: Changed 4 years ago by malaakso@…

You have most likely autoconnect enabled. In this case you can't use qmi as protocol, but dhcp with ifname wwan0 (in this case you can't set operating modes etc.).

To disable autoconnect, use

uqmi -d /dev/cdc-wdm0 --stop-network 4294967295 --autoconnect

Then you can use qmi as protocol.

comment:3 Changed 4 years ago by anonymous

that is the problem, i told nbd, that qmi/ncm devices not using ttyUSB at all, it uses /dev/cdc-wdmX ;-) - so this device names needs to be added to the 3g-list


comment:4 Changed 4 years ago by malaakso@…

The trigger should be the appearance of wwanX, and I think this is already correctly handled.

comment:5 follow-up: Changed 4 years ago by dantonov@…

Is there a way to know the PDH which I don't know?

I think I did "uqmi -d /dev/cdc-wdm0 --start-network ... --autoconnect" before automated way.
My bad... but after that I did more and more reboot and modem's plugin/out.

What is a magic command "uqmi -d /dev/cdc-wdm0 --stop-network 4294967295 --autoconnect"?
It works! Is "4294967295" a magic constant?

comment:6 in reply to: ↑ 2 Changed 4 years ago by raver@…

Replying to malaakso@…:

You have most likely autoconnect enabled. In this case you can't use qmi as protocol, but dhcp with ifname wwan0 (in this case you can't set operating modes etc.).

To disable autoconnect, use

uqmi -d /dev/cdc-wdm0 --stop-network 4294967295 --autoconnect

Then you can use qmi as protocol.

Hi,
Thank you for the tip!
I had the same problem and it did the trick.

comment:7 in reply to: ↑ 5 Changed 4 years ago by malaakso

Replying to dantonov@…:

Is there a way to know the PDH which I don't know?

I think I did "uqmi -d /dev/cdc-wdm0 --start-network ... --autoconnect" before automated way.
My bad... but after that I did more and more reboot and modem's plugin/out.

What is a magic command "uqmi -d /dev/cdc-wdm0 --stop-network 4294967295 --autoconnect"?
It works! Is "4294967295" a magic constant?

That's just 0xFFFFFFFF in decimal, so-called global PDH. I should document it somewhere, or better yet, make uqmi use it automatically with stop-network and autoconnect. Autoconnect seems to be stored in NVRAM, so it stays enabled even if modem is unplugged.

comment:8 Changed 4 years ago by dantonov@…

I knew it's magic number! ;)
Thank you very much.
It has been documented here now.
uqmi's option would be the great.

I think this defect should be closed now I don't know how.

comment:9 Changed 3 years ago by anonymous

I've stumbled over "Failed to open device", too. However it now works for me now even with autoconnect. According to memory I've released the client-id (uqmi -d /dev/cdc-wdm0 --release-client-id wds --set-client-id wds,87) and that made it work, if I remember correctly.

However I'm now having a hard time "properly" shutting down a network connection (without pdh). As I understand the global PDH should help me out (as in "uqmi -d /dev/cdc-wdm0 --stop-network 4294967295 --autoconnect"). "uqmi -d /dev/cdc-wdm0 --stop-network 4294967295 --autoconnect" doesn't give any output, but the connection is still active. "uqmi -d /dev/cdc-wdm0 --stop-network 4294967295" yields "Invalid handle".

So it seems without "proper" pdh QMI is not allowing shutting down the network ever.

I've resorted to "rfkill block wwan; rfkill unblock wwan" - not pretty but at least works.

Btw: Is there somewhere documentation (like with state-diagrams) about QMI to get a better understanding what needs (and can) be called when and having which effect?

comment:10 Changed 3 years ago by malaakso@…

Using

uqmi -d /dev/cdc-wdm0 --stop-network 4294967295 --autoconnect

should work, but you could also try

uqmi -d /dev/cdc-wdm0 --set-client-id wds,87 --set-autoconnect disabled

comment:11 Changed 3 years ago by nbd

do the scripts currently not handle disconnecting properly? last time i tested it, it worked.

comment:12 Changed 3 years ago by nbd

  • Resolution set to no_response
  • Status changed from new to closed

Add Comment

Modify Ticket

Action
as closed .
The resolution will be deleted. Next status will be 'reopened'.
Author


E-mail address and user name can be saved in the Preferences.

 
Note: See TracTickets for help on using tickets.