Modify

Opened 5 years ago

Closed 5 years ago

Last modified 4 years ago

#12039 closed enhancement (fixed)

comgt patch: Huawei 3G USB dongle with 3G+2G mode

Reported by: André Gaul <gaul@…> Owned by: developers
Priority: normal Milestone: Barrier Breaker 14.07
Component: packages Version: Trunk
Keywords: Cc:

Description

It seems that the comgt package does not handle the Huawei 3G USB dongle E176 correctly (and probably other Huawei dongles too). My dongle appears as ID 12d1:1001 Huawei Technologies Co., Ltd. E620 USB Modem and 3G/UMTS connections work well. However, no connection is established if only 2G/GPRS is available: the pppd chat script fails with NO CARRIER although the dongle is registered to the network (via 2G). As outlined in this wiki or this blog, Huawei chips use the AT^SYSCFG command to set 2G or
3G mode, which is not implemented in comgt at the moment. Thus I wrote a patch for /lib/network/3g.sh which adds support for the "service" option in the network configuration with Huawei dongles. By default (if no "service" option is specified) also 2G is used when 3G is unavailable. The Huawei dongle is detected analogously to other chips (the output of gcom -d /dev/ttyUSB0 -s /etc/gcom/getcardinfo.gcom is scanned for huawei).

Some further information: The AT^SYSCFG command seems to be respected only once after the dongle is attached (or after the host is powered up). Resetting the dongle seems to render the serial port unusable in some cases. However, the patch sets a useful mode by default which should cover most use cases (3G preferred, but 2G allowed) and if 3G-only or 2G-only mode is required the device can be power cycled.

Attachments (1)

comgt-huawei-3g-2g-mode.patch (579 bytes) - added by André Gaul <gaul@…> 5 years ago.
comgt patch for Huawei 3G dongles (enables 3G and 2G mode)

Download all attachments as: .zip

Change History (11)

Changed 5 years ago by André Gaul <gaul@…>

comgt patch for Huawei 3G dongles (enables 3G and 2G mode)

comment:1 Changed 5 years ago by jow

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

Committed in r33212 - thank you!

comment:2 Changed 5 years ago by anonymous

  • Resolution fixed deleted
  • Status changed from closed to reopened

I am sorry, but the internet does not rise after modification
if I delete,that the internet work
Huawei е1550
in log
[code]
Sep 8 19:46:04 OpenWrt user.info sysinit: ping: sendto: Network is unreachable
Sep 8 19:46:14 OpenWrt user.info sysinit: ping: sendto: Network is unreachable
Sep 8 19:46:24 OpenWrt user.info sysinit: ping: sendto: Network is unreachable
Sep 8 19:46:34 OpenWrt user.info sysinit: ping: sendto: Network is unreachable
[/code]

comment:3 Changed 5 years ago by André Gaul <gaul@…>

Can you provide additional information (corresponding part of /etc/config/network and log messages from pppd/chat)?

comment:4 Changed 5 years ago by jow

I propose the change below to not touch whatever existing preset if none of the *_only service choices is set:

--- package/comgt/files/3g.sh	(Revision 33213)
+++ package/comgt/files/3g.sh	(Arbeitskopie)
@@ -56,9 +56,9 @@
 				case "$service" in
 					umts_only) CODE="14,2";;
 					gprs_only) CODE="13,1";;
-					*) CODE="2,2";;
+					*) CODE="";;
 				esac
-				export MODE="AT^SYSCFG=${CODE},3FFFFFFF,2,4"
+				${CODE:+export MODE="AT^SYSCFG=${CODE},3FFFFFFF,2,4"}
 			fi
 
 			if [ -n "$pincode" ]; then

comment:5 follow-up: Changed 5 years ago by André Gaul <gaul@…>

Hmm, I disagree because in my case the dongle's default behavior isn't 2G+3G but only 3G. This is annoying in areas with bad 3G coverage or when the device is moving. I experienced perfect 2G/3G switching with CODE="2,2" in a moving car, so I suggest we try to figure out what's going wrong in the situation of comment 2.

comment:6 in reply to: ↑ 5 Changed 5 years ago by yu_mirjahpar@…

Replying to André Gaul <gaul@…>:

Hmm, I disagree because in my case the dongle's default behavior isn't 2G+3G but only 3G. This is annoying in areas with bad 3G coverage or when the device is moving. I experienced perfect 2G/3G switching with CODE="2,2" in a moving car, so I suggest we try to figure out what's going wrong in the situation of comment 2.

I have tp link 703, flashed it with open wrt, no connection is established if only 2G/GPRS is available. I use usb modem (huawei e173). I want to add your comgt-huawei-3g-2g-mode.patch to my router, but i do not know open wrt very much, please show how to add this patch.
my routers /etc/config/network

config interface 'loopback'

option ifname 'lo'
option proto 'static'
option ipaddr '127.0.0.1'
option netmask '255.0.0.0'

config interface 'lan'

option ifname 'eth0'
option type 'bridge'
option proto 'static'
option netmask '255.255.255.0'
option gateway '192.168.1.1'
option dns '192.168.1.1'
option ipaddr '192.168.1.1'

config interface 'wan'

option ifname 'ppp0'
option device '/dev/ttyUSB0'
option apn 'internet'
option service 'umts'
option proto '3g'

comment:7 Changed 5 years ago by gio.pardini@…

I have a Vodafone K3806 (which is manufactured by Huawei), but the patch that you proposed does not work for me.

Here is the output of the getcardinfo script:

# gcom -d "/dev/ttyUSB0" -s /etc/gcom/getcardinfo.gcom
ATI
Manufacturer: Vodafone (Huawei)
Model: K3806
Revision: 31.116.30.00.11
IMEI: xxxxxxxxxxxxxxxxxxx
+GCAP: +CGSM,+FCLASS,+DS

OK

The problem is that the output of gcom is scanned for the string "huawei", while it should also check for "Huawei".

I tried to replace

 elif echo "$cardinfo" | grep -q huawei; then

with

 elif echo "$cardinfo" | grep -qi huawei; then

and it worked.

comment:8 Changed 5 years ago by André Gaul <gaul@…>

thx @gio for pointing out the case issue. I suggest to close this ticket because the case fix is added in r33507 and "anonymous" does not provide additional information.

comment:9 Changed 5 years ago by nbd

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

comment:10 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.