Re: [OpenWrt-Devel] [PATCH] comgt: NCM protocol now propagate defaultroute, peerdns, metric to dynamic ifaces

2016-02-26 Thread John Crispin
Hi,

can you change this and put the functionality in a more generic place so
that it works for all virtual interfaces ? felix explained in the hilink
thread that bruno started where he thinks this should go.

John

On 09/02/2016 21:38, Jakub Janco wrote:
> NCM protocol now propagate defaultroute, peerdns, metric to its dynamic dhcp 
> ifaces to maintain options defined in /etc/config/network.
> 
> Signed-off-by: Jakub Janco 
> ---
>  package/network/utils/comgt/files/ncm.sh | 10 --
>  1 file changed, 8 insertions(+), 2 deletions(-)
> 
> diff --git a/package/network/utils/comgt/files/ncm.sh 
> b/package/network/utils/comgt/files/ncm.sh
> index 571cfaa..0157f26 100644
> --- a/package/network/utils/comgt/files/ncm.sh
> +++ b/package/network/utils/comgt/files/ncm.sh
> @@ -26,8 +26,8 @@ proto_ncm_setup() {
>  
>   local manufacturer initialize setmode connect ifname devname devpath
>  
> - local device apn auth username password pincode delay mode pdptype ipv6
> - json_get_vars device apn auth username password pincode delay mode 
> pdptype ipv6
> + local device apn auth username password pincode delay mode pdptype ipv6 
> defaultroute peerdns metric
> + json_get_vars device apn auth username password pincode delay mode 
> pdptype ipv6 defaultroute peerdns metric
>   
>   if [ "$ipv6" = 0 ]; then
>   ipv6=""
> @@ -141,6 +141,9 @@ proto_ncm_setup() {
>   json_add_string name "${interface}_4"
>   json_add_string ifname "@$interface"
>   json_add_string proto "dhcp"
> + [ -n "$defaultroute" ] && json_add_boolean defaultroute "$defaultroute"
> + [ -n "$peerdns" ] && json_add_boolean peerdns "$peerdns"
> + [ -n "$metric" ] && json_add_int metric "$metric"
>   ubus call network add_dynamic "$(json_dump)"
>  
>   [ -n "$ipv6" ] && {
> @@ -148,6 +151,9 @@ proto_ncm_setup() {
>   json_add_string name "${interface}_6"
>   json_add_string ifname "@$interface"
>   json_add_string proto "dhcpv6"
> + [ -n "$defaultroute" ] && json_add_boolean defaultroute 
> "$defaultroute"
> + [ -n "$peerdns" ] && json_add_boolean peerdns "$peerdns"
> + [ -n "$metric" ] && json_add_int metric "$metric"
>   json_add_string extendprefix 1
>   ubus call network add_dynamic "$(json_dump)"
>   }
> 
___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


Re: [OpenWrt-Devel] [PATCH] comgt: NCM protocol propagate defaultroute, peerdns, metric to dynamic ifaces

2016-02-09 Thread John Crispin
Hi Jakub,

could it be that you manually edited the patch because (see inline) 

On 08/02/2016 11:57, Jakub Janco wrote:
> NCM protocol now propagate defaultroute, peerdns, metric to its dynamic dhcp 
> ifaces to maintain these options defined in /etc/config/network.
> 
> Signed-off-by: Jakub Janco 
> ---
>  package/network/utils/comgt/files/ncm.sh | 10 --
>  1 file changed, 8 insertions(+), 2 deletions(-)
> 
> diff --git a/package/network/utils/comgt/files/ncm.sh 
> b/package/network/utils/comgt/files/ncm.sh
> index 571cfaa..0157f26 100644
> --- a/package/network/utils/comgt/files/ncm.sh
> +++ b/package/network/utils/comgt/files/ncm.sh
> @@ -26,8 +26,8 @@ proto_ncm_setup() {
>  
>   local manufacturer initialize setmode connect ifname devname devpath
>  
> - local device apn auth username password pincode delay mode pdptype ipv6
> - json_get_vars device apn auth username password pincode delay mode 
> pdptype ipv6
> + local device apn auth username password pincode delay mode pdptype ipv6 
> defaultroute peerdns metric
> + json_get_vars device apn auth username password pincode delay mode 
> pdptype ipv6 defaultroute peerdns metric
>   
 ~~~ there is a stray TAB right here which makes "git am" reject the
patch.

could you send a version of the patch that is fixed and applies with git
am please ?

John



>   if [ "$ipv6" = 0 ]; then
>   ipv6=""
> @@ -141,6 +141,9 @@ proto_ncm_setup() {
>   json_add_string name "${interface}_4"
>   json_add_string ifname "@$interface"
>   json_add_string proto "dhcp"
> + [ -n "$defaultroute" ] && json_add_boolean defaultroute "$defaultroute"
> + [ -n "$peerdns" ] && json_add_boolean peerdns "$peerdns"
> + [ -n "$metric" ] && json_add_int metric "$metric"
>   ubus call network add_dynamic "$(json_dump)"
>  
>   [ -n "$ipv6" ] && {
> @@ -148,6 +151,9 @@ proto_ncm_setup() {
>   json_add_string name "${interface}_6"
>   json_add_string ifname "@$interface"
>   json_add_string proto "dhcpv6"
> + [ -n "$defaultroute" ] && json_add_boolean defaultroute 
> "$defaultroute"
> + [ -n "$peerdns" ] && json_add_boolean peerdns "$peerdns"
> + [ -n "$metric" ] && json_add_int metric "$metric"
>   json_add_string extendprefix 1
>   ubus call network add_dynamic "$(json_dump)"
>   }
> -- 
> 2.1.4
> ___
> openwrt-devel mailing list
> openwrt-devel@lists.openwrt.org
> https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel
> 
___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


Re: [OpenWrt-Devel] [PATCH] comgt-ncm: Add possibility to choose PDP context type

2015-10-10 Thread Matti Laakso
>> Date: Sun, 20 Sep 2015 23:52:32 +0300
>> Subject: Re: [OpenWrt-Devel] [PATCH] comgt-ncm: Add possibility to
>> choose PDP context type
>> From: sami at olmari.fi
>> To: malaakso at elisanet.fi
>> CC: openwrt-devel at lists.openwrt.org
>>
>> This is not working with Huawei E3276, only "option pdptype 'IP' works,
>> IPV6 and IPV4V6... I do not have IPv6 offered from ISP currently,
>> should it matter. At attachment there is clips from the log using each
>> option type, most important clip here, same for IPV4V6 (aka no option
>> set):
>>
>> Sun Sep 20 20:32:10 2015 daemon.notice netifd: wan (2935): sending ->
>> AT+CGDCONT=1,"IPV6","opengate"
>> Sun Sep 20 20:32:11 2015 daemon.notice netifd: wan (2935): Error
>> running AT-command
>> Sun Sep 20 20:32:11 2015 daemon.notice netifd: wan (2935): Failed to
>> initialize modem
>>
>> There is also some random other errors seen on log on _working_
>> connection, I don't know do they bear any importance, as system works.
>> Anything I could do to make it work so that it wouldn't at least fail?
>>
>>   Sami Olmari
>>
>> P.S. I've updated wiki with this new option information :)
>>
>
> Hi,
>
> If you don't have IPv6 from your ISP, then that is expected. That doesn't
change
> the fact that my patch does introduce a regression for those without
IPv6, them
> having to manually disable it (setting ipv6 to 0 selects "IP" by
default). I'll have to
> think the defaults through again, most likely changing PDP type "IP" to
be the
> default unless IPv6 is explicitely _enabled_.
>
> Thanks for reporting!
>
> Matti
>
> Hi there!
>
> I noticed this regression today after upgrading to trunk. I don't think
> this is the complete answer though.
>
> I have the same E3276 dongle and I *do* have IPv6 from my ISP (Tele2,
> Sweden). The same SIM-card in a B593s-22 router gets me a native IPv6
> connection.
>
> I see the exact same error in the logs and I've verified that E3276
doesn't
> accept IPV6 (or IPV4V6, or ... ) as the second parameter by manually echo
> -e 'AT+CGDCONT=1,"IPV6","internet.tele2.se",""\r' > /dev/cdc-wdm0. Only
> "IP" works.
>
> Is the AT+CGDCONT command the correct way to select the PDP type on Huawei
> NCM dongles? What info is that based on?
>
> If there's something you want me to try, just shout.
>
> /Andreas

Hi Andreas,

You could try to change the PDP context number from 1 to something else,
e.g., 2, 3 or even higher. It is the first number in the AT+CGDCONT and
AT^NDISDUP commands. Change it in all of them in ncm.json. Command
AT+CGDCONT? should show all the profiles from the SIM, and they may be
locked. AT+CGDCONT is standardized by 3GPP, and should work in all dongles
accepting AT-commands.

Maybe your B593 also shows the existing profiles and their types in the web
UI?

Matti
___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


Re: [OpenWrt-Devel] [PATCH] comgt-ncm: Add possibility to choose PDP context type

2015-10-07 Thread Sami Olmari
I suspect too that issue isn't ISP having IPv6 or not, as the error comes
instantly in the line... I'd suspect that this option "allows" for IPv6 to
be used, does it fail if no IPv6 is available (in IPV4V6) or not is issue
for further time... So does diffirent NCM-devices possibly have diffirent
option names or no support at all... Who knows... Talk about NCM being
scattered ;(

Sami Olmari
On Oct 7, 2015 10:08, "Lars Melin"  wrote:

> On 2015-10-07 04:12, Andreas Fritiofson wrote:
>
> I see the exact same error in the logs and I've verified that E3276
>> doesn't accept IPV6 (or IPV4V6, or ... ) as the second parameter by
>> manually echo -e 'AT+CGDCONT=1,"IPV6","internet.tele2.se
>> ",""\r' > /dev/cdc-wdm0. Only "IP" works.
>>
>>
> The PDP type IPV6 is only valid for some Huawei firmwares, most likely
> based on what your mobile operator has asked Huawei to include in the
> dongles made for them.
>
> wbr
> Lars
> ___
> openwrt-devel mailing list
> openwrt-devel@lists.openwrt.org
> https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel
>
___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


Re: [OpenWrt-Devel] [PATCH] comgt-ncm: Add possibility to choose PDP context type

2015-10-07 Thread Lars Melin

On 2015-10-07 04:12, Andreas Fritiofson wrote:


I see the exact same error in the logs and I've verified that E3276
doesn't accept IPV6 (or IPV4V6, or ... ) as the second parameter by
manually echo -e 'AT+CGDCONT=1,"IPV6","internet.tele2.se
",""\r' > /dev/cdc-wdm0. Only "IP" works.



The PDP type IPV6 is only valid for some Huawei firmwares, most likely 
based on what your mobile operator has asked Huawei to include in the

dongles made for them.

wbr
Lars
___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


Re: [OpenWrt-Devel] [PATCH] comgt-ncm: Add possibility to choose PDP context type

2015-10-06 Thread Andreas Fritiofson
>> Date: Sun, 20 Sep 2015 23:52:32 +0300
>> Subject: Re: [OpenWrt-Devel] [PATCH] comgt-ncm: Add possibility to
>> choose PDP context type
>> From: sami at olmari.fi
>> To: malaakso at elisanet.fi
>> CC: openwrt-devel at lists.openwrt.org
>>
>> This is not working with Huawei E3276, only "option pdptype 'IP' works,
>> IPV6 and IPV4V6... I do not have IPv6 offered from ISP currently,
>> should it matter. At attachment there is clips from the log using each
>> option type, most important clip here, same for IPV4V6 (aka no option
>> set):
>>
>> Sun Sep 20 20:32:10 2015 daemon.notice netifd: wan (2935): sending ->
>> AT+CGDCONT=1,"IPV6","opengate"
>> Sun Sep 20 20:32:11 2015 daemon.notice netifd: wan (2935): Error
>> running AT-command
>> Sun Sep 20 20:32:11 2015 daemon.notice netifd: wan (2935): Failed to
>> initialize modem
>>
>> There is also some random other errors seen on log on _working_
>> connection, I don't know do they bear any importance, as system works.
>> Anything I could do to make it work so that it wouldn't at least fail?
>>
>>   Sami Olmari
>>
>> P.S. I've updated wiki with this new option information :)
>>
>
> Hi,
>
> If you don't have IPv6 from your ISP, then that is expected. That doesn't
change
> the fact that my patch does introduce a regression for those without
IPv6, them
> having to manually disable it (setting ipv6 to 0 selects "IP" by
default). I'll have to
> think the defaults through again, most likely changing PDP type "IP" to
be the
> default unless IPv6 is explicitely _enabled_.
>
> Thanks for reporting!
>
> Matti

Hi there!

I noticed this regression today after upgrading to trunk. I don't think
this is the complete answer though.

I have the same E3276 dongle and I *do* have IPv6 from my ISP (Tele2,
Sweden). The same SIM-card in a B593s-22 router gets me a native IPv6
connection.

I see the exact same error in the logs and I've verified that E3276 doesn't
accept IPV6 (or IPV4V6, or ... ) as the second parameter by manually echo
-e 'AT+CGDCONT=1,"IPV6","internet.tele2.se",""\r' > /dev/cdc-wdm0. Only
"IP" works.

Is the AT+CGDCONT command the correct way to select the PDP type on Huawei
NCM dongles? What info is that based on?

If there's something you want me to try, just shout.

/Andreas
___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


Re: [OpenWrt-Devel] [PATCH] comgt-ncm: Add possibility to choose PDP context type

2015-09-20 Thread Matti Laakso
> Date: Sun, 20 Sep 2015 23:52:32 +0300 
> Subject: Re: [OpenWrt-Devel] [PATCH] comgt-ncm: Add possibility to  
> choose PDP context type 
> From: s...@olmari.fi 
> To: malaa...@elisanet.fi 
> CC: openwrt-devel@lists.openwrt.org 
>  
> This is not working with Huawei E3276, only "option pdptype 'IP' works,  
> IPV6 and IPV4V6... I do not have IPv6 offered from ISP currently,  
> should it matter. At attachment there is clips from the log using each  
> option type, most important clip here, same for IPV4V6 (aka no option  
> set): 
>  
> Sun Sep 20 20:32:10 2015 daemon.notice netifd: wan (2935): sending ->  
> AT+CGDCONT=1,"IPV6","opengate" 
> Sun Sep 20 20:32:11 2015 daemon.notice netifd: wan (2935): Error  
> running AT-command 
> Sun Sep 20 20:32:11 2015 daemon.notice netifd: wan (2935): Failed to  
> initialize modem 
>  
> There is also some random other errors seen on log on _working_  
> connection, I don't know do they bear any importance, as system works.  
> Anything I could do to make it work so that it wouldn't at least fail? 
>  
>   Sami Olmari 
>  
> P.S. I've updated wiki with this new option information :) 
>  

Hi,

If you don't have IPv6 from your ISP, then that is expected. That doesn't change
the fact that my patch does introduce a regression for those without IPv6, them
having to manually disable it (setting ipv6 to 0 selects "IP" by default). I'll 
have to
think the defaults through again, most likely changing PDP type "IP" to be the
default unless IPv6 is explicitely _enabled_.

Thanks for reporting!

Matti
  
___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


Re: [OpenWrt-Devel] [PATCH] comgt-ncm: Add possibility to choose PDP context type

2015-09-20 Thread Sami Olmari
This is not working with Huawei E3276, only "option pdptype 'IP' works,
IPV6 and IPV4V6... I do not have IPv6 offered from ISP currently, should it
matter. At attachment there is clips from the log using each option type,
most important clip here, same for IPV4V6 (aka no option set):

Sun Sep 20 20:32:10 2015 daemon.notice netifd: wan (2935): sending ->
AT+CGDCONT=1,"IPV6","opengate"
Sun Sep 20 20:32:11 2015 daemon.notice netifd: wan (2935): Error running
AT-command
Sun Sep 20 20:32:11 2015 daemon.notice netifd: wan (2935): Failed to
initialize modem

There is also some random other errors seen on log on _working_ connection,
I don't know do they bear any importance, as system works. Anything I could
do to make it work so that it wouldn't at least fail?

 Sami Olmari

P.S. I've updated wiki with this new option information :)

On Tue, Sep 8, 2015 at 7:06 PM, Matti Laakso  wrote:

> By setting the option pdptype to IP, IPV6 or IPV4V6 the user can
> choose the context type between IPv4, IPv6 and dual stack,
> respectively. The default setting is dual stack, except if option
> ipv6=0 is specified, in which case IPv4 context is the default.
> This allows for an out-of-the-box IPv6 support with modems
> utilizing NCM-like protocols.
>
> While we are at it, also add commands for Sierra DirectIP modems
> (currently untested), which will allow us to drop the separate
> comgt-directip package (once tested and verified working).
>
> Signed-off-by: Matti Laakso 
> ---
>  package/network/utils/comgt/Makefile   |  2 +-
>  package/network/utils/comgt/files/ncm.json | 26 +
>  package/network/utils/comgt/files/ncm.sh   | 36
> ++
>  3 files changed, 50 insertions(+), 14 deletions(-)
>
> diff --git a/package/network/utils/comgt/Makefile
> b/package/network/utils/comgt/Makefile
> index 18085a6..716bbbf 100644
> --- a/package/network/utils/comgt/Makefile
> +++ b/package/network/utils/comgt/Makefile
> @@ -9,7 +9,7 @@ include $(TOPDIR)/rules.mk
>
>  PKG_NAME:=comgt
>  PKG_VERSION:=0.32
> -PKG_RELEASE:=25
> +PKG_RELEASE:=26
>
>  PKG_SOURCE:=$(PKG_NAME).$(PKG_VERSION).tgz
>  PKG_SOURCE_URL:=@SF/comgt
> diff --git a/package/network/utils/comgt/files/ncm.json
> b/package/network/utils/comgt/files/ncm.json
> index ea4f984..d1f8699 100644
> --- a/package/network/utils/comgt/files/ncm.json
> +++ b/package/network/utils/comgt/files/ncm.json
> @@ -6,7 +6,8 @@
> "ATQ0",
> "ATV1",
> "ATE1",
> -   "ATS0=0"
> +   "ATS0=0",
> +   "AT+CGDCONT=1,\\\"${pdptype}\\\",\\\"${apn}\\\""
> ],
> "modes": {
> "preferlte":
> "AT^SYSCFGEX=\\\"030201\\\",3fff,2,4,7fff,,",
> @@ -25,7 +26,7 @@
> "AT+CGREG=2",
> "AT+CFUN=5",
> "AT+MODESELECT=3",
> -   "AT+CGDCONT=1,\\\"IP\\\",\\\"${apn}\\\""
> +   "AT+CGDCONT=1,\\\"${pdptype}\\\",\\\"${apn}\\\""
> ],
> "modes": {
> "umts": "AT+CHANGEALLPATH=1"
> @@ -33,10 +34,27 @@
> "connect": "AT+CGATT=1",
> "disconnect": "AT+CGATT=0"
> },
> -   "sony": {
> +   "sierra wireless, incorporated": {
> "initialize": [
> "AT+CFUN=1",
> -   "AT+CGDCONT=1,\\\"IP\\\",\\\"${apn}\\\"",
> +   "AT+CGDCONT=1,\\\"${pdptype}\\\",\\\"${apn}\\\"",
> +
>  
> "AT$QCPDPP=1${auth:+,$auth}${password:+,\\\"$password\\\"}${username:+,\\\"$username\\\"}"
> +   ],
> +   "modes": {
> +   "preferlte": "AT!SELRAT=07",
> +   "preferumts": "AT!SELRAT=05",
> +   "lte": "AT!SELRAT=06",
> +   "umts": "AT!SELRAT=01",
> +   "gsm": "AT!SELRAT=02",
> +   "auto": "AT!SELRAT=00"
> +   },
> +   "connect": "AT!SCACT=1,1",
> +   "disconnect": "AT!SCACT=0,1"
> +   },
> +   "sony ericsson": {
> +   "initialize": [
> +   "AT+CFUN=1",
> +   "AT+CGDCONT=1,\\\"${pdptype}\\\",\\\"${apn}\\\"",
>
> "AT*EIAAUW=1,1,\\\"${username}\\\",\\\"${password}\\\",${auth:-00111}"
> ],
> "modes": {
> diff --git a/package/network/utils/comgt/files/ncm.sh
> b/package/network/utils/comgt/files/ncm.sh
> index ffe5615..571cfaa 100644
> --- a/package/network/utils/comgt/files/ncm.sh
> +++ b/package/network/utils/comgt/files/ncm.sh
> @@ -17,6 +17,8 @@ proto_ncm_init_config() {
> proto_config_add_string pincode
> proto_config_add_string delay
> proto_config_add_string mode
> +   proto_config_add_string pdptype
> +

Re: [OpenWrt-Devel] [PATCH] comgt: add hso support

2015-02-23 Thread John Crispin
Hi,

some comments inline

On 22/02/2015 10:19, Cezary Jackiewicz wrote:
 Add HSO support to comgt. This is work of Kyklas (see 
 https://dev.openwrt.org/ticket/6995), tested with Option GTM382.
 
 Signed-off-by: Cezary Jackiewicz cezary.jackiew...@gmail.com
 ---
 
 diff --git a/package/network/utils/comgt/Makefile 
 b/package/network/utils/comgt/Makefile
 index 8fcf54e..1e12b68 100644
 --- a/package/network/utils/comgt/Makefile
 +++ b/package/network/utils/comgt/Makefile
 @@ -9,7 +9,7 @@ include $(TOPDIR)/rules.mk
  
  PKG_NAME:=comgt
  PKG_VERSION:=0.32
 -PKG_RELEASE:=25
 +PKG_RELEASE:=26
  
  PKG_SOURCE:=$(PKG_NAME).$(PKG_VERSION).tgz
  PKG_SOURCE_URL:=@SF/comgt
 @@ -47,6 +47,12 @@ $(call Package/comgt/Default)
DEPENDS:=+comgt
  endef
  
 +define Package/comgt-hso
 +$(call Package/comgt/Default)
 +  TITLE+=HSO Support
 +  DEPENDS:=+comgt +kmod-usb-net +kmod-usb-net-hso
 +endef
 +
  define Package/comgt/description
   comgt is a scripting language interpreter useful for establishing 
   communications on serial lines and through PCMCIA modems as well as GPRS 
 @@ -101,6 +107,17 @@ define Package/comgt-ncm/install
   $(INSTALL_BIN) ./files/ncm.sh $(1)/lib/netifd/proto/ncm.sh
  endef
  
 +define Package/comgt-hso/install
 +$(INSTALL_DIR) $(1)/etc/chatscripts
 +$(INSTALL_DATA) ./files/hso.chat $(1)/etc/chatscripts/hso.chat
 +$(INSTALL_DATA) ./files/hsohup.chat $(1)/etc/chatscripts/hsohup.chat
 +$(INSTALL_DIR) $(1)/etc/gcom
 +$(INSTALL_DATA) ./files/setuser.gcom $(1)/etc/gcom/setuser.gcom
 +$(INSTALL_DIR) $(1)/lib/netifd/proto
 +$(INSTALL_BIN) ./files/hso.sh $(1)/lib/netifd/proto/hso.sh
 +endef
 +
  $(eval $(call BuildPackage,comgt))
  $(eval $(call BuildPackage,comgt-directip))
  $(eval $(call BuildPackage,comgt-ncm))
 +$(eval $(call BuildPackage,comgt-hso))
 diff --git a/package/network/utils/comgt/files/hso.chat 
 b/package/network/utils/comgt/files/hso.chat
 new file mode 100644
 index 000..cb87d5a
 --- /dev/null
 +++ b/package/network/utils/comgt/files/hso.chat
 @@ -0,0 +1,13 @@
 +ABORT   BUSY
 +ABORT   'NO CARRIER'
 +ABORT   ERROR
 +REPORT  CONNECT
 +TIMEOUT 10
 +   ATZ
 +OK   'AT+CGDCONT=2,IP,$USE_APN'
 +SAY  Service Mode $MODE
 +TIMEOUT 30
 +OK   AT_OPSYS=$MODE,2
 +OK   AT_OWANCALL=2,1,0
 +OK   \d\d\d\d\d\dAT_OWANDATA=2
 +OK   
 diff --git a/package/network/utils/comgt/files/hso.sh 
 b/package/network/utils/comgt/files/hso.sh
 new file mode 100644
 index 000..5f10420
 --- /dev/null
 +++ b/package/network/utils/comgt/files/hso.sh
 @@ -0,0 +1,135 @@
 +#!/bin/sh
 +INCLUDE_ONLY=1
 +
 +. ../netifd-proto.sh
 +init_proto $@
 +
 +proto_hso_init_config() {
 +
 + no_device=1
 + available=1
 +
 + proto_config_add_string device
 + proto_config_add_string maxwait
 + proto_config_add_string apn
 + proto_config_add_string pincode
 + proto_config_add_int mtu
 + proto_config_add_string username
 + proto_config_add_string password
 + proto_config_add_string ifname
 +}
 +
 +
 +proto_hso_setup() {
 +
 + local iface=$1
 + local chat=/etc/chatscripts/hso.chat
 +
 + json_get_var device device
 + json_get_var maxwait maxwait
 + maxwait=${maxwait:-20}
 + while [ ! -e $device -a $maxwait -gt 0 ];do # wait for driver loading 
 to catch up
 + maxwait=$(($maxwait - 1))


This bit is correct with the maxwait logic, but below ...

 + sleep 1
 + done
 +
 + json_get_var apn apn
 + json_get_var pincode pincode
 + json_get_var mtu mtu
 + json_get_var service service
 + json_get_var username username
 + json_get_var password password
 + json_get_type ifnametype ifname
 +
 + if [ $ifnametype = array ]
 + then
 + json_select ifname
 + json_get_var ifname 1
 + json_select ..
 + fi
 +
 + if [ $ifnametype = string ]
 + then
 + json_get_var ifname ifname
 + fi
 +
 + # set pin if configured
 + if [ ! -z $pincode ]
 + then
 + PINCODE=$pincode gcom -d $device -s /etc/gcom/setpin.gcom 
 || {
 + echo $iface (hso): Failed to set the PIN code.
 + proto_notify_error $iface PIN_FAILED
 + return 1
 + }
 + fi
 +
 + # set username and password if configured
 + if [ -n $username -a -n $password ]
 + then
 + USER=$username PASS=$password gcom -d $device -s 
 /etc/gcom/setuser.gcom || {
 + echo $iface (hso): Failed to set username and 
 password.
 + proto_notify_error $iface AUTH_FAILED
 + return 1
 + }
 + fi
 +
 + case $service in
 + umts_only) service_mode=1;;
 + gprs_only) service_mode=0;;
 + *) service_mode=3;;
 + esac
 +
 + local pip counter
 + local outputfile=/tmp/hsoout.$$
 + while [ -z $pip -a $counter != --- ]
 + do

there is a weird way to solve 

Re: [OpenWrt-Devel] [PATCH] comgt-ncm: Fix NCM protocol

2015-01-28 Thread Cezary Jackiewicz
Dnia 2015-01-28, o godz. 18:44:47
Matti Laakso malaa...@elisanet.fi napisał(a):

 I'd appreciate if someone with Samsung or Sony-Ericsson modems could
 test this, I was only able to test it with Huawei E3276, E3372 and
 E353.

Hi,
ndis was tested with e3372 and working? On which version of firmware/WebUI?

-- 
Pozdrawiam,
 Cezary Jackiewicz
___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


Re: [OpenWrt-Devel] [PATCH] comgt: Allow using non-TTY devices

2015-01-16 Thread John Crispin


On 13/01/2015 18:00, Matti Laakso wrote:
 Some Huawei mobile broadband sticks utilizing the NCM protocol expose
 the control channel as a cdc-wdm device node instead of a virtual TTY.
 This device node does not support the terminal ioctls. This patch
 adds a check whether the provided device is a TTY or not and does not
 attempt to use the terminal ioctls if they are not supported.
 
 Signed-off-by: Matti Laakso malaa...@elisanet.fi
 ---
 diff --git a/package/network/utils/comgt/patches/004-check_tty.patch 
 b/package/network/utils/comgt/patches/004-check_tty.patch
 new file mode 100644
 index 000..d269bce
 --- /dev/null
 +++ b/package/network/utils/comgt/patches/004-check_tty.patch
 @@ -0,0 +1,177 @@
 +--- a/comgt.c
  b/comgt.c
 +@@ -91,6 +91,7 @@ unsigned long hstart,hset;
 + char NullString[]={  };
 + BOOL lastcharnl=1; /* Indicate that last char printed from getonebyte
 +was a nl, so no new one is needed */
 ++BOOL tty=1;
 + 
 + 
 + //open com \/dev/modem\\nset com 38400n81\nset senddelay 0.05\nsend 
 \ATi^m\\nget 2 \ ^m\ $s\nprint \Response : \,$s,\\\n\\nget 2 \ ^m\ 
 $s\nprint \Response :\,$s,\\\n\\nget 2 \ ^m\ $s\nprint \Response : 
 \,$s,\\\n\\n\n;
 +@@ -918,10 +919,12 @@ BOOL getonoroff(void) {
 + }
 + 
 + void setcom(void) {
 +-  stbuf.c_cflag = ~(CBAUD | CSIZE | CSTOPB | CLOCAL | PARENB);
 +-  stbuf.c_cflag |= (speed | bits | CREAD | clocal | parity | stopbits );
 +-  if (ioctl(comfd, TCSETA, stbuf)  0) {
 +-serror(Can't ioctl set device,1);
 ++  if (tty) {
 ++stbuf.c_cflag = ~(CBAUD | CSIZE | CSTOPB | CLOCAL | PARENB);
 ++stbuf.c_cflag |= (speed | bits | CREAD | clocal | parity | stopbits );
 ++if (ioctl(comfd, TCSETA, stbuf)  0) {
 ++  serror(Can't ioctl set device,1);
 ++}
 +   }
 + }
 + 
 +@@ -1224,9 +1227,11 @@ void doclose(void) {
 +   if(strcmp(token,hardcom)==0) {
 + if(comfd== -1) serror(Com device not open,1);
 + vmsg(Closing device);
 +-if (ioctl(comfd, TCSETA, svbuf)  0) {
 +-  sprintf(msg,Can't ioctl set device %s.\n,device);
 +-  serror(msg,1);
 ++if (tty) {
 ++  if (ioctl(comfd, TCSETA, svbuf)  0) {
 ++sprintf(msg,Can't ioctl set device %s.\n,device);
 ++serror(msg,1);
 ++  }
 + }


if (tty  (ioctl(comfd, TCSETA, svbuf)  0)) .


i think this pattern would drastically reduce the diffstat




 + close(comfd);
 + comfd= -1;
 +@@ -1266,26 +1271,32 @@ void opengt(void) {
 +   ext(1);
 + }
 +   }
 +-  if (ioctl (comfd, TCGETA, svbuf)  0) {
 +-sprintf(msg,Can't control %s, please try again.\n,device);
 +-serror(msg,1);
 ++  if (isatty (comfd))
 ++tty=1;
 ++  else
 ++tty=0;
 ++  if (tty) {
 ++if (ioctl (comfd, TCGETA, svbuf)  0) {
 ++  sprintf(msg,Can't control %s, please try again.\n,device);
 ++  serror(msg,1);
 ++}
 ++ioctl(comfd, TCGETA, stbuf);
 ++speed=stbuf.c_cflag  CBAUD;
 ++if (high_speed == 0)  strcpy(cspeed,115200);
 ++else strcpy(cspeed,57600);
 ++bits=stbuf.c_cflag  CSIZE;
 ++clocal=stbuf.c_cflag  CLOCAL;
 ++stopbits=stbuf.c_cflag  CSTOPB;
 ++parity=stbuf.c_cflag  (PARENB | PARODD);
 ++stbuf.c_iflag = ~(IGNCR | ICRNL | IUCLC | INPCK | IXON | IXANY | 
 IGNPAR );
 ++stbuf.c_oflag = ~(OPOST | OLCUC | OCRNL | ONLCR | ONLRET);
 ++stbuf.c_lflag = ~(ICANON | ECHO | ECHOE | ECHONL);
 ++stbuf.c_lflag = ~(ECHO | ECHOE);
 ++stbuf.c_cc[VMIN] = 1;
 ++stbuf.c_cc[VTIME] = 0;
 ++stbuf.c_cc[VEOF] = 1;
 +   }
 +   setenv(COMGTDEVICE,device,1);
 +-  ioctl(comfd, TCGETA, stbuf);
 +-  speed=stbuf.c_cflag  CBAUD;
 +-  if (high_speed == 0)  strcpy(cspeed,115200);
 +-  else strcpy(cspeed,57600);
 +-  bits=stbuf.c_cflag  CSIZE;
 +-  clocal=stbuf.c_cflag  CLOCAL;
 +-  stopbits=stbuf.c_cflag  CSTOPB;
 +-  parity=stbuf.c_cflag  (PARENB | PARODD);
 +-  stbuf.c_iflag = ~(IGNCR | ICRNL | IUCLC | INPCK | IXON | IXANY | IGNPAR 
 );
 +-  stbuf.c_oflag = ~(OPOST | OLCUC | OCRNL | ONLCR | ONLRET);
 +-  stbuf.c_lflag = ~(ICANON | ECHO | ECHOE | ECHONL);
 +-  stbuf.c_lflag = ~(ECHO | ECHOE);
 +-  stbuf.c_cc[VMIN] = 1;
 +-  stbuf.c_cc[VTIME] = 0;
 +-  stbuf.c_cc[VEOF] = 1;
 +   setcom();
 +   dormir(20); /* Wait a bit (DTR raise) */
 +   sprintf(msg,Opened %s as FD %d,device,comfd);
 +@@ -1302,45 +1313,50 @@ void opendevice(void) {
 + }
 +   }
 +   else comfd=0;
 +-
 +-  if (ioctl (comfd, TCGETA, svbuf)  0) {
 +-sprintf(msg,Can't ioctl get device %s.\n,device);
 +-serror(msg,1);
 +-  }
 +-  ioctl(comfd, TCGETA, stbuf);
 +-  speed=stbuf.c_cflag  CBAUD;
 +-  switch(speed) {
 +-case B0: strcpy(cspeed,0);break;
 +-case B50: strcpy(cspeed,50);break;
 +-case B75: strcpy(cspeed,75);break;
 +-case B110: strcpy(cspeed,110);break;
 +-case B300: strcpy(cspeed,300);break;
 +-case B600: strcpy(cspeed,600);break;
 +-case B1200: strcpy(cspeed,1200);break;
 +-case B2400: strcpy(cspeed,2400);break;
 +-case B4800: strcpy(cspeed,4800);break;
 +-case 

Re: [OpenWrt-Devel] [PATCH] Comgt: Add option to ignore ioctl errors

2015-01-08 Thread John Crispin


On 29/12/2014 17:54, Matti Laakso wrote:
 Some Huawei mobile broadband sticks utilizing the NCM protocol expose
 the control channel as a cdc-wdm device node instead of a virtual serial
 port. This device node does not support the serial port ioctls. Add command
 line option to not check whether ioctls are successful so that AT commands
 can also be sent to these devices.
 

can you instead of calling the ioctl and then ignoring the error change
it to not call the ioctls if the device is not a tty ?



 Signed-off-by: Matti Laakso malaa...@elisanet.fi
 ---
  .../utils/comgt/patches/004-add_force_option.patch | 66 
 ++
  1 file changed, 66 insertions(+)
  create mode 100644 
 package/network/utils/comgt/patches/004-add_force_option.patch
 
 diff --git a/package/network/utils/comgt/patches/004-add_force_option.patch 
 b/package/network/utils/comgt/patches/004-add_force_option.patch
 new file mode 100644
 index 000..1690e5c
 --- /dev/null
 +++ b/package/network/utils/comgt/patches/004-add_force_option.patch
 @@ -0,0 +1,66 @@
 +--- a/comgt.c
  b/comgt.c
 +@@ -91,6 +91,7 @@ unsigned long hstart,hset;
 + char NullString[]={  };
 + BOOL lastcharnl=1; /* Indicate that last char printed from getonebyte
 +was a nl, so no new one is needed */
 ++BOOL force=0;
 + 
 + 
 + //open com \/dev/modem\\nset com 38400n81\nset senddelay 0.05\nsend 
 \ATi^m\\nget 2 \ ^m\ $s\nprint \Response : \,$s,\\\n\\nget 2 \ ^m\ 
 $s\nprint \Response :\,$s,\\\n\\nget 2 \ ^m\ $s\nprint \Response : 
 \,$s,\\\n\\n\n;
 +@@ -920,7 +921,7 @@ BOOL getonoroff(void) {
 + void setcom(void) {
 +   stbuf.c_cflag = ~(CBAUD | CSIZE | CSTOPB | CLOCAL | PARENB);
 +   stbuf.c_cflag |= (speed | bits | CREAD | clocal | parity | stopbits );
 +-  if (ioctl(comfd, TCSETA, stbuf)  0) {
 ++  if (ioctl(comfd, TCSETA, stbuf)  0  !force) {
 + serror(Can't ioctl set device,1);
 +   }
 + }
 +@@ -1224,7 +1225,7 @@ void doclose(void) {
 +   if(strcmp(token,hardcom)==0) {
 + if(comfd== -1) serror(Com device not open,1);
 + vmsg(Closing device);
 +-if (ioctl(comfd, TCSETA, svbuf)  0) {
 ++if (ioctl(comfd, TCSETA, svbuf)  0  !force) {
 +   sprintf(msg,Can't ioctl set device %s.\n,device);
 +   serror(msg,1);
 + }
 +@@ -1266,7 +1267,7 @@ void opengt(void) {
 +   ext(1);
 + }
 +   }
 +-  if (ioctl (comfd, TCGETA, svbuf)  0) {
 ++  if (ioctl (comfd, TCGETA, svbuf)  0  !force) {
 + sprintf(msg,Can't control %s, please try again.\n,device);
 + serror(msg,1);
 +   }
 +@@ -1303,7 +1304,7 @@ void opendevice(void) {
 +   }
 +   else comfd=0;
 + 
 +-  if (ioctl (comfd, TCGETA, svbuf)  0) {
 ++  if (ioctl (comfd, TCGETA, svbuf)  0  !force) {
 + sprintf(msg,Can't ioctl get device %s.\n,device);
 + serror(msg,1);
 +   }
 +@@ -1567,7 +1568,7 @@ int main(int argc,char **argv) {
 +   for(a=0;astrlen(argv[0]);a++) {
 + if(argv[0][a]=='/') b=a+1;
 +   }
 +-  while((aa=getopt(argc,argv,xheVvd:t:sb:))!= -1) {
 ++  while((aa=getopt(argc,argv,xheVvd:t:sb:f))!= -1) {
 + switch(aa) {
 +   case 0:
 + ext(0);
 +@@ -1605,6 +1606,10 @@ int main(int argc,char **argv) {
 + printf(High speed overide (115200 is now 57600).\n);
 + high_speed =1;
 + break;
 ++  case 'f':
 ++force=1;
 ++vmsg(Ignoring ioctl errors);
 ++break;
 +   default:
 + ext(1);
 + }
 
___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


Re: [OpenWrt-Devel] [PATCH] comgt: add ncm proto support

2014-11-17 Thread Matti Laakso
Hi Sami,


Having an E3276 would be nice for developing this further. I have already a 
patch for comgt ready which allows it to be used with non-TTY device nodes 
(i.e., /dev/cdc-wdmX), I just need to test it before sending. Then I could dig 
further into netifd integration.


Matti___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


Re: [OpenWrt-Devel] [PATCH] comgt: add ncm proto support

2014-11-16 Thread Sami Olmari
Matti, would you like to have the Huawei e3276 for debugging this
after I get it back? Yours to keep if you want to :) Mine skills is
kinda not there with this, but need for working NCM is more than
needed for me :)

 Sami Olmari

On Sat, Nov 15, 2014 at 6:31 AM, John Crispin blo...@openwrt.org wrote:
 no and i will resend your device back to you next week

 On 14/11/2014 20:26, Sami Olmari wrote:
 I'm sorry to bother, but any luck with this? :) I have tried some
 stuff what Matti has suspected above the quirk is located at, but no
 good with mine coding skills :/

  Sami Olmari

 On Sun, Nov 9, 2014 at 11:49 AM, Matti Laakso malaa...@elisanet.fi wrote:
 Hi Jamie,

 On Thu, Oct 30, 2014 at 12:58:40PM +0200, Matti Laakso wrote:
 Hi Sami,

 Using John's version:

 config interface 'wan'
 option proto 'wwan'
 option apn 'opengate'
 #   option device '/dev/cdc-wdm0' (with or without commenting this)

 Does absolutely nothing, nothing in logread...

 However now when using

 config interface 'wan'
 option proto 'ncm'
 option apn 'opengate'
 option device '/dev/ttyUSB1'

 I believe that device should be /dev/cdc-wdm0 also here, at least
 when using huawei_cdc_ncm. The /dev/ttyUSBx terminals created by the
 option driver do not necessarily support all necessary AT-commands.
 Also, (at least when using proto ncm) you need to specify in
 addition

 option ifname wwan0

 That wasn't enough to get it to find the device for me for some
 reason. The following change to proto_ncm_setup does make it work:

   echo ncm[$$] Connected, starting DHCP
 - proto_init_update * 1
 + proto_init_update wwan0 1
   proto_send_update $interface

 For bringing the interface down the control device can't be found.
 The following change in proto_ncm_teardown makes that work:

   json_get_vars device
 +
 + device=/dev/ttyUSB0

   echo ncm[$$] Stopping network

 With the above two changes in place this all works fine. I don't know
 enough about how this is all meant to work to know why this is needed
 or why those configuration values are not making it to where they
 need to be.


 I suspect that the call to

 json_load $(cat /etc/gcom/ncm.json)

 in ncm.sh causes the interface information to get lost, so that subsequent
 json_* calls no longer work correctly. We should somehow unload ncm.json
 after the necessary AT-commands are read, and then restore normal
 interface information. Or can we read ncm.json into a separate namespace or
 something? Maybe Felix or Steven could give some advice?

 Matti
 ___
 openwrt-devel mailing list
 openwrt-devel@lists.openwrt.org
 https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel
___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


Re: [OpenWrt-Devel] [PATCH] comgt: add ncm proto support

2014-11-09 Thread Matti Laakso
Hi Jamie,

 On Thu, Oct 30, 2014 at 12:58:40PM +0200, Matti Laakso wrote:
  Hi Sami,
  
  Using John's version:
  
  config interface 'wan'
   option proto 'wwan'
   option apn 'opengate'
  #   option device '/dev/cdc-wdm0' (with or without commenting this)
  
  Does absolutely nothing, nothing in logread...
  
  However now when using
  
  config interface 'wan'
   option proto 'ncm'
   option apn 'opengate'
   option device '/dev/ttyUSB1'
  
  I believe that device should be /dev/cdc-wdm0 also here, at least
  when using huawei_cdc_ncm. The /dev/ttyUSBx terminals created by the
  option driver do not necessarily support all necessary AT-commands.
  Also, (at least when using proto ncm) you need to specify in
  addition
  
  option ifname wwan0

 That wasn't enough to get it to find the device for me for some
 reason. The following change to proto_ncm_setup does make it work:

   echo ncm[$$] Connected, starting DHCP
 - proto_init_update * 1
 + proto_init_update wwan0 1
   proto_send_update $interface

 For bringing the interface down the control device can't be found.
 The following change in proto_ncm_teardown makes that work:

   json_get_vars device
 +
 + device=/dev/ttyUSB0
  
   echo ncm[$$] Stopping network

 With the above two changes in place this all works fine. I don't know
 enough about how this is all meant to work to know why this is needed
 or why those configuration values are not making it to where they
 need to be.


I suspect that the call to 

json_load $(cat /etc/gcom/ncm.json)

in ncm.sh causes the interface information to get lost, so that subsequent
json_* calls no longer work correctly. We should somehow unload ncm.json
after the necessary AT-commands are read, and then restore normal 
interface information. Or can we read ncm.json into a separate namespace or
something? Maybe Felix or Steven could give some advice?

Matti
___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


Re: [OpenWrt-Devel] [PATCH] comgt: add ncm proto support

2014-11-05 Thread Sami Olmari
Shouldn't there be declared proto_config_add_string ifname somewhere
at the /lib/netifd/proto/ncm.sh ? and use that as argument somewhere
in here:

echo ncm[$$] Connected, starting DHCP
proto_init_update * 1
proto_send_update $interface

And something similar for teardown?

Sami Olmari

On Sun, Nov 2, 2014 at 9:34 AM, Jamie Lenehan lene...@twibble.org wrote:
 On Thu, Oct 30, 2014 at 12:58:40PM +0200, Matti Laakso wrote:
 Hi Sami,

 Using John's version:
 
 config interface 'wan'
  option proto 'wwan'
  option apn 'opengate'
 #   option device '/dev/cdc-wdm0' (with or without commenting this)
 
 Does absolutely nothing, nothing in logread...
 
 However now when using
 
 config interface 'wan'
  option proto 'ncm'
  option apn 'opengate'
  option device '/dev/ttyUSB1'

 I believe that device should be /dev/cdc-wdm0 also here, at least
 when using huawei_cdc_ncm. The /dev/ttyUSBx terminals created by the
 option driver do not necessarily support all necessary AT-commands.
 Also, (at least when using proto ncm) you need to specify in
 addition

 option ifname wwan0

 That wasn't enough to get it to find the device for me for some
 reason. The following change to proto_ncm_setup does make it work:

 echo ncm[$$] Connected, starting DHCP
 -   proto_init_update * 1
 +   proto_init_update wwan0 1
 proto_send_update $interface

 For bringing the interface down the control device can't be found.
 The following change in proto_ncm_teardown makes that work:

 json_get_vars device
 +
 +   device=/dev/ttyUSB0

 echo ncm[$$] Stopping network

 With the above two changes in place this all works fine. I don't know
 enough about how this is all meant to work to know why this is needed
 or why those configuration values are not making it to where they
 need to be.

 This is the configuration:

 config interface optus
 option proto 'ncm'
 option ifname 'wwan0'
 option device '/dev/ttyUSB0'
 option apn 'connect'
 option ip4table 'optus'

 The ip4table part didn't work either. I added this to proto_ncm_setup
 when setting up the dhcp sub-interface parameters to make it work:

 +   json_add_string ip4table optus

 [...]
 --
  Jamie Lenehan lene...@twibble.org
 ___
 openwrt-devel mailing list
 openwrt-devel@lists.openwrt.org
 https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel
___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


Re: [OpenWrt-Devel] [PATCH] comgt: add ncm proto support

2014-11-02 Thread Jamie Lenehan
On Thu, Oct 30, 2014 at 12:58:40PM +0200, Matti Laakso wrote:
 Hi Sami,
 
 Using John's version:
 
 config interface 'wan'
  option proto 'wwan'
  option apn 'opengate'
 #   option device '/dev/cdc-wdm0' (with or without commenting this)
 
 Does absolutely nothing, nothing in logread...
 
 However now when using
 
 config interface 'wan'
  option proto 'ncm'
  option apn 'opengate'
  option device '/dev/ttyUSB1'
 
 I believe that device should be /dev/cdc-wdm0 also here, at least
 when using huawei_cdc_ncm. The /dev/ttyUSBx terminals created by the
 option driver do not necessarily support all necessary AT-commands.
 Also, (at least when using proto ncm) you need to specify in
 addition
 
 option ifname wwan0

That wasn't enough to get it to find the device for me for some
reason. The following change to proto_ncm_setup does make it work:

echo ncm[$$] Connected, starting DHCP
-   proto_init_update * 1
+   proto_init_update wwan0 1
proto_send_update $interface

For bringing the interface down the control device can't be found.
The following change in proto_ncm_teardown makes that work:

json_get_vars device
+
+   device=/dev/ttyUSB0
 
echo ncm[$$] Stopping network

With the above two changes in place this all works fine. I don't know
enough about how this is all meant to work to know why this is needed
or why those configuration values are not making it to where they
need to be.

This is the configuration:

config interface optus
option proto 'ncm'
option ifname 'wwan0'
option device '/dev/ttyUSB0'
option apn 'connect'
option ip4table 'optus'

The ip4table part didn't work either. I added this to proto_ncm_setup
when setting up the dhcp sub-interface parameters to make it work:

+   json_add_string ip4table optus

[...]
-- 
 Jamie Lenehan lene...@twibble.org
___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


Re: [OpenWrt-Devel] [PATCH] comgt: add ncm proto support

2014-10-30 Thread Matti Laakso

Hi Sami,


Using John's version:

config interface 'wan'
 option proto 'wwan'
 option apn 'opengate'
#   option device '/dev/cdc-wdm0' (with or without commenting this)

Does absolutely nothing, nothing in logread...

However now when using

config interface 'wan'
 option proto 'ncm'
 option apn 'opengate'
 option device '/dev/ttyUSB1'


I believe that device should be /dev/cdc-wdm0 also here, at least when 
using huawei_cdc_ncm. The /dev/ttyUSBx terminals created by the option 
driver do not necessarily support all necessary AT-commands. Also, (at 
least when using proto ncm) you need to specify in addition


option ifname wwan0

Missing this could lead to the errors below.

Matti



I see the Huawei dongle actually connects, as in the light lits up and
stays, indicating connection is made, but no wwan0 nor any other
interface at openwrt, also some erros still on logread:

Wed Oct 29 18:50:34 2014 kern.info kernel: [ 1174.74] usb 1-1.3:
new high-speed USB device number 5 using ehci-platform
Wed Oct 29 18:50:35 2014 kern.info kernel: [ 1175.45] usb 1-1.3:
USB disconnect, device number 5
Wed Oct 29 18:50:35 2014 kern.info kernel: [ 1175.78] usb 1-1.3:
new high-speed USB device number 6 using ehci-platform
Wed Oct 29 18:50:35 2014 kern.info kernel: [ 1175.91] option
1-1.3:1.0: GSM modem (1-port) converter detected
Wed Oct 29 18:50:35 2014 kern.info kernel: [ 1175.92] usb 1-1.3:
GSM modem (1-port) converter now attached to ttyUSB0
Wed Oct 29 18:50:35 2014 kern.info kernel: [ 1175.93] option
1-1.3:1.1: GSM modem (1-port) converter detected
Wed Oct 29 18:50:35 2014 kern.info kernel: [ 1175.96] usb 1-1.3:
GSM modem (1-port) converter now attached to ttyUSB1
Wed Oct 29 18:50:35 2014 kern.info kernel: [ 1175.97]
huawei_cdc_ncm 1-1.3:1.2: MAC-Address: 0c:5b:8f:27:9a:64
Wed Oct 29 18:50:35 2014 kern.info kernel: [ 1175.98]
huawei_cdc_ncm 1-1.3:1.2: cdc-wdm0: USB WDM device
Wed Oct 29 18:50:35 2014 kern.info kernel: [ 1175.99]
huawei_cdc_ncm 1-1.3:1.2 wwan0: register 'huawei_cdc_ncm' at
usb-ehci-platform-1.3, Huawei CDC NCM device, 0c:5b:8f:27:9a:64

(ifup wan here)

Wed Oct 29 18:51:00 2014 daemon.notice netifd: Interface 'wan' is setting up now

(somewhere close time to the next line the dongles light lits up steady)

Wed Oct 29 18:51:08 2014 daemon.notice netifd: wan (5097): ncm[5097]
Connected, starting DHCP
Wed Oct 29 18:51:08 2014 daemon.notice netifd: wan (5097): Command
failed: Invalid argument
Wed Oct 29 18:51:08 2014 daemon.notice netifd: wan (5097): Command
failed: Unknown error
Wed Oct 29 18:51:08 2014 daemon.notice netifd: wan (5097): Command
failed: Unknown error

No interface appears on openwrt...

Also after this, ifdown wan doesn't tear the connection down (light
stays up). So somethign works to the point dongle itself get's
connected, but clearly something doesn't work still... This is on
ar71xx platform with 3.14 kernel...

___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


Re: [OpenWrt-Devel] [PATCH] comgt: add ncm proto support

2014-10-30 Thread Sami Olmari
okay:

config interface 'wan'
option ifname 'wwan0'
option proto 'ncm'
option apn 'opengate'
option device '/dev/cdc-wdm0'

Thu Oct 30 21:06:18 2014 daemon.notice netifd: wan (2446): comgt
21:06:18 - -- Error Report --
Thu Oct 30 21:06:18 2014 daemon.notice netifd: wan (2446): comgt
21:06:18 -    ^
Thu Oct 30 21:06:18 2014 daemon.notice netifd: wan (2446): comgt
21:06:18 - Error @6, line 1, Can't control /dev/cdc-wdm0, please try
again.
Thu Oct 30 21:06:18 2014 daemon.notice netifd: wan (2446): . (1)
Thu Oct 30 21:06:18 2014 daemon.notice netifd: wan (2446):
Thu Oct 30 21:06:18 2014 user.notice firewall: Reloading firewall due
to ifup of lan (br-lan)
Thu Oct 30 21:06:18 2014 daemon.notice netifd: wan (2446): comgt
21:06:18 - -- Error Report --
Thu Oct 30 21:06:18 2014 daemon.notice netifd: wan (2446): comgt
21:06:18 -    ^
Thu Oct 30 21:06:18 2014 daemon.notice netifd: wan (2446): comgt
21:06:18 - Error @40, line 2, Can't control /dev/cdc-wdm0, please try
again.
Thu Oct 30 21:06:18 2014 daemon.notice netifd: wan (2446): . (1)
Thu Oct 30 21:06:18 2014 daemon.notice netifd: wan (2446):
Thu Oct 30 21:06:18 2014 daemon.notice netifd: wan (2446): ncm[2446]
Failed to connect
Thu Oct 30 21:06:18 2014 daemon.notice netifd: wan (2502): Command
failed: Permission denied
Thu Oct 30 21:06:18 2014 daemon.notice netifd: wan (2502): ncm[2502]
Stopping network
Thu Oct 30 21:06:19 2014 daemon.notice netifd: wan (2502): Can't open device .
Thu Oct 30 21:06:19 2014 daemon.notice netifd: wan (2502): ncm[2502]
Failed to disconnect
Thu Oct 30 21:06:19 2014 daemon.notice netifd: Interface 'wan' is now down

and no connection, then:

config interface 'wan'
option ifname 'wwan0'
option proto 'ncm'
option apn 'opengate'
option device '/dev/ttyUSB1' (this is correct port when
using Oskari Rauta's original code, running on main router)

Thu Oct 30 21:09:46 2014 daemon.notice netifd: Interface 'wan' is setting up now
Thu Oct 30 21:09:54 2014 daemon.notice netifd: wan (3253): ncm[3253]
Connected, starting DHCP
Thu Oct 30 21:09:54 2014 daemon.notice netifd: wan (3253): Command
failed: Invalid argument
Thu Oct 30 21:09:54 2014 daemon.notice netifd: wan (3253): Command
failed: Unknown error
Thu Oct 30 21:09:54 2014 daemon.notice netifd: wan (3253): Command
failed: Unknown error

Also behaviour is quite similar to mine previous email, Huawei's light
stays lit, but no wwan0 etc available...

Also, if I then run first ifconfig wwan0 up and then dhclient -i
wwan0 I get IP for wwan0 and internet works! can ping and use SSH to
remote location... So this must be something small typo or so
somewhere deep in scripts?!

 Sami Olmari


On Thu, Oct 30, 2014 at 12:58 PM, Matti Laakso malaa...@elisanet.fi wrote:
 Hi Sami,

 Using John's version:

 config interface 'wan'
  option proto 'wwan'
  option apn 'opengate'
 #   option device '/dev/cdc-wdm0' (with or without commenting this)

 Does absolutely nothing, nothing in logread...

 However now when using

 config interface 'wan'
  option proto 'ncm'
  option apn 'opengate'
  option device '/dev/ttyUSB1'


 I believe that device should be /dev/cdc-wdm0 also here, at least when using
 huawei_cdc_ncm. The /dev/ttyUSBx terminals created by the option driver do
 not necessarily support all necessary AT-commands. Also, (at least when
 using proto ncm) you need to specify in addition

 option ifname wwan0

 Missing this could lead to the errors below.

 Matti



 I see the Huawei dongle actually connects, as in the light lits up and
 stays, indicating connection is made, but no wwan0 nor any other
 interface at openwrt, also some erros still on logread:

 Wed Oct 29 18:50:34 2014 kern.info kernel: [ 1174.74] usb 1-1.3:
 new high-speed USB device number 5 using ehci-platform
 Wed Oct 29 18:50:35 2014 kern.info kernel: [ 1175.45] usb 1-1.3:
 USB disconnect, device number 5
 Wed Oct 29 18:50:35 2014 kern.info kernel: [ 1175.78] usb 1-1.3:
 new high-speed USB device number 6 using ehci-platform
 Wed Oct 29 18:50:35 2014 kern.info kernel: [ 1175.91] option
 1-1.3:1.0: GSM modem (1-port) converter detected
 Wed Oct 29 18:50:35 2014 kern.info kernel: [ 1175.92] usb 1-1.3:
 GSM modem (1-port) converter now attached to ttyUSB0
 Wed Oct 29 18:50:35 2014 kern.info kernel: [ 1175.93] option
 1-1.3:1.1: GSM modem (1-port) converter detected
 Wed Oct 29 18:50:35 2014 kern.info kernel: [ 1175.96] usb 1-1.3:
 GSM modem (1-port) converter now attached to ttyUSB1
 Wed Oct 29 18:50:35 2014 kern.info kernel: [ 1175.97]
 huawei_cdc_ncm 1-1.3:1.2: MAC-Address: 0c:5b:8f:27:9a:64
 Wed Oct 29 18:50:35 2014 kern.info kernel: [ 1175.98]
 huawei_cdc_ncm 1-1.3:1.2: cdc-wdm0: USB WDM device
 Wed Oct 29 18:50:35 2014 kern.info kernel: [ 1175.99]
 huawei_cdc_ncm 1-1.3:1.2 wwan0: register 'huawei_cdc_ncm' at
 usb-ehci-platform-1.3, Huawei CDC NCM device, 0c:5b:8f:27:9a:64

 

Re: [OpenWrt-Devel] [PATCH] comgt: add ncm proto support

2014-10-29 Thread Sami Olmari
Using John's version:

config interface 'wan'
option proto 'wwan'
option apn 'opengate'
#   option device '/dev/cdc-wdm0' (with or without commenting this)

Does absolutely nothing, nothing in logread...

However now when using

config interface 'wan'
option proto 'ncm'
option apn 'opengate'
option device '/dev/ttyUSB1'

I see the Huawei dongle actually connects, as in the light lits up and
stays, indicating connection is made, but no wwan0 nor any other
interface at openwrt, also some erros still on logread:

Wed Oct 29 18:50:34 2014 kern.info kernel: [ 1174.74] usb 1-1.3:
new high-speed USB device number 5 using ehci-platform
Wed Oct 29 18:50:35 2014 kern.info kernel: [ 1175.45] usb 1-1.3:
USB disconnect, device number 5
Wed Oct 29 18:50:35 2014 kern.info kernel: [ 1175.78] usb 1-1.3:
new high-speed USB device number 6 using ehci-platform
Wed Oct 29 18:50:35 2014 kern.info kernel: [ 1175.91] option
1-1.3:1.0: GSM modem (1-port) converter detected
Wed Oct 29 18:50:35 2014 kern.info kernel: [ 1175.92] usb 1-1.3:
GSM modem (1-port) converter now attached to ttyUSB0
Wed Oct 29 18:50:35 2014 kern.info kernel: [ 1175.93] option
1-1.3:1.1: GSM modem (1-port) converter detected
Wed Oct 29 18:50:35 2014 kern.info kernel: [ 1175.96] usb 1-1.3:
GSM modem (1-port) converter now attached to ttyUSB1
Wed Oct 29 18:50:35 2014 kern.info kernel: [ 1175.97]
huawei_cdc_ncm 1-1.3:1.2: MAC-Address: 0c:5b:8f:27:9a:64
Wed Oct 29 18:50:35 2014 kern.info kernel: [ 1175.98]
huawei_cdc_ncm 1-1.3:1.2: cdc-wdm0: USB WDM device
Wed Oct 29 18:50:35 2014 kern.info kernel: [ 1175.99]
huawei_cdc_ncm 1-1.3:1.2 wwan0: register 'huawei_cdc_ncm' at
usb-ehci-platform-1.3, Huawei CDC NCM device, 0c:5b:8f:27:9a:64

(ifup wan here)

Wed Oct 29 18:51:00 2014 daemon.notice netifd: Interface 'wan' is setting up now

(somewhere close time to the next line the dongles light lits up steady)

Wed Oct 29 18:51:08 2014 daemon.notice netifd: wan (5097): ncm[5097]
Connected, starting DHCP
Wed Oct 29 18:51:08 2014 daemon.notice netifd: wan (5097): Command
failed: Invalid argument
Wed Oct 29 18:51:08 2014 daemon.notice netifd: wan (5097): Command
failed: Unknown error
Wed Oct 29 18:51:08 2014 daemon.notice netifd: wan (5097): Command
failed: Unknown error

No interface appears on openwrt...

Also after this, ifdown wan doesn't tear the connection down (light
stays up). So somethign works to the point dongle itself get's
connected, but clearly something doesn't work still... This is on
ar71xx platform with 3.14 kernel...

 Sami Olmari


On Sun, Oct 26, 2014 at 7:07 PM, John Crispin blo...@openwrt.org wrote:
 *cough* fixed in r43071

 On 26/10/2014 15:06, Matti Laakso wrote:
 Hi Sami,

 Well this is what John told me:

 try /dev/cdc-wdm0 as a device or simply do

 config interface
 option proto wwan
 option apn opengate

 the new wwan proto will automagically detect your needed prot and device


 I had also tried this and variations, but same resuls:

 config interface 'wan'
 option proto 'ncm'
 option apn 'opengate'
 option device '/dev/ttyUSB1'

 Mon Oct 20 12:46:52 2014 daemon.notice netifd: wan (4251): Timeout
 running AT-command
 Mon Oct 20 12:46:52 2014 daemon.notice netifd: wan (4251): ncm[4251]
 Failed to initialize modem
 Mon Oct 20 12:46:52 2014 daemon.notice netifd: wan (4401): Command
 failed: Permission denied
 Mon Oct 20 12:46:52 2014 daemon.notice netifd: wan (4401): ncm[4401]
 Stopping network
 Mon Oct 20 12:46:52 2014 daemon.notice netifd: wan (4401): Can't open 
 device .
 Mon Oct 20 12:46:52 2014 daemon.notice netifd: wan (4401): ncm[4401]
 Failed to disconnect
 Mon Oct 20 12:46:52 2014 daemon.notice netifd: Interface 'wan' is now down

 I think John introduced a typo when committing my patch:
 in file package/network/utils/comgt/files/runcommand.gcom on line 11
 there is

 send ^n

 which should be

 send ^m

 Try to change that.

 Matti


 On Thu, Oct 23, 2014 at 10:20 AM, Bjørn Mork bjorn at mork.no 
 https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel wrote:
 / Sami Olmari sami at olmari.fi 
 https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel writes:
 //
 // option proto 'wwan'
 //
 // I don't know much about how this is supposed to work (don't have any
 // Huawei NCM modem), but I do see this in the patch posted earlier in this
 // thread:
 //
 // diff --git a/package/network/utils/comgt/files/3g.usb
 // b/package/network/utils/comgt/files/3g.usb
 // index fd6837e..ac8326b 100644
 // --- a/package/network/utils/comgt/files/3g.usb
 // +++ b/package/network/utils/comgt/files/3g.usb
 // @@ -8,7 +8,7 @@ find_3g_iface() {
 //
 //   local proto
 //   config_get proto $cfg proto
 // - [ $proto = 3g ] || return 0
 // + [ $proto = 3g ] || [ $proto = ncm ] || return 0
 //
 //   # bypass state vars here because 00-netstate could clobber 
 .device
 //   local dev=$(uci_get network 

Re: [OpenWrt-Devel] [PATCH] comgt: add ncm proto support

2014-10-26 Thread Matti Laakso
Hi Sami,

 Well this is what John told me:

 try /dev/cdc-wdm0 as a device or simply do

 config interface
 option proto wwan
 option apn opengate

 the new wwan proto will automagically detect your needed prot and device


 I had also tried this and variations, but same resuls:

 config interface 'wan'
 option proto 'ncm'
 option apn 'opengate'
 option device '/dev/ttyUSB1'

 Mon Oct 20 12:46:52 2014 daemon.notice netifd: wan (4251): Timeout
 running AT-command
 Mon Oct 20 12:46:52 2014 daemon.notice netifd: wan (4251): ncm[4251]
 Failed to initialize modem
 Mon Oct 20 12:46:52 2014 daemon.notice netifd: wan (4401): Command
 failed: Permission denied
 Mon Oct 20 12:46:52 2014 daemon.notice netifd: wan (4401): ncm[4401]
 Stopping network
 Mon Oct 20 12:46:52 2014 daemon.notice netifd: wan (4401): Can't open device .
 Mon Oct 20 12:46:52 2014 daemon.notice netifd: wan (4401): ncm[4401]
 Failed to disconnect
 Mon Oct 20 12:46:52 2014 daemon.notice netifd: Interface 'wan' is now down

I think John introduced a typo when committing my patch:
in file package/network/utils/comgt/files/runcommand.gcom on line 11
there is

send ^n

which should be

send ^m

Try to change that.

Matti


 On Thu, Oct 23, 2014 at 10:20 AM, Bjørn Mork bjorn at mork.no 
 https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel wrote:
 / Sami Olmari sami at olmari.fi 
 https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel writes:
 //
 // option proto 'wwan'
 //
 // I don't know much about how this is supposed to work (don't have any
 // Huawei NCM modem), but I do see this in the patch posted earlier in this
 // thread:
 //
 // diff --git a/package/network/utils/comgt/files/3g.usb
 // b/package/network/utils/comgt/files/3g.usb
 // index fd6837e..ac8326b 100644
 // --- a/package/network/utils/comgt/files/3g.usb
 // +++ b/package/network/utils/comgt/files/3g.usb
 // @@ -8,7 +8,7 @@ find_3g_iface() {
 //
 //   local proto
 //   config_get proto $cfg proto
 // - [ $proto = 3g ] || return 0
 // + [ $proto = 3g ] || [ $proto = ncm ] || return 0
 //
 //   # bypass state vars here because 00-netstate could clobber .device
 //   local dev=$(uci_get network $cfg device)
 //
 //
 // which might explain stuff?
 //
 //
 // Bjørn/
___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


Re: [OpenWrt-Devel] [PATCH] comgt: add ncm proto support

2014-10-26 Thread John Crispin
*cough* fixed in r43071

On 26/10/2014 15:06, Matti Laakso wrote:
 Hi Sami,
 
 Well this is what John told me:

 try /dev/cdc-wdm0 as a device or simply do

 config interface
 option proto wwan
 option apn opengate

 the new wwan proto will automagically detect your needed prot and device


 I had also tried this and variations, but same resuls:

 config interface 'wan'
 option proto 'ncm'
 option apn 'opengate'
 option device '/dev/ttyUSB1'

 Mon Oct 20 12:46:52 2014 daemon.notice netifd: wan (4251): Timeout
 running AT-command
 Mon Oct 20 12:46:52 2014 daemon.notice netifd: wan (4251): ncm[4251]
 Failed to initialize modem
 Mon Oct 20 12:46:52 2014 daemon.notice netifd: wan (4401): Command
 failed: Permission denied
 Mon Oct 20 12:46:52 2014 daemon.notice netifd: wan (4401): ncm[4401]
 Stopping network
 Mon Oct 20 12:46:52 2014 daemon.notice netifd: wan (4401): Can't open device 
 .
 Mon Oct 20 12:46:52 2014 daemon.notice netifd: wan (4401): ncm[4401]
 Failed to disconnect
 Mon Oct 20 12:46:52 2014 daemon.notice netifd: Interface 'wan' is now down
 
 I think John introduced a typo when committing my patch:
 in file package/network/utils/comgt/files/runcommand.gcom on line 11
 there is
 
 send ^n
 
 which should be
 
 send ^m
 
 Try to change that.
 
 Matti
 

 On Thu, Oct 23, 2014 at 10:20 AM, Bjørn Mork bjorn at mork.no 
 https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel wrote:
 / Sami Olmari sami at olmari.fi 
 https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel writes:
 //
 // option proto 'wwan'
 //
 // I don't know much about how this is supposed to work (don't have any
 // Huawei NCM modem), but I do see this in the patch posted earlier in this
 // thread:
 //
 // diff --git a/package/network/utils/comgt/files/3g.usb
 // b/package/network/utils/comgt/files/3g.usb
 // index fd6837e..ac8326b 100644
 // --- a/package/network/utils/comgt/files/3g.usb
 // +++ b/package/network/utils/comgt/files/3g.usb
 // @@ -8,7 +8,7 @@ find_3g_iface() {
 //
 //   local proto
 //   config_get proto $cfg proto
 // - [ $proto = 3g ] || return 0
 // + [ $proto = 3g ] || [ $proto = ncm ] || return 0
 //
 //   # bypass state vars here because 00-netstate could clobber .device
 //   local dev=$(uci_get network $cfg device)
 //
 //
 // which might explain stuff?
 //
 //
 // Bjørn/
 
 
 ___
 openwrt-devel mailing list
 openwrt-devel@lists.openwrt.org
 https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel
 
___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


Re: [OpenWrt-Devel] [PATCH] comgt: add ncm proto support

2014-10-24 Thread Sami Olmari
Well this is what John told me:

try /dev/cdc-wdm0 as a device or simply do

config interface
option proto wwan
option apn opengate

the new wwan proto will automagically detect your needed prot and device


I had also tried this and variations, but same resuls:

config interface 'wan'
option proto 'ncm'
option apn 'opengate'
option device '/dev/ttyUSB1'

Mon Oct 20 12:46:52 2014 daemon.notice netifd: wan (4251): Timeout
running AT-command
Mon Oct 20 12:46:52 2014 daemon.notice netifd: wan (4251): ncm[4251]
Failed to initialize modem
Mon Oct 20 12:46:52 2014 daemon.notice netifd: wan (4401): Command
failed: Permission denied
Mon Oct 20 12:46:52 2014 daemon.notice netifd: wan (4401): ncm[4401]
Stopping network
Mon Oct 20 12:46:52 2014 daemon.notice netifd: wan (4401): Can't open device .
Mon Oct 20 12:46:52 2014 daemon.notice netifd: wan (4401): ncm[4401]
Failed to disconnect
Mon Oct 20 12:46:52 2014 daemon.notice netifd: Interface 'wan' is now down

 Sami Olmari

On Thu, Oct 23, 2014 at 10:20 AM, Bjørn Mork bj...@mork.no wrote:
 Sami Olmari s...@olmari.fi writes:

 option proto 'wwan'

 I don't know much about how this is supposed to work (don't have any
 Huawei NCM modem), but I do see this in the patch posted earlier in this
 thread:

 diff --git a/package/network/utils/comgt/files/3g.usb
 b/package/network/utils/comgt/files/3g.usb
 index fd6837e..ac8326b 100644
 --- a/package/network/utils/comgt/files/3g.usb
 +++ b/package/network/utils/comgt/files/3g.usb
 @@ -8,7 +8,7 @@ find_3g_iface() {

   local proto
   config_get proto $cfg proto
 - [ $proto = 3g ] || return 0
 + [ $proto = 3g ] || [ $proto = ncm ] || return 0

   # bypass state vars here because 00-netstate could clobber .device
   local dev=$(uci_get network $cfg device)


 which might explain stuff?


 Bjørn
___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


Re: [OpenWrt-Devel] [PATCH] comgt: add ncm proto support

2014-10-24 Thread Bjørn Mork
Sami Olmari s...@olmari.fi writes:

 Well this is what John told me:

 try /dev/cdc-wdm0 as a device or simply do

 config interface
 option proto wwan
 option apn opengate

 the new wwan proto will automagically detect your needed prot and device

Ah, right.  So I am only confusing things with my wild guessing.


 I had also tried this and variations, but same resuls:

 config interface 'wan'
 option proto 'ncm'
 option apn 'opengate'
 option device '/dev/ttyUSB1'

 Mon Oct 20 12:46:52 2014 daemon.notice netifd: wan (4251): Timeout
 running AT-command
 Mon Oct 20 12:46:52 2014 daemon.notice netifd: wan (4251): ncm[4251]
 Failed to initialize modem
 Mon Oct 20 12:46:52 2014 daemon.notice netifd: wan (4401): Command
 failed: Permission denied
 Mon Oct 20 12:46:52 2014 daemon.notice netifd: wan (4401): ncm[4401]
 Stopping network
 Mon Oct 20 12:46:52 2014 daemon.notice netifd: wan (4401): Can't open device .


Can't open device . sounds wrong.  Shouldn't that at least give a
device name?



Bjørn
___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


Re: [OpenWrt-Devel] [PATCH] comgt: add ncm proto support

2014-10-23 Thread Bjørn Mork
Sami Olmari s...@olmari.fi writes:

 option proto 'wwan'

I don't know much about how this is supposed to work (don't have any
Huawei NCM modem), but I do see this in the patch posted earlier in this
thread:

 diff --git a/package/network/utils/comgt/files/3g.usb 
 b/package/network/utils/comgt/files/3g.usb
 index fd6837e..ac8326b 100644
 --- a/package/network/utils/comgt/files/3g.usb
 +++ b/package/network/utils/comgt/files/3g.usb
 @@ -8,7 +8,7 @@ find_3g_iface() {
  
   local proto
   config_get proto $cfg proto
 - [ $proto = 3g ] || return 0
 + [ $proto = 3g ] || [ $proto = ncm ] || return 0
  
   # bypass state vars here because 00-netstate could clobber .device
   local dev=$(uci_get network $cfg device)


which might explain stuff?


Bjørn
___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


Re: [OpenWrt-Devel] [PATCH] comgt: add ncm proto support

2014-10-09 Thread John Crispin


On 09/10/2014 14:14, Bjørn Mork wrote:
 Conor O'Gorman i...@conorogorman.net writes:
 On 08/10/14 11:00, John Crispin wrote:
 the e3267 that sami sent me works with this proto, but i am
 failing to get a DHCP addr. could someone with a ncm dongle
 please try this patch on top of latest trunk please and tell me
 if they are getting a dhcp addr ?
 
 I had a similar problem with a Huawei device. It worked after
 removing some zero padding in the ncm driver.
 
 In cdc_ncm.c, cdc_ncm_fill_tx_frame(), towards the end there is 
 handling for Zero Length Packets (ZLP) and padding short packets.
 I removed the padding, and it worked. Are you testing 3.10 or
 3.14? It's changed ever so slightly between them.
 
 I am somewhat confused by the comment. It won't pad out short
 packets, but does make shortish packets long.
 
 I don't have an fix for this bug, but I can try to add some
 background wrt the driver code...
 
 The NCM protocol assumes a powerful host and a much less powerful
 device (modem).  It also assumes that devices can operate more
 efficiently if all (or most) packets have the same length, enabling
 the device DMA engine to operate on its own without involving the
 device CPU. These assumptions were true for all NCM devices and
 hosts implemented at the time the protocol was finalized.  They are
 not necessarily true today. But we still have to deal with those
 assumptions somehow.
 
 One of the implications of this is that the device will operate
 more efficiently if the host pads packets the maximum length.  On
 the other hand, this padding does of course cost extra bandwidth
 and buffer usage, so there is some cutoff point for really short
 packets.  This is CDC_NCM_MIN_TX_PKT (512 bytes in the current NCM
 linux driver).
 
 So if a NCM packet exceeds 512 bytes then it is padded to max
 size. This maximum size is decided by the device (i.e. modem), but
 sanitized by the Linux driver.  Most traditional NCM devices have
 buffers in the order of 4 or 8kB, which limits the overhead caused
 by the padding somewhat.  But some Huawei devices have much larger
 buffers, causing an insane padding overhead given the fixed 512
 bytes cutoff even if the driver sanitize the values somewhat.  This
 is one of the issues I tried to fix in Linux v3.16.  Whether it was
 successful remains to be seen, but at least v3.16 gives us (the
 users) a lot more control over the process by adding a few
 tunables.  And some informational attributes as well.
 
 This is an example from v3.16+ (with an MBIM device, but the code
 and issues are both common):
 
 bjorn@nemi:~$ grep . /sys/class/net/wwan0/cdc_ncm/* 
 /sys/class/net/wwan0/cdc_ncm/bmNtbFormatsSupported:0x0001 
 /sys/class/net/wwan0/cdc_ncm/dwNtbInMaxSize:15360 
 /sys/class/net/wwan0/cdc_ncm/dwNtbOutMaxSize:15360 
 /sys/class/net/wwan0/cdc_ncm/min_tx_pkt:13824 
 /sys/class/net/wwan0/cdc_ncm/rx_max:15360 
 /sys/class/net/wwan0/cdc_ncm/tx_max:15360 
 /sys/class/net/wwan0/cdc_ncm/tx_timer_usecs:400 
 /sys/class/net/wwan0/cdc_ncm/wNdpInAlignment:4 
 /sys/class/net/wwan0/cdc_ncm/wNdpInDivisor:1 
 /sys/class/net/wwan0/cdc_ncm/wNdpInPayloadRemainder:0 
 /sys/class/net/wwan0/cdc_ncm/wNdpOutAlignment:4 
 /sys/class/net/wwan0/cdc_ncm/wNdpOutDivisor:32 
 /sys/class/net/wwan0/cdc_ncm/wNdpOutPayloadRemainder:0 
 /sys/class/net/wwan0/cdc_ncm/wNtbOutMaxDatagrams:32
 
 
 Here you can see the device specified TX and RX buffer sizes 
 (dwNtb*MaxSize) and also the buffers sizes currently in use by
 the driver (rx_max/tx_max).  And finally the min_tx_pkt
 attribute, which has replaced the fixed CDC_NCM_MIN_TX_PKT.  This
 is now dynamically calculated based on rx_max, and, as you can see
 from the values above, not causing that much overhead.
 
 Here's an example from a Huawei device (also MBIM), where the
 driver has sanitized the insane 128 kB buffer to 16 kB.
 
 bjorn@nemi:~$ grep . /sys/class/net/wwan1/cdc_ncm/* 
 /sys/class/net/wwan1/cdc_ncm/bmNtbFormatsSupported:0x0003 
 /sys/class/net/wwan1/cdc_ncm/dwNtbInMaxSize:131072 
 /sys/class/net/wwan1/cdc_ncm/dwNtbOutMaxSize:32768 
 /sys/class/net/wwan1/cdc_ncm/min_tx_pkt:14849 
 /sys/class/net/wwan1/cdc_ncm/rx_max:16384 
 /sys/class/net/wwan1/cdc_ncm/tx_max:16385 
 /sys/class/net/wwan1/cdc_ncm/tx_timer_usecs:400 
 /sys/class/net/wwan1/cdc_ncm/wNdpInAlignment:4 
 /sys/class/net/wwan1/cdc_ncm/wNdpInDivisor:4 
 /sys/class/net/wwan1/cdc_ncm/wNdpInPayloadRemainder:0 
 /sys/class/net/wwan1/cdc_ncm/wNdpOutAlignment:4 
 /sys/class/net/wwan1/cdc_ncm/wNdpOutDivisor:4 
 /sys/class/net/wwan1/cdc_ncm/wNdpOutPayloadRemainder:0 
 /sys/class/net/wwan1/cdc_ncm/wNtbOutMaxDatagrams:0
 
 And the last example from a device with extremely small buffers:
 
 bjorn@nemi:~$ grep . /sys/class/net/wwan2/cdc_ncm/* 
 /sys/class/net/wwan2/cdc_ncm/bmNtbFormatsSupported:0x0001 
 /sys/class/net/wwan2/cdc_ncm/dwNtbInMaxSize:2048 
 /sys/class/net/wwan2/cdc_ncm/dwNtbOutMaxSize:2048 
 /sys/class/net/wwan2/cdc_ncm/min_tx_pkt:512 
 /sys/class/net/wwan2/cdc_ncm/rx_max:2048 
 

Re: [OpenWrt-Devel] [PATCH] comgt: add ncm proto support

2014-10-09 Thread Bjørn Mork
John Crispin blo...@openwrt.org writes:

 ok, i am currently bumping some targets to v3.17. lets assume it is
 broken for  3.16 and hope 3.17 works.

 NCM seems to be broken by design and only a container as each dongle
 apparently uses its own AT magic. at least between Motorola, Sony and
 Huawei they are totally different.

Yes, the lack of a standardized management protocol is one of the NCM
shortcomings which were solved by MBIM (which started out as NCM 2.0).

 personally i have been using mbim since i wrote umbim and it just works :)

Good to hear :-)

 thanks for the insight, lets hope it works after the kernel bump

It should at least allow us to try out a few things on the fly without
having to rebuild the driver.

One thing I forgot to mention is that you can completely disable the
padding in v3.16+ by setting min_tx_pkt = tx_max.  And these
settings can be changed while the modem is actively in use
(i.e. connected).


Bjørn
___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


Re: [OpenWrt-Devel] [PATCH] comgt: add ncm proto support

2014-10-09 Thread Conor O'Gorman

On 09/10/14 13:25, John Crispin wrote:


personally i have been using mbim since i wrote umbim and it just works :)



Ah, nice. I have some similar code, but in lua, from the json files. 
It's only a management protocol.


Note that MBIM uses the NCM code for the bulk packet data, so it's 
packetising is still in play.


Conor
___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


Re: [OpenWrt-Devel] [PATCH] comgt: add ncm proto support

2014-10-09 Thread Bjørn Mork
Conor O'Gorman i...@conorogorman.net writes:
 On 09/10/14 13:25, John Crispin wrote:

 personally i have been using mbim since i wrote umbim and it just works :)


 Ah, nice. I have some similar code, but in lua, from the json
 files. It's only a management protocol.

 Note that MBIM uses the NCM code for the bulk packet data, so it's
 packetising is still in play.

Except that bugs in some MBIM implementations forced us to change the
default to always send ZLPs for MBIM devices.  See the comment starting
at 
https://git.kernel.org/cgit/linux/kernel/git/torvalds/linux.git/tree/drivers/net/usb/cdc_mbim.c#n561

And since the padding is pointless if followed by a ZLP, it was disabled
for all devices where we send ZLPs:
https://git.kernel.org/cgit/linux/kernel/git/torvalds/linux.git/tree/drivers/net/usb/cdc_ncm.c#n1162

So effectively:  No, we do not do the padding for (most) MBIM devices.

Hmm, except that this was changed sometime between 3.10 and 3.14.  So if
we are talking about 3.10 then we do pad for MBIM too, yes.


Bjørn
___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


Re: [OpenWrt-Devel] [PATCH] comgt: add ncm proto support

2014-10-09 Thread John Crispin


On 09/10/2014 15:35, Conor O'Gorman wrote:
 On 09/10/14 13:25, John Crispin wrote:
 
 personally i have been using mbim since i wrote umbim and it
 just works :)
 
 
 Ah, nice. I have some similar code, but in lua, from the json
 files. It's only a management protocol.
 
 Note that MBIM uses the NCM code for the bulk packet data, so it's 
 packetising is still in play.
 
 Conor 

when i worked on umbim i mailed aleksander who made libmim as i am
using his json meta info as input for my header file generator. he
told me about lua based mbim code for owrt flying around but i failed
to find it. now i find it you made it. a small internet after all ...


___
 openwrt-devel mailing list openwrt-devel@lists.openwrt.org 
 https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel
 
___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


Re: [OpenWrt-Devel] [PATCH] comgt: add ncm proto support

2014-10-09 Thread John Crispin


On 09/10/2014 14:58, Bjørn Mork wrote:
 John Crispin blo...@openwrt.org writes:
 
 ok, i am currently bumping some targets to v3.17. lets assume it
 is broken for  3.16 and hope 3.17 works.
 
 NCM seems to be broken by design and only a container as each
 dongle apparently uses its own AT magic. at least between
 Motorola, Sony and Huawei they are totally different.
 
 Yes, the lack of a standardized management protocol is one of the
 NCM shortcomings which were solved by MBIM (which started out as
 NCM 2.0).
 
 personally i have been using mbim since i wrote umbim and it just
 works :)
 
 Good to hear :-)
 
 thanks for the insight, lets hope it works after the kernel bump
 
 It should at least allow us to try out a few things on the fly
 without having to rebuild the driver.
 
 One thing I forgot to mention is that you can completely disable
 the padding in v3.16+ by setting min_tx_pkt = tx_max.  And
 these settings can be changed while the modem is actively in use 
 (i.e. connected).
 

ok will try, we should add some uci magic like option padding 0/1

i am currently using a vodafone k5105 which is a huawei rebrand. at
150 euro its very expensive. any other good ones ?
___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


Re: [OpenWrt-Devel] [PATCH] comgt: add ncm proto support

2014-10-09 Thread Bjørn Mork
John Crispin blo...@openwrt.org writes:

 i am currently using a vodafone k5105 which is a huawei rebrand. at
 150 euro its very expensive. any other good ones ?

I find it impossible to recommend any specific modems because important
firmware features like MBIM depend on both operator branding and
geographical target area.  But I can list the MBIM modems I have:

- Huawei E367 with MBIM firmware. I have no idea whether this is
  available anywhere in the world today.  I know most of the E367s were
  QMI only.  That's of course only a firmware issue, but that doesn't
  help much as long as the firmware isn't available.

- D-Link DWM-156 rev A7.  This might be a safer bet on the cheap side.
  I haven't seen any non MBIM variants for that specific revision.  But
  I wouldn't be suprised if they exist either, so the usual warnings
  apply.

The  rest of my MBIM modems are mini-PCIe or m.2, and also very
expensive:

- Ericsson H5321gw (with newer firmware), halfsize mini-PCIe

- Sierra Wireless MC7710 (with newer firmware, depending on cfg),
  fullsize mini-PCIe

- Sierra Wireless EM7345, m.2 (3042)


Bjørn
___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


Re: [OpenWrt-Devel] [PATCH] comgt: add ncm proto support

2014-10-08 Thread Conor O'Gorman



On 08/10/14 11:00, John Crispin wrote:

the e3267 that sami sent me works with this proto, but i am failing to
get a DHCP addr. could someone with a ncm dongle please try this patch
on top of latest trunk please and tell me if they are getting a dhcp addr ?


I had a similar problem with a Huawei device. It worked after removing 
some zero padding in the ncm driver.


In cdc_ncm.c, cdc_ncm_fill_tx_frame(), towards the end there is handling 
for Zero Length Packets (ZLP) and padding short packets. I removed the 
padding, and it worked. Are you testing 3.10 or 3.14? It's changed ever 
so slightly between them.


I am somewhat confused by the comment. It won't pad out short packets, 
but does make shortish packets long.


FYI:
/*
 * If collected data size is less or equal CDC_NCM_MIN_TX_PKT bytes,
 * we send buffers as it is. If we get more data, it would be more
 * efficient for USB HS mobile device with DMA engine to receive a full
 * size NTB, than canceling DMA transfer and receiving a short packet.
 */
if (skb_out-len  CDC_NCM_MIN_TX_PKT)
/* final zero padding */


Conor
___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


Re: [OpenWrt-Devel] [PATCH] comgt: add ncm proto support

2014-10-08 Thread John Crispin
hi conor

On 08/10/2014 17:27, Conor O'Gorman wrote:
 
 
 On 08/10/14 11:00, John Crispin wrote:
 the e3267 that sami sent me works with this proto, but i am
 failing to get a DHCP addr. could someone with a ncm dongle
 please try this patch on top of latest trunk please and tell me
 if they are getting a dhcp addr ?
 
 I had a similar problem with a Huawei device. It worked after
 removing some zero padding in the ncm driver.
 
 In cdc_ncm.c, cdc_ncm_fill_tx_frame(), towards the end there is
 handling for Zero Length Packets (ZLP) and padding short packets. I
 removed the padding, and it worked. Are you testing 3.10 or 3.14?
 It's changed ever so slightly between them.
 

3.14, will have a look at it tomorrow.

 I am somewhat confused by the comment. It won't pad out short
 packets, but does make shortish packets long.

sounds weird indeed

John




 
 FYI: /* * If collected data size is less or equal
 CDC_NCM_MIN_TX_PKT bytes, * we send buffers as it is. If we get
 more data, it would be more * efficient for USB HS mobile device
 with DMA engine to receive a full * size NTB, than canceling DMA
 transfer and receiving a short packet. */ if (skb_out-len 
 CDC_NCM_MIN_TX_PKT) /* final zero padding */
 
 
 Conor ___ openwrt-devel
 mailing list openwrt-devel@lists.openwrt.org 
 https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel
 
___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


Re: [OpenWrt-Devel] [PATCH] [comgt] add support for defining dial number in config file

2014-03-29 Thread Luiz Angelo Daros de Luca
Do I need to improve anything to get commited?

---
 Luiz Angelo Daros de Luca, Me.
luizl...@gmail.com


2014-03-17 18:13 GMT-03:00 luizl...@gmail.com:

 From: Luiz Angelo Daros de Luca luizl...@gmail.com

 Signed-off-by: Luiz Angelo Daros de Luca luizl...@gmail.com
 ---
  package/network/utils/comgt/Makefile  | 2 +-
  package/network/utils/comgt/files/3g.chat | 2 +-
  package/network/utils/comgt/files/3g.sh   | 9 -
  3 files changed, 10 insertions(+), 3 deletions(-)

 diff --git a/package/network/utils/comgt/Makefile
 b/package/network/utils/comgt/Makefile
 index 5324903..89a21be 100644
 --- a/package/network/utils/comgt/Makefile
 +++ b/package/network/utils/comgt/Makefile
 @@ -9,7 +9,7 @@ include $(TOPDIR)/rules.mk

  PKG_NAME:=comgt
  PKG_VERSION:=0.32
 -PKG_RELEASE:=21
 +PKG_RELEASE:=22

  PKG_SOURCE:=$(PKG_NAME).$(PKG_VERSION).tgz
  PKG_SOURCE_URL:=@SF/comgt
 diff --git a/package/network/utils/comgt/files/3g.chat
 b/package/network/utils/comgt/files/3g.chat
 index a1fa2a0..6656240 100644
 --- a/package/network/utils/comgt/files/3g.chat
 +++ b/package/network/utils/comgt/files/3g.chat
 @@ -8,5 +8,5 @@ OK  ATE1
  OK  'AT+CGDCONT=1,IP,$USE_APN'
  SAY Calling UMTS/GPRS
  TIMEOUT 30
 -OK  ATD*99***1#
 +OK  ATD$DIALNUMBER
  CONNECT ' '
 diff --git a/package/network/utils/comgt/files/3g.sh
 b/package/network/utils/comgt/files/3g.sh
 index 2dc719b..deca2c9 100644
 --- a/package/network/utils/comgt/files/3g.sh
 +++ b/package/network/utils/comgt/files/3g.sh
 @@ -13,6 +13,7 @@ proto_3g_init_config() {
 proto_config_add_string apn
 proto_config_add_string service
 proto_config_add_string pincode
 +   proto_config_add_string dialnumber
  }

  proto_3g_setup() {
 @@ -23,6 +24,7 @@ proto_3g_setup() {
 json_get_var apn apn
 json_get_var service service
 json_get_var pincode pincode
 +   json_get_var dialnumber dialnumber

 [ -e $device ] || {
 proto_set_available $interface 0
 @@ -74,10 +76,15 @@ proto_3g_setup() {
 [ -n $SIERRA ]  {
 gcom -d $device -s
 /etc/gcom/getcarrier.gcom || return 1
 }
 +
 +   if [ -z $dialnumber ]; then
 +   dialnumber=*99***1#
 +   fi
 +
 ;;
 esac

 -   connect=${apn:+USE_APN=$apn }/usr/sbin/chat -t5 -v -E -f $chat
 +   connect=${apn:+USE_APN=$apn }DIALNUMBER=$dialnumber
 /usr/sbin/chat -t5 -v -E -f $chat
 ppp_generic_setup $interface \
 noaccomp \
 nopcomp \
 --
 1.8.4.5


___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


Re: [OpenWrt-Devel] [PATCH] comgt

2012-07-12 Thread Vasilis Tsiligiannis
ìm=ªíÛMûێó{2d$àT*'µéíN¶§±÷«w(v)àm«뀨ž×§µ©z×±·úej)܅ªìz___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/mailman/listinfo/openwrt-devel


Re: [OpenWrt-Devel] [PATCH] comgt

2010-07-13 Thread Daniel A. Nagy
What exactly does this patch do/achieve?

Michael Grigorev wrote:
 Signed-off-by: Michael Grigorev sleuthho...@gmail.com
 mailto:sleuthho...@gmail.com
  
 Index: package/comgt/patches/004-CHANGELOG.diff
 ===
 --- package/comgt/patches/004-CHANGELOG.diff (revision 0)
 +++ package/comgt/patches/004-CHANGELOG.diff (revision 0)
 @@ -0,0 +1,18 @@
 +--- a/CHANGELOG Fri Oct 20 20:49:46 2006
  b/CHANGELOG Tue Jul 13 09:38:59 2010
 +@@ -1,7 +1,14 @@
 +-Change log $Id: CHANGELOG,v 1.3 2006/10/20 14:30:19 pharscape Exp $
 ++Change log $Id: CHANGELOG,v 1.4 2010/02/26 00:09:08 gknauf Exp $
 + ==
 + Changes to comgt
 + 
 ++Tues Jul. 13th 2010 Michael Grigorev
 ++- fixed use CGREG for registration checking
 ++
 ++Fri Feb. 26th 2010 Guenter Knauf
 ++- fixed typo in builtin script APN (bug ID 1610044).
 ++- silenced compiler warning (patch ID 1667936).
 ++
 + Fri Oct. 20th 2006 Paul Hardwick
 + - Scripts distributed with package are now located in scripts
 sub-directory
 + - Install now copies scripts to /etc/comgt see scripts/README for
 list of scripts
 Index: package/comgt/patches/002-comgt.c.diff
 ===
 --- package/comgt/patches/002-comgt.c.diff (revision 0)
 +++ package/comgt/patches/002-comgt.c.diff (revision 0)
 @@ -0,0 +1,26 @@
 +--- a/comgt.c Fri Oct 20 20:49:46 2006
  b/comgt.c Tue Jul 13 09:31:23 2010
 +@@ -22,7 +22,7 @@
 +  */
 +
 + 
 /***
 +-* $Id: comgt.c,v 1.4 2006/10/20 14:30:19 pharscape Exp $
 ++* $Id: comgt.c,v 1.5 2010/02/25 23:47:30 gknauf Exp $
 + 
 /
 +
 +
 +@@ -1539,7 +1539,7 @@
 +   unsigned char terminator='\n';
 +   char *devenv,line[STRINGL];
 +
 +-  //Load up the COMGT device env variable if it exists
 ++  /* Load up the COMGT device env variable if it exists */
 +   devenv = getenv(COMGTDEVICE);
 +   if (devenv != NULL  strlen(devenv)){
 +   strcpy(device,devenv);
 +@@ -1737,4 +1737,5 @@
 +   sprintf(msg,Exit with code %d.\n,a);
 +   vmsg(msg);
 +   ext(a);
 ++  return 0; /* NOTREACHED */
 + }
 Index: package/comgt/patches/003-comgt.h.diff
 ===
 --- package/comgt/patches/003-comgt.h.diff (revision 0)
 +++ package/comgt/patches/003-comgt.h.diff (revision 0)
 @@ -0,0 +1,48 @@
 +--- a/comgt.h Fri Oct 20 20:49:46 2006
  b/comgt.h Tue Jul 13 09:36:18 2010
 +@@ -20,10 +20,10 @@
 + 
 ***/
 +
 +
 /***
 +-* $Id: comgt.h,v 1.4 2006/10/20 14:30:19 pharscape Exp $
 ++* $Id: comgt.h,v 1.5 2010/02/25 23:25:57 gknauf Exp $
 +
 /
 +-#define COMGT_VERSION 0.32
 +-#define YEARS 2005,2006
 ++#define COMGT_VERSION 0.33
 ++#define YEARS 2005,2006,2010
 +
 + char _default_code[] =
 + opengt\n\
 +@@ -83,8 +83,8 @@
 + print \Waiting for Registration..(120 sec max)\\n\
 + let c = 0\n\
 +   :waitreg\n\
 +-send \AT+CREG?^m\\n\
 +-waitfor 2 \+CREG: 0,1\,\+CREG: 0,5\\n\
 ++send \AT+CGREG?^m\\n\
 ++waitfor 2 \+CGREG: 0,1\,\+CGREG: 0,5\\n\
 + if % = -1 goto regagain\n\
 + if % = 0 goto homereg\n\
 + if % = 1 goto roamreg\n\
 +@@ -470,13 +470,17 @@
 + if a=0 goto apnerror\n\
 + if a32 goto apnerror\n\
 +   :enterapn\n\
 +-send \AT+CGDCONT=1,\\\IP\\\,n\
 +-send $c\n\
 ++send \AT+CGDCONT=1,\\\IP\\\,\n\
 ++send $x\n\
 + send ^m\\n\
 + waitfor 20 \OK\,\ERR\\n\
 + if % = -1 goto timeerror\n\
 + if % = 0 goto OK\n\
 +-if % = 1 goto apnerror\n\
 ++if % = 1 goto apnseterror\n\
 ++  :apnseterror\n\
 ++print \ERROR entering APN\n\\n\
 ++print \The device did not accept the APN set command\n\\n\
 ++exit 1\n\
 +   :apnerror\n\
 + print \ERROR entering APN\n\\n\
 + print \The COMGTAPN env variable is not set\n\\n\
 
 
 
 
 ___
 openwrt-devel mailing list
 openwrt-devel@lists.openwrt.org
 https://lists.openwrt.org/mailman/listinfo/openwrt-devel



signature.asc
Description: OpenPGP digital signature
___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/mailman/listinfo/openwrt-devel