Modify

Opened 6 years ago

Closed 5 years ago

Last modified 4 years ago

#11567 closed defect (fixed)

[trunk 31870][ar71xx] 3g-wan won't connect again if a usb modem is reconnected physically

Reported by: flux242@… Owned by: developers
Priority: normal Milestone: Barrier Breaker 14.07
Component: packages Version: Trunk
Keywords: Cc:

Description

Happens also without physical reconnection of the 3g usb modem (I've got Huawei 220). After this message in the syslog

Jun  1 11:00:09 Buffalo kern.err kernel: [15788.440000] option: option_instat_callback: error -143

there is no way to reconnect the modem, ifup simply won't work and the option driver provides no more useful output. The only option that works is to REBOOT the router which sucks

I've tried to

  • rmmod option;insmod option - won't help
  • unbind; rebind usb device - won't help

Attachments (0)

Change History (18)

comment:1 Changed 6 years ago by flux242@…

I've updated my trunk to r32018. As far as there were 3g modem related changes I'll try to reproduce my problem and will update this ticket with results. Thanks

comment:2 Changed 6 years ago by flux242@…

OK, the same problem with the r32018. Some problems with the option driver maybe?

comment:3 Changed 6 years ago by flux242@…

I've found that 'device' option is not loaded by uci for some weired reason. All other options from network.wan section are loaded but not 'device'! So the workaround atm is to change one line in the /etc/hotplug.d/tty/30-3g:
Instead of
config_get dev "$cfg" device
I put that
config_get dev "$cfg" device /dev/ttyUSB0

After calling config_load network in the /etc/hotplug.d/tty/30-3g I dumped all variables set and indeed uci failed to load 'device' option:

CONFIG_wan_TYPE='interface'
CONFIG_wan__orig_bridge='false'
CONFIG_wan__orig_ifname='eth1'
CONFIG_wan_apn='myapn'
CONFIG_wan_auto='0'
CONFIG_wan_connect_time='299'
CONFIG_wan_ifname='3g-wan'
CONFIG_wan_password='umts'
CONFIG_wan_pincode='0000'
CONFIG_wan_proto='3g'
CONFIG_wan_service='umts'
CONFIG_wan_up='1'
CONFIG_wan_username='umts'

This is part of my /etc/config/network

config interface 'wan'
	option _orig_ifname 'eth1'
	option _orig_bridge 'false'
	option proto '3g'
	option device '/dev/ttyUSB0'
	option service 'umts'
	option apn 'myapn'
	option pincode '0000'
	option username 'umts'
	option password 'umts'
	option auto '0'

comment:4 Changed 6 years ago by flux242@…

uci shows this option properly

root@Buffalo:~# uci show | grep wan
network.wan=interface
network.wan._orig_ifname=eth1
network.wan._orig_bridge=false
network.wan.proto=3g
network.wan.device=/dev/ttyUSB0
network.wan.service=umts
network.wan.apn=myapn
network.wan.pincode=0000
network.wan.username=umts
network.wan.password=umts
network.wan.auto=0

most probably loading script fails to parse slashes?

comment:5 follow-up: Changed 6 years ago by flux242@…

I'm just curious if you would react now when a patch is available, huh?

--- /lib/network/config.sh	2012-06-03 15:05:45.000000000 +0200
+++ /lib/network/config.sh.new	2012-06-03 15:06:27.659999800 +0200
@@ -36,7 +36,7 @@
 
 fixup_interface() {
 	local config="$1"
-	local ifname type
+	local ifname type device
 
 	config_get type "$config" type
 	config_get ifname "$config" ifname

comment:6 in reply to: ↑ 5 ; follow-up: Changed 6 years ago by hnyman <hannu.nyman@…>

Replying to flux242@…:

The proposed patch looks like a similar change that was done with r31430. Did you find out in which function the clashing variable 'device' was located?

comment:7 in reply to: ↑ 6 Changed 6 years ago by flux242@…

Replying to hnyman <hannu.nyman@…>:

Replying to flux242@…:

The proposed patch looks like a similar change that was done with r31430. Did you find out in which function the clashing variable 'device' was located?

common, just grep in the /lib you'll find several places. And not only device variable - there are many other variables that miss local keyword which potentially could lead to the problem described

comment:8 Changed 6 years ago by jow

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

Fixed in r32192

comment:9 Changed 5 years ago by Maverick

  • Resolution fixed deleted
  • Status changed from closed to reopened

same problem in trunk r33212 TL-MR3420
I've found that 'device' option Erased from uci,after successful connection pppd and remoove 3g dongle from USB (config_get dev "$cfg" device = "").but if the connection pppd was not successful(no SIM card in dongle) config_get dev "$cfg" device = "/dev/ttyUSB0"

comment:10 Changed 5 years ago by jow

  • Resolution set to invalid
  • Status changed from reopened to closed

Definitely not the same problem.

comment:11 Changed 5 years ago by mstm <mstm@…>

  • Resolution invalid deleted
  • Status changed from closed to reopened

Today I update my mr3420 to r33349 and now I have the same problem with 3 dongles (e353, e270 and k4505-z)

Sep  9 19:21:27 OpenWrt kern.info kernel: [ 1696.170000] usb 1-1: USB disconnect, device number 7
Sep  9 19:21:27 OpenWrt kern.err kernel: [ 1696.180000] option: option_instat_callback: error -143
Sep  9 19:21:27 OpenWrt kern.info kernel: [ 1696.180000] option1 ttyUSB0: GSM modem (1-port) converter now disconnected from ttyUSB0
Sep  9 19:21:27 OpenWrt kern.info kernel: [ 1696.190000] option 1-1:1.0: device disconnected
Sep  9 19:21:27 OpenWrt kern.info kernel: [ 1696.200000] option1 ttyUSB1: GSM modem (1-port) converter now disconnected from ttyUSB1
Sep  9 19:21:27 OpenWrt kern.info kernel: [ 1696.200000] option 1-1:1.1: device disconnected
Sep  9 19:21:27 OpenWrt kern.info kernel: [ 1696.210000] option1 ttyUSB2: GSM modem (1-port) converter now disconnected from ttyUSB2
Sep  9 19:21:27 OpenWrt kern.info kernel: [ 1696.220000] option 1-1:1.2: device disconnected
Sep  9 19:22:02 OpenWrt kern.info kernel: [ 1731.140000] usb 1-1: new high-speed USB device number 8 using ehci-platform
Sep  9 19:22:02 OpenWrt kern.info kernel: [ 1731.290000] scsi10 : usb-storage 1-1:1.0
Sep  9 19:22:02 OpenWrt kern.info kernel: [ 1731.310000] scsi11 : usb-storage 1-1:1.1
Sep  9 19:22:03 OpenWrt user.notice usb-modeswitch: 1-1:1.0: Manufacturer=HUAWEI Product=HUAWEI_Mobile Serial=?
Sep  9 19:22:03 OpenWrt user.notice usb-modeswitch: 1-1:1.0: Selecting /etc/usb_modeswitch.d/12d1:14fe for mode switching
Sep  9 19:22:03 OpenWrt syslog.notice usb_modeswitch: switching device 12d1:14fe on 001/008
Sep  9 19:22:03 OpenWrt kern.info kernel: [ 1731.500000] usb 1-1: USB disconnect, device number 8
Sep  9 19:22:21 OpenWrt kern.info kernel: [ 1749.720000] usb 1-1: new high-speed USB device number 9 using ehci-platform
Sep  9 19:22:21 OpenWrt kern.info kernel: [ 1749.870000] option 1-1:1.0: GSM modem (1-port) converter detected
Sep  9 19:22:21 OpenWrt kern.info kernel: [ 1749.880000] usb 1-1: GSM modem (1-port) converter now attached to ttyUSB0
Sep  9 19:22:21 OpenWrt kern.info kernel: [ 1749.880000] option 1-1:1.1: GSM modem (1-port) converter detected
Sep  9 19:22:21 OpenWrt kern.info kernel: [ 1749.890000] usb 1-1: GSM modem (1-port) converter now attached to ttyUSB1
Sep  9 19:22:21 OpenWrt kern.info kernel: [ 1749.900000] option 1-1:1.2: GSM modem (1-port) converter detected
Sep  9 19:22:21 OpenWrt kern.info kernel: [ 1749.900000] usb 1-1: GSM modem (1-port) converter now attached to ttyUSB2
Sep  9 19:22:21 OpenWrt kern.info kernel: [ 1749.910000] scsi12 : usb-storage 1-1:1.4
Sep  9 19:22:21 OpenWrt kern.info kernel: [ 1749.920000] scsi13 : usb-storage 1-1:1.5
Sep  9 19:22:22 OpenWrt kern.notice kernel: [ 1750.920000] scsi 12:0:0:0: CD-ROM            HUAWEI   Mass Storage     2.31 PQ: 0 ANSI: 2
Sep  9 19:22:22 OpenWrt kern.notice kernel: [ 1750.930000] scsi 13:0:0:0: Direct-Access     HUAWEI   SD Storage       2.31 PQ: 0 ANSI: 2
Sep  9 19:22:22 OpenWrt kern.notice kernel: [ 1750.940000] sd 13:0:0:0: [sda] Attached SCSI removable disk
Sep  9 19:22:36 OpenWrt user.notice usb-modeswitch: 1-1:1.1: Manufacturer=HUAWEI Product=HUAWEI_Mobile Serial=?
Sep  9 19:22:37 OpenWrt user.notice usb-modeswitch: 1-1:1.0: Manufacturer=HUAWEI Product=HUAWEI_Mobile Serial=?
Sep  9 19:22:37 OpenWrt user.notice usb-modeswitch: 1-1:1.1: Manufacturer=HUAWEI Product=HUAWEI_Mobile Serial=?
Sep  9 19:22:37 OpenWrt user.notice usb-modeswitch: 1-1:1.2: Manufacturer=HUAWEI Product=HUAWEI_Mobile Serial=?
Sep  9 19:22:37 OpenWrt user.notice usb-modeswitch: 1-1:1.3: Manufacturer=HUAWEI Product=HUAWEI_Mobile Serial=?
Sep  9 19:22:37 OpenWrt user.notice usb-modeswitch: 1-1:1.4: Manufacturer=HUAWEI Product=HUAWEI_Mobile Serial=?
Sep  9 19:22:38 OpenWrt user.notice usb-modeswitch: 1-1:1.5: Manufacturer=HUAWEI Product=HUAWEI_Mobile Serial=?
root@OpenWrt:~#

comment:12 Changed 5 years ago by flux242@…

Apparently, the proposed patch did not completely solved the problem. I'm still having the same problem with my dongle even with the patch applied. I haven't reopened the ticket just because my sandbox is very old and I wasn't sure if the problem still persist.

comment:13 Changed 5 years ago by flux242@…

As a workaround I'm currently calling "etc-init.d-network" restart before calling ifup wan. The problem is still with the hotplug script that does nothing because it cannot find the device variable.

comment:14 Changed 5 years ago by flux242@…

This bug appeared with the integration of the netifd.

comment:15 Changed 5 years ago by mstm <mstm@…>

Seems the same problem /ticket/12008.html

comment:16 Changed 5 years ago by jow

  • Resolution set to fixed
  • Status changed from reopened to closed

Should be fixed with r33350

comment:17 Changed 5 years ago by mstm <mstm@…>

WOW thanks Jow, now is ok!

comment:18 Changed 4 years ago by jow

  • Milestone changed from Attitude Adjustment 12.09 to Barrier Breaker 14.07

Milestone Attitude Adjustment 12.09 deleted

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.