Re: [LEDE-DEV] [PATCH] comgt-ncm: Add support for specifying profile index

2016-12-11 Thread Matti Laakso
On 12/11/2016 09:47 AM, John Crispin wrote:
> Hi Matti
>
> i noticed that you remove the ipv6 option/support and this is not
> mentioned in the commit message. could you elaborate on that one ?
>
>   John

Hi John,

It is mentioned in the commit message, although maybe a bit unclear. I
just sent a v2 with among other changes a slightly reworded commit
message. The point is that it is better (and common to mobile broadband
connections) to specify pdptype as ip, ipv6 or ipv4v6 rather than enable
or disable ipv6.

Matti

>
> On 06/12/2016 17:52, Matti Laakso wrote:
>> Add support for specifying a call profile index instead of APN. A
>> specific index different from 1 must be used for some service
>> provider and modem combinations.
>>
>> In addition, change the manufacturer detection to use the standard
>> AT+CGMI command, which produces more predictable output than ATI,
>> and remove the redundant ipv6 option, since it is more customary
>> to specify the PDP context type with mobile connections.
>>
>> Signed-off-by: Matti Laakso 
>> ---
>>  package/network/utils/comgt/Makefile   |  2 +-
>>  package/network/utils/comgt/files/getcardinfo.gcom |  2 +-
>>  package/network/utils/comgt/files/ncm.json | 26 -
>>  package/network/utils/comgt/files/ncm.sh   | 65 
>> ++
>>  4 files changed, 44 insertions(+), 51 deletions(-)
>>
>> diff --git a/package/network/utils/comgt/Makefile 
>> b/package/network/utils/comgt/Makefile
>> index 9d99d64..4b6e6ea 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:=27
>> +PKG_RELEASE:=28
>>  
>>  PKG_SOURCE:=$(PKG_NAME).$(PKG_VERSION).tgz
>>  PKG_SOURCE_URL:=@SF/comgt
>> diff --git a/package/network/utils/comgt/files/getcardinfo.gcom 
>> b/package/network/utils/comgt/files/getcardinfo.gcom
>> index 5c69a64..f91665f 100644
>> --- a/package/network/utils/comgt/files/getcardinfo.gcom
>> +++ b/package/network/utils/comgt/files/getcardinfo.gcom
>> @@ -6,7 +6,7 @@ opengt
>>   flash 0.1
>>  
>>  :start
>> - send "ATI^m"
>> + send "AT+CGMI^m"
>>   get 1 "" $s
>>   print $s
>>  
>> diff --git a/package/network/utils/comgt/files/ncm.json 
>> b/package/network/utils/comgt/files/ncm.json
>> index d1f8699..8f74e17 100644
>> --- a/package/network/utils/comgt/files/ncm.json
>> +++ b/package/network/utils/comgt/files/ncm.json
>> @@ -7,7 +7,7 @@
>>  "ATV1",
>>  "ATE1",
>>  "ATS0=0",
>> -"AT+CGDCONT=1,\\\"${pdptype}\\\",\\\"${apn}\\\""
>> +
>> "AT+CGDCONT=${profile},\\\"${pdptype}\\\"${apn:+,\\\"$apn\\\"}"
>>  ],
>>  "modes": {
>>  "preferlte": 
>> "AT^SYSCFGEX=\\\"030201\\\",3fff,2,4,7fff,,",
>> @@ -17,8 +17,8 @@
>>  "gsm": 
>> "AT^SYSCFGEX=\\\"01\\\",3fff,2,4,7fff,,",
>>  "auto": 
>> "AT^SYSCFGEX=\\\"00\\\",3fff,2,4,7fff,,"
>>  },
>> -"connect": 
>> "AT^NDISDUP=1,1,\\\"${apn}\\\"${username:+,\\\"$username\\\"}${password:+,\\\"$password\\\"}${auth:+,$auth}",
>> -"disconnect": "AT^NDISDUP=1,0"
>> +"connect": 
>> "AT^NDISDUP=${profile},1${apn:+,\\\"$apn\\\"}${username:+,\\\"$username\\\"}${password:+,\\\"$password\\\"}${auth:+,$auth}",
>> +"disconnect": "AT^NDISDUP=${profile},0"
>>  },
>>  "samsung": {
>>  "initialize": [
>> @@ -26,7 +26,7 @@
>>  "AT+CGREG=2",
>>  "AT+CFUN=5",
>>  "AT+MODESELECT=3",
>> -"AT+CGDCONT=1,\\\"${pdptype}\\\",\\\"${apn}\\\""
>> +
>> "AT+CGDCONT=${profile},\\\"${pdptype}\\\"${apn:+,\\\"$apn\\\"}"
>>  ],
>>  "modes": {
>>  "umts": "AT+CHANGEALLPATH=1"
>> @@ -34,11 +34,11 @@
>>  "connect": "AT+CGATT=1",
>>  "disconnect": "AT+CGATT=0"
>>  },
>> -"sierra wireless, incorporated": {
>> +"sierra": {
>>  "initialize": [
>>  "AT+CFUN=1",
>> -"AT+CGDCONT=1,\\\"${pdptype}\\\",\\\"${apn}\\\"",
>> -
>> "AT$QCPDPP=1${auth:+,$auth}${password:+,\\\"$password\\\"}${username:+,\\\"$username\\\"}"
>> +
>> "AT+CGDCONT=${profile},\\\"${pdptype}\\\"${apn:+,\\\"$apn\\\"}",
>> +
>> "AT$QCPDPP=${profile},${auth:-0}${password:+,\\\"$password\\\"}${username:+,\\\"$username\\\"}"
>>  ],
>>  "modes": {
>>  "preferlte": "AT!SELRAT=07",
>> @@ -48,20 +48,20 @@
>>  "gsm": "AT!SELRAT=02",
>>  "auto": "AT!SELRAT=00"
>>  },
>> -"connect": "AT!SCACT=1,1",
>> -

Re: [LEDE-DEV] [PATCH] comgt-ncm: Add support for specifying profile index

2016-12-10 Thread John Crispin
Hi Matti

i noticed that you remove the ipv6 option/support and this is not
mentioned in the commit message. could you elaborate on that one ?

John

On 06/12/2016 17:52, Matti Laakso wrote:
> Add support for specifying a call profile index instead of APN. A
> specific index different from 1 must be used for some service
> provider and modem combinations.
> 
> In addition, change the manufacturer detection to use the standard
> AT+CGMI command, which produces more predictable output than ATI,
> and remove the redundant ipv6 option, since it is more customary
> to specify the PDP context type with mobile connections.
> 
> Signed-off-by: Matti Laakso 
> ---
>  package/network/utils/comgt/Makefile   |  2 +-
>  package/network/utils/comgt/files/getcardinfo.gcom |  2 +-
>  package/network/utils/comgt/files/ncm.json | 26 -
>  package/network/utils/comgt/files/ncm.sh   | 65 
> ++
>  4 files changed, 44 insertions(+), 51 deletions(-)
> 
> diff --git a/package/network/utils/comgt/Makefile 
> b/package/network/utils/comgt/Makefile
> index 9d99d64..4b6e6ea 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:=27
> +PKG_RELEASE:=28
>  
>  PKG_SOURCE:=$(PKG_NAME).$(PKG_VERSION).tgz
>  PKG_SOURCE_URL:=@SF/comgt
> diff --git a/package/network/utils/comgt/files/getcardinfo.gcom 
> b/package/network/utils/comgt/files/getcardinfo.gcom
> index 5c69a64..f91665f 100644
> --- a/package/network/utils/comgt/files/getcardinfo.gcom
> +++ b/package/network/utils/comgt/files/getcardinfo.gcom
> @@ -6,7 +6,7 @@ opengt
>   flash 0.1
>  
>  :start
> - send "ATI^m"
> + send "AT+CGMI^m"
>   get 1 "" $s
>   print $s
>  
> diff --git a/package/network/utils/comgt/files/ncm.json 
> b/package/network/utils/comgt/files/ncm.json
> index d1f8699..8f74e17 100644
> --- a/package/network/utils/comgt/files/ncm.json
> +++ b/package/network/utils/comgt/files/ncm.json
> @@ -7,7 +7,7 @@
>   "ATV1",
>   "ATE1",
>   "ATS0=0",
> - "AT+CGDCONT=1,\\\"${pdptype}\\\",\\\"${apn}\\\""
> + 
> "AT+CGDCONT=${profile},\\\"${pdptype}\\\"${apn:+,\\\"$apn\\\"}"
>   ],
>   "modes": {
>   "preferlte": 
> "AT^SYSCFGEX=\\\"030201\\\",3fff,2,4,7fff,,",
> @@ -17,8 +17,8 @@
>   "gsm": 
> "AT^SYSCFGEX=\\\"01\\\",3fff,2,4,7fff,,",
>   "auto": 
> "AT^SYSCFGEX=\\\"00\\\",3fff,2,4,7fff,,"
>   },
> - "connect": 
> "AT^NDISDUP=1,1,\\\"${apn}\\\"${username:+,\\\"$username\\\"}${password:+,\\\"$password\\\"}${auth:+,$auth}",
> - "disconnect": "AT^NDISDUP=1,0"
> + "connect": 
> "AT^NDISDUP=${profile},1${apn:+,\\\"$apn\\\"}${username:+,\\\"$username\\\"}${password:+,\\\"$password\\\"}${auth:+,$auth}",
> + "disconnect": "AT^NDISDUP=${profile},0"
>   },
>   "samsung": {
>   "initialize": [
> @@ -26,7 +26,7 @@
>   "AT+CGREG=2",
>   "AT+CFUN=5",
>   "AT+MODESELECT=3",
> - "AT+CGDCONT=1,\\\"${pdptype}\\\",\\\"${apn}\\\""
> + 
> "AT+CGDCONT=${profile},\\\"${pdptype}\\\"${apn:+,\\\"$apn\\\"}"
>   ],
>   "modes": {
>   "umts": "AT+CHANGEALLPATH=1"
> @@ -34,11 +34,11 @@
>   "connect": "AT+CGATT=1",
>   "disconnect": "AT+CGATT=0"
>   },
> - "sierra wireless, incorporated": {
> + "sierra": {
>   "initialize": [
>   "AT+CFUN=1",
> - "AT+CGDCONT=1,\\\"${pdptype}\\\",\\\"${apn}\\\"",
> - 
> "AT$QCPDPP=1${auth:+,$auth}${password:+,\\\"$password\\\"}${username:+,\\\"$username\\\"}"
> + 
> "AT+CGDCONT=${profile},\\\"${pdptype}\\\"${apn:+,\\\"$apn\\\"}",
> + 
> "AT$QCPDPP=${profile},${auth:-0}${password:+,\\\"$password\\\"}${username:+,\\\"$username\\\"}"
>   ],
>   "modes": {
>   "preferlte": "AT!SELRAT=07",
> @@ -48,20 +48,20 @@
>   "gsm": "AT!SELRAT=02",
>   "auto": "AT!SELRAT=00"
>   },
> - "connect": "AT!SCACT=1,1",
> - "disconnect": "AT!SCACT=0,1"
> + "connect": "AT!SCACT=1,${profile}",
> + "disconnect": "AT!SCACT=0,${profile}"
>   },
> - "sony ericsson": {
> + "sony": {
>   "initialize": [
>   "AT+CFUN=1",
> - "AT+CGDCONT=1,\\\"${pdptype}\\\",\\\"${apn}\\\"",
> - 
> "AT*EIAAUW=1,1,\\\"${username}\\\",\\\"${password}\\\",${auth:-00111}"
> +  

[LEDE-DEV] [PATCH] comgt-ncm: Add support for specifying profile index

2016-12-09 Thread Giuseppe Lippolis
> Ah, that's the echo from the command messing up things. I was using the
> cdc-wdm0 node, which doesn't echo, so I didn't notice this. Will send a
fix
> later today. However, it still wouldn't work with your modem as the
> manufacturer would be "+cgmi:". This is a bug in the modem firmware, since
> according to GSM spec AT+CGMI should only return the manufacturer name
> and "OK". This from a Huawei:
> 
> AT+CGMI
> huawei
> 
> OK

Ok I will wait for your update and then I will propose an alternative
parsing strategy to be used when the standard one doesn't work, to make also
some non-compliant modem working in lede.

Bye.


___
Lede-dev mailing list
Lede-dev@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/lede-dev


Re: [LEDE-DEV] [PATCH] comgt-ncm: Add support for specifying profile index

2016-12-08 Thread Matti Laakso
> >/--- a/package/network/utils/comgt/files/getcardinfo.gcom />/+++ 
> >b/package/network/utils/comgt/files/getcardinfo.gcom />/@@ -6,7 +6,7 @@ 
> >opengt />/flash 0.1 />//>/:start />/- send "ATI^m" />/+ send "AT+CGMI^m" /
> >/diff --git a/package/network/utils/comgt/files/ncm.json /
>
> >/diff --git a/package/network/utils/comgt/files/ncm.sh 
> >/>/b/package/network/utils/comgt/files/ncm.sh />/index 14b6347..df60fe8 
> >100644 /
>
> >/- manufacturer=`gcom -d "$device" -s /etc/gcom/getcardinfo.gcom | awk 
> >/'/Manufacturer/ { print tolower($2) }'`
> >/+ manufacturer=`gcom -d "$device" -s /etc/gcom/getcardinfo.gcom | awk /+'NF 
> >{ print tolower($1); exit; }'`
>
> Unfortunately this currently doesn't work for me, but can be easily fixed.
> Adding this line:
> +   echo "Manufacturer: $manufacturer"
> this is what I get in the logread:
> Tue Dec  6 18:49:52 2016 daemon.notice netifd: Interface 'wan3g' is setting
> up now
> Tue Dec  6 18:49:52 2016 daemon.notice netifd: wan3g (1082): wwan[1082]
> Using proto:wwan device:/dev/ttyUSB0 iface:usb0 desc:
> Tue Dec  6 18:49:54 2016 daemon.notice netifd: wan3g (1082): Manufacturer:
> at+cgmi
> Tue Dec  6 18:49:54 2016 daemon.notice netifd: wan3g (1082): WARNING:
> Variable 'at+cgmi' does not exist or is not an array/object
> Tue Dec  6 18:49:54 2016 daemon.notice netifd: wan3g (1082): Unsupported
> modem
> Tue Dec  6 18:49:54 2016 daemon.notice netifd: wan3g (1122): Stopping
> network device:
> Tue Dec  6 18:49:54 2016 daemon.notice netifd: wan3g (1122): Can't open
> device .
> Tue Dec  6 18:49:54 2016 daemon.notice netifd: wan3g (1122): Failed to
> disconnect
> Tue Dec  6 18:49:54 2016 daemon.notice netifd: Interface 'wan3g' is now down
>
> Running the getcardinfo script manually:
> root at lede :~# gcom 
> -d /dev/ttyUSB0 -s /etc/gcom/getcardinfo.gcom
> AT+CGMI
> +CGMI: MTK1
>
> OK

Ah, that's the echo from the command messing up things. I was using the
cdc-wdm0 node, which doesn't echo, so I didn't notice this. Will send a
fix later today. However, it still wouldn't work with your modem as the
manufacturer would be "+cgmi:". This is a bug in the modem firmware,
since according to GSM spec AT+CGMI should only return the manufacturer
name and "OK". This from a Huawei:

AT+CGMI
huawei

OK

>
> A general comment:
> Currently the wwan is dividing only for manufacturer and not per device
> model.
> I don't know if this is a good strategy. Probably the same manufacturer can
> produce different modem models requiring some more specific configuration.
> My suggestion is to keep the manufactured identification (as it is now) to
> address the generic configuration, but identify also the model in order to
> allow a more specific configuration if needed.

Possibly, then we should use the AT+CGMM to get the model in a
predictable way (unlike ATI-command):

AT+CGMM
E3276

>
> Bye.

___
Lede-dev mailing list
Lede-dev@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/lede-dev


[LEDE-DEV] [PATCH] comgt-ncm: Add support for specifying profile index

2016-12-07 Thread Giuseppe Lippolis
> --- a/package/network/utils/comgt/files/getcardinfo.gcom
> +++ b/package/network/utils/comgt/files/getcardinfo.gcom
> @@ -6,7 +6,7 @@ opengt
>   flash 0.1
> 
>  :start
> - send "ATI^m"
> + send "AT+CGMI^m"

> diff --git a/package/network/utils/comgt/files/ncm.json


> diff --git a/package/network/utils/comgt/files/ncm.sh
> b/package/network/utils/comgt/files/ncm.sh
> index 14b6347..df60fe8 100644


> - manufacturer=`gcom -d "$device" -s /etc/gcom/getcardinfo.gcom | awk
'/Manufacturer/ { print tolower($2) }'`
> + manufacturer=`gcom -d "$device" -s /etc/gcom/getcardinfo.gcom | awk
+'NF { print tolower($1); exit; }'`

Unfortunately this currently doesn't work for me, but can be easily fixed.
Adding this line:
+   echo "Manufacturer: $manufacturer"
this is what I get in the logread:
Tue Dec  6 18:49:52 2016 daemon.notice netifd: Interface 'wan3g' is setting
up now
Tue Dec  6 18:49:52 2016 daemon.notice netifd: wan3g (1082): wwan[1082]
Using proto:wwan device:/dev/ttyUSB0 iface:usb0 desc:
Tue Dec  6 18:49:54 2016 daemon.notice netifd: wan3g (1082): Manufacturer:
at+cgmi
Tue Dec  6 18:49:54 2016 daemon.notice netifd: wan3g (1082): WARNING:
Variable 'at+cgmi' does not exist or is not an array/object
Tue Dec  6 18:49:54 2016 daemon.notice netifd: wan3g (1082): Unsupported
modem
Tue Dec  6 18:49:54 2016 daemon.notice netifd: wan3g (1122): Stopping
network device:
Tue Dec  6 18:49:54 2016 daemon.notice netifd: wan3g (1122): Can't open
device .
Tue Dec  6 18:49:54 2016 daemon.notice netifd: wan3g (1122): Failed to
disconnect
Tue Dec  6 18:49:54 2016 daemon.notice netifd: Interface 'wan3g' is now down

Running the getcardinfo script manually:
root@lede:~# gcom -d /dev/ttyUSB0 -s /etc/gcom/getcardinfo.gcom
AT+CGMI
+CGMI: MTK1

OK

A general comment:
Currently the wwan is dividing only for manufacturer and not per device
model.
I don't know if this is a good strategy. Probably the same manufacturer can
produce different modem models requiring some more specific configuration.
My suggestion is to keep the manufactured identification (as it is now) to
address the generic configuration, but identify also the model in order to
allow a more specific configuration if needed.

Bye.


___
Lede-dev mailing list
Lede-dev@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/lede-dev