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
> +

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

2015-09-08 Thread Matti Laakso
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
+   proto_config_add_boolean ipv6
 }
 
 proto_ncm_setup() {
@@ -24,8 +26,22 @@ proto_ncm_setup() {
 
local manufacturer initialize setmode connect ifname devname devpath
 
-   local device apn auth username password pincode delay mode
-   json_get_vars device apn auth username password pincode delay mode
+   local device apn auth username password pincode delay mode pdptype ipv6
+   json_get_vars device apn auth username password pincode delay mode 
pdptype ipv6
+   
+   if [ "$ipv6" = 0 ]; then
+   ipv6=""
+   else
+   ipv6=1
+   fi
+   
+   [ -z "$pdptype" ] && {
+   if [ -n "$ipv6" ]; then
+   pdptype="IPV4V6"
+   else
+   pdptype="IP"
+   fi
+   }
 
[ -n "$ctl_device" ] && device=$ctl_device
 
@@ -116,7 +132,7 @@ proto_ncm_setup() {
return 1
}
 
-   echo "Connected, starting DHCP"
+   echo "Connected, starting DHCP on $ifname"