koshev-msk / modemfeed

Other
107 stars 63 forks source link

Modem L860-GL is not working with pro APN #9

Closed newdanceradio closed 4 months ago

newdanceradio commented 1 year ago

Hello.

There is some issue, when is entered APN "internet" modem is connecting and receives IP address, but when is entered APN "pro" modem isn't connecting. From my carrier APN "pro" is for static IP address.

There is some issue with context. Router like Keenetic is correctly working with "pro" APN I have enabled debug on Keenetic UsbLte0 interface What we can see there

[I] May 22 15:57:30 ndm: Mobile::TtyDevice: "UsbLte0": tty0 <-- "ATE0" (expect "OK"). 
[I] May 22 15:57:30 ndm: Mobile::TtyDevice: "UsbLte0": tty0 --> "OK" (got it). 
[I] May 22 15:57:30 ndm: Mobile::TtyDevice: "UsbLte0": tty0 <-- "AT+CFUN=1" (expect "OK"). 
[I] May 22 15:57:31 ndm: Mobile::TtyDevice: "UsbLte0": tty0 --> "OK" (got it). 
[I] May 22 15:57:31 ndm: Mobile::TtyDevice: "UsbLte0": tty0 <-- "AT+CMEE=1" (expect "OK"). 
[I] May 22 15:57:31 ndm: Mobile::TtyDevice: "UsbLte0": tty0 --> "OK" (got it). 
[I] May 22 15:57:31 ndm: Mobile::TtyDevice: "UsbLte0": tty0 <-- "AT+CGPIAF=1,0,0,0" (expect "OK"). 
[I] May 22 15:57:31 ndm: Mobile::TtyDevice: "UsbLte0": tty0 --> "OK" (got it). 
[I] May 22 15:57:31 ndm: Mobile::TtyDevice: "UsbLte0": tty0 <-- "AT+CGMI?" (expect "CGMI"). 
[I] May 22 15:57:31 ndm: Mobile::TtyDevice: "UsbLte0": tty0 --> "+CGMI: "Fibocom"" (got it). 
[I] May 22 15:57:31 ndm: Mobile::TtyDevice: "UsbLte0": tty0 --- (expect "OK"). 
[I] May 22 15:57:31 ndm: Mobile::TtyDevice: "UsbLte0": tty0 --> "OK" (got it). 
[I] May 22 15:57:31 ndm: Mobile::TtyDevice: "UsbLte0": tty0 <-- "AT+FMM?" (expect "FMM"). 
[I] May 22 15:57:31 ndm: Mobile::TtyDevice: "UsbLte0": tty0 --> "+FMM: "L860 LTE Module","L860"" (got it). 
[I] May 22 15:57:31 ndm: Mobile::TtyDevice: "UsbLte0": tty0 --- (expect "OK"). 
[I] May 22 15:57:31 ndm: Mobile::TtyDevice: "UsbLte0": tty0 --> "OK" (got it). 
[I] May 22 15:57:31 ndm: Mobile::TtyDevice: "UsbLte0": tty0 <-- "AT+FMR?" (expect "FMR"). 
[I] May 22 15:57:31 ndm: Mobile::TtyDevice: "UsbLte0": tty0 --> "+FMR: "18600.5001.00.35.01.57"" (got it). 
[I] May 22 15:57:31 ndm: Mobile::TtyDevice: "UsbLte0": tty0 --- (expect "OK"). 
[I] May 22 15:57:31 ndm: Mobile::TtyDevice: "UsbLte0": tty0 --> "OK" (got it). 
[I] May 22 15:57:31 ndm: Mobile::TtyDevice: "UsbLte0": tty0 <-- "ATI9" (expect "^[^\+]{1}.*$"). 
[I] May 22 15:57:31 ndm: Mobile::TtyDevice: "UsbLte0": tty0 --> ""V1.2"" (got it). 
[I] May 22 15:57:31 ndm: Mobile::TtyDevice: "UsbLte0": tty0 --- (expect "OK"). 
[I] May 22 15:57:31 ndm: Mobile::TtyDevice: "UsbLte0": tty0 --> "OK" (got it). 
[I] May 22 15:57:31 ndm: Mobile::TtyDevice: "UsbLte0": tty0 <-- "AT+CGSN?" (expect "CGSN"). 
[I] May 22 15:57:31 ndm: Mobile::TtyDevice: "UsbLte0": tty0 --> "+CGSN: "352279100355589"" (got it). 
[I] May 22 15:57:31 ndm: Mobile::TtyDevice: "UsbLte0": tty0 --- (expect "OK"). 
[I] May 22 15:57:31 ndm: Mobile::TtyDevice: "UsbLte0": tty0 --> "OK" (got it). 
[I] May 22 15:57:31 ndm: Mobile::TtyDevice: "UsbLte0": tty0 <-- "AT+XACT=?" (expect "XACT"). 
[I] May 22 15:57:31 ndm: Mobile::TtyDevice: "UsbLte0": tty0 --> "+XACT: (0-6),(0-2),0,1,2,4,5,8,101,102,103,104,105,107,108,112,113,114,117,118,119,120,125,126,128,129,130,132,138,139,140,141,142,146,166" (got it). 
[I] May 22 15:57:31 ndm: Mobile::TtyDevice: "UsbLte0": tty0 --- (expect "OK"). 
[I] May 22 15:57:31 ndm: Mobile::TtyDevice: "UsbLte0": tty0 --> "OK" (got it). 
[I] May 22 15:57:31 ndm: Mobile::TtyDevice: "UsbLte0": tty0 <-- "AT+CPMS="ME","ME","SM"" (expect "OK"). 
[I] May 22 15:57:31 ndm: Mobile::TtyDevice: "UsbLte0": tty0 --> "+CPMS: 0,4,0,4,0,50". 
[I] May 22 15:57:31 ndm: Mobile::TtyDevice: "UsbLte0": tty0 --> "OK" (got it). 
[I] May 22 15:57:31 ndm: Mobile::TtyDevice: "UsbLte0": tty0 <-- "AT+CMGF=0" (expect "OK"). 
[I] May 22 15:57:31 ndm: Mobile::TtyDevice: "UsbLte0": tty0 --> "OK" (got it). 
[I] May 22 15:57:31 ndm: Mobile::TtyDevice: "UsbLte0": tty0 <-- "AT+CPIN?" (expect "CPIN|CME ERROR"). 
[I] May 22 15:57:31 ndm: Mobile::TtyDevice: "UsbLte0": tty0 --> "+CPIN: READY" (got it). 
[I] May 22 15:57:31 ndm: Mobile::TtyDevice: "UsbLte0": tty0 --- (expect "OK"). 
[I] May 22 15:57:31 ndm: Mobile::TtyDevice: "UsbLte0": tty0 --> "OK" (got it). 
[I] May 22 15:57:31 ndm: Mobile::TtyDevice: "UsbLte0": tty0 <-- "AT+CCID" (expect "CCID"). 
[I] May 22 15:57:31 ndm: Mobile::TtyDevice: "UsbLte0": tty0 --> "+CCID: 8937105220100124117F" (got it). 
[I] May 22 15:57:31 ndm: Mobile::TtyDevice: "UsbLte0": tty0 --- (expect "OK"). 
[I] May 22 15:57:31 ndm: Mobile::TtyDevice: "UsbLte0": tty0 --> "OK" (got it). 
[I] May 22 15:57:31 ndm: Mobile::TtyDevice: "UsbLte0": tty0 <-- "AT+CIMI" (expect "^\d{15}$"). 
[I] May 22 15:57:31 ndm: Mobile::TtyDevice: "UsbLte0": tty0 --> "247050102982906" (got it). 
[I] May 22 15:57:31 ndm: Mobile::TtyDevice: "UsbLte0": tty0 --- (expect "OK"). 
[I] May 22 15:57:31 ndm: Mobile::TtyDevice: "UsbLte0": tty0 --> "OK" (got it). 
[I] May 22 15:57:31 ndm: Mobile::TtyDevice: "UsbLte0": tty0 <-- "AT+CREG=0" (expect "OK"). 
[I] May 22 15:57:31 ndm: Mobile::TtyDevice: "UsbLte0": tty0 --> "OK" (got it). 
[I] May 22 15:57:31 ndm: Mobile::TtyDevice: "UsbLte0": tty0 <-- "AT+CEREG=0" (expect "OK"). 
[I] May 22 15:57:31 ndm: Mobile::TtyDevice: "UsbLte0": tty0 --> "OK" (got it). 
[I] May 22 15:57:31 ndm: Mobile::TtyDevice: "UsbLte0": tty0 <-- "AT+CGATT=0" (expect "OK"). 
[I] May 22 15:57:31 ndm: Mobile::TtyDevice: "UsbLte0": tty0 --> "OK" (got it). 
[I] May 22 15:57:31 ndm: Mobile::TtyDevice: "UsbLte0": tty0 <-- "AT+COPS=2" (expect "OK"). 
[I] May 22 15:57:31 ndm: Mobile::TtyDevice: "UsbLte0": tty0 --> "OK" (got it). 
[I] May 22 15:57:31 ndm: Mobile::TtyDevice: "UsbLte0": tty0 <-- "AT+CGDCONT=0,"IP"" (expect "OK"). 
[I] May 22 15:57:31 ndm: Core::System::StartupConfig: configuration saved. 
[I] May 22 15:57:36 ndm: Mobile::TtyDevice: "UsbLte0": tty0 --> "OK" (got it). 
[I] May 22 15:57:36 ndm: Mobile::TtyDevice: "UsbLte0": tty0 <-- "AT+CGDCONT=0" (expect "OK"). 
[I] May 22 15:57:36 ndm: Mobile::TtyDevice: "UsbLte0": tty0 --> "OK" (got it). 
[I] May 22 15:57:36 ndm: Mobile::TtyDevice: "UsbLte0": tty0 <-- "AT+XACT=2,,,1,2,4,5,8,101,102,103,104,105,107,108,112,113,114,117,118,119,120,125,126,128,129,130,132,138,139,140,141,142" (expect "OK"). 
[I] May 22 15:57:36 ndm: Mobile::TtyDevice: "UsbLte0": tty0 --> "OK" (got it). 
[I] May 22 15:57:36 ndm: Mobile::TtyDevice: "UsbLte0": tty0 <-- "AT+CGDCONT=1,"IP","pro"" (expect "OK"). 
[I] May 22 15:57:36 ndm: Mobile::TtyDevice: "UsbLte0": tty0 --> "OK" (got it). 
[I] May 22 15:57:36 ndm: Mobile::TtyDevice: "UsbLte0": tty0 <-- "AT+XGAUTH=1,0,"",""" (expect "OK"). 
[I] May 22 15:57:36 ndm: Mobile::TtyDevice: "UsbLte0": tty0 --> "OK" (got it). 
[I] May 22 15:57:36 ndm: Mobile::TtyDevice: "UsbLte0": tty0 <-- "AT+XDATACHANNEL=1,1,"/USBCDC/0","/USBHS/NCM/0",2,1" (expect "OK"). 
[I] May 22 15:57:36 ndm: Mobile::TtyDevice: "UsbLte0": tty0 --> "OK" (got it). 
[I] May 22 15:57:36 ndm: Mobile::TtyDevice: "UsbLte0": tty0 <-- "AT+XDNS=1,1" (expect "OK"). 
[I] May 22 15:57:36 ndm: Mobile::TtyDevice: "UsbLte0": tty0 --> "OK" (got it). 
[I] May 22 15:57:36 ndm: Mobile::TtyDevice: "UsbLte0": tty0 <-- "AT+CGACT=1,1" (expect "OK"). 
[I] May 22 15:57:38 ndm: Mobile::TtyDevice: "UsbLte0": tty0 --> "OK" (got it). 
[I] May 22 15:57:38 ndm: Mobile::TtyDevice: "UsbLte0": tty0 <-- "AT+COPS=0" (expect "OK"). 
[I] May 22 15:57:38 ndm: Mobile::TtyDevice: "UsbLte0": tty0 --> "OK" (got it). 
[I] May 22 15:57:38 ndm: Mobile::TtyDevice: "UsbLte0": tty0 <-- "AT+CGATT=1" (expect "OK"). 
[I] May 22 15:57:38 ndm: Mobile::TtyDevice: "UsbLte0": tty0 --> "OK" (got it). 
[I] May 22 15:57:38 ndm: Mobile::TtyDevice: "UsbLte0": tty0 <-- "AT+CGDATA="M-RAW_IP",1" (expect "OK"). 
[I] May 22 15:57:38 ndm: Mobile::TtyDevice: "UsbLte0": tty0 --> "OK" (got it). 
[I] May 22 15:57:38 ndm: Mobile::TtyDevice: "UsbLte0": tty0 <-- "AT+CPMS="ME"" (expect "OK"). 
[I] May 22 15:57:38 ndm: Mobile::TtyDevice: "UsbLte0": tty0 --> "CONNECT". 
[I] May 22 15:57:38 ndm: Mobile::TtyDevice: "UsbLte0": tty0 --> "+CPMS: 0,4,0,4,0,50". 
[I] May 22 15:57:38 ndm: Mobile::TtyDevice: "UsbLte0": tty0 --> "OK" (got it). 
[I] May 22 15:57:38 ndm: Mobile::TtyDevice: "UsbLte0": tty0 <-- "AT+CMGD=?" (expect "CMGD"). 
[I] May 22 15:57:38 ndm: Mobile::TtyDevice: "UsbLte0": tty0 --> "+CMGD: (),(0,1,2,3,4)" (got it). 
[I] May 22 15:57:38 ndm: Mobile::TtyDevice: "UsbLte0": tty0 --- (expect "OK"). 
[I] May 22 15:57:38 ndm: Mobile::TtyDevice: "UsbLte0": tty0 --> "OK" (got it). 
[I] May 22 15:57:38 ndm: Mobile::TtyDevice: "UsbLte0": tty0 <-- "AT+CPMS="ME"" (expect "CPMS"). 
[I] May 22 15:57:38 ndm: Mobile::TtyDevice: "UsbLte0": tty0 --> "+CPMS: 0,4,0,4,0,50" (got it). 
[I] May 22 15:57:38 ndm: Mobile::TtyDevice: "UsbLte0": tty0 --- (expect "OK"). 
[I] May 22 15:57:38 ndm: Mobile::TtyDevice: "UsbLte0": tty0 --> "OK" (got it). 
[I] May 22 15:57:38 ndm: UsbLte::Connection: "UsbLte0": connection initialized. 
[I] May 22 15:57:38 ndm: Mobile::TtyDevice: "UsbLte0": tty0 <-- "AT+CPMS="SM"" (expect "CPMS"). 
[I] May 22 15:57:38 ndm: Mobile::TtyDevice: "UsbLte0": tty0 --> "+CPMS: 0,50,0,4,0,50" (got it). 
[I] May 22 15:57:38 ndm: Mobile::TtyDevice: "UsbLte0": tty0 --- (expect "OK"). 
[I] May 22 15:57:38 ndm: Mobile::TtyDevice: "UsbLte0": tty0 --> "OK" (got it). 
[I] May 22 15:57:38 ndm: Mobile::TtyDevice: "UsbLte0": tty0 <-- "AT+CREG?" (expect "CREG"). 
[I] May 22 15:57:38 ndm: Mobile::TtyDevice: "UsbLte0": tty0 --> "+CREG: 0,6" (got it). 
[I] May 22 15:57:38 ndm: Mobile::TtyDevice: "UsbLte0": tty0 --- (expect "OK"). 
[I] May 22 15:57:38 ndm: Mobile::TtyDevice: "UsbLte0": tty0 --> "OK" (got it). 
[I] May 22 15:57:38 ndm: Mobile::TtyDevice: "UsbLte0": tty0 <-- "AT+CEREG?" (expect "CEREG"). 
[I] May 22 15:57:38 ndm: Mobile::TtyDevice: "UsbLte0": tty0 --> "+CEREG: 0,1" (got it). 
[I] May 22 15:57:38 ndm: Mobile::TtyDevice: "UsbLte0": tty0 --- (expect "OK"). 
[I] May 22 15:57:38 ndm: Mobile::TtyDevice: "UsbLte0": tty0 --> "OK" (got it). 
[I] May 22 15:57:38 ndm: Mobile::TtyDevice: "UsbLte0": tty0 <-- "AT+CPMS="ME"" (expect "OK"). 
[I] May 22 15:57:38 ndm: Mobile::TtyDevice: "UsbLte0": tty0 --> "+CPMS: 0,4,0,4,0,50". 
[I] May 22 15:57:38 ndm: Mobile::TtyDevice: "UsbLte0": tty0 --> "OK" (got it). 
[I] May 22 15:57:38 ndm: Mobile::TtyDevice: "UsbLte0": tty0 <-- "AT+CMGD=?" (expect "CMGD"). 
[I] May 22 15:57:38 ndm: Mobile::TtyDevice: "UsbLte0": tty0 --> "+CMGD: (),(0,1,2,3,4)" (got it). 
[I] May 22 15:57:38 ndm: Mobile::TtyDevice: "UsbLte0": tty0 --- (expect "OK"). 
[I] May 22 15:57:38 ndm: Mobile::TtyDevice: "UsbLte0": tty0 --> "OK" (got it).

At first it send AT+CGDCONT=0,"IP" then AT+CGDCONT=0 then AT+CGDCONT=1,"IP","pro"

Perhaps by this commands it is removing the context 0 entry and will allow "pro" to be used as the APN for context 1 successfully. By default answer from modem about context is

 AT+CGDCONT?;+CFUN?
+CGDCONT: 0,"IP","pro","84.15.195.41",0,0,0,0,0,0,0,0,0,0
+CGDCONT: 1,"IPV4V6","pro","0.0.0.0,0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0",0,0,0,0,0,0,0,0,0,0
+CGDCONT: 2,"IP","pro","0.0.0.0",0,0,0,0,0,0,0,0,0,0
+CGDCONT: 3,"IP","pro","0.0.0.0",0,0,0,0,0,0,0,0,0,0
+CFUN: 1,0
OK
koshev-msk commented 1 year ago

Hi! Thank for u issue! Remove all profiles from CGDCONT and log next commands

APN=pro PDP=IP gcom -d /dev/$TTYDEV -s /etc/gcom/xmm-connect.gcom
gcom -d /dev/$TTYDEV -s /etc/gcom/xmm-config.gcom
newdanceradio commented 1 year ago

Hello @koshev-msk, thank you for your answer. I found the fix, need to add 3 additional lines: AT+CGATT=0 AT+CGDCONT=0,"IP" AT+CGDCONT=0 in xmm-connect.gcom I can confirm, that with this fix L860gl modem is working correctly with standard APN "internet" and with APN "pro" Please add this fix to your github repository. Now it looks like this

 opengt
  set com 115200n81
  set comecho off
  set senddelay 0.02
  waitquiet 0.2 0.2

  send "AT+CMEE=2^m"
  send "AT+COPS=0^m"
  send "AT+CGATT=0^m"
  send "AT+CGDCONT=0,\"IP\""
  send "AT+CGDCONT=0^m"
  send "AT+CGPIAF=1,0,0,0^m"
  send "AT+XDNS=1,1^m"
  send "AT+CGDCONT=1^m"
  send "AT+CGDCONT=1,\""
  send $env("PDP")
  send "\",\""
  send $env("APN")
  send "\"^m"
  send "AT+CGACT=1,1^m"
  send "AT+CGPADDR=1^m"

  send "AT+XDATACHANNEL=1,1,\"/USBCDC/0\",\"/USBHS/NCM/0\",2,1^m"
  send "AT+CGDATA=\"M-RAW_IP\",1^m"
  get 1 "" $s
  print $s
koshev-msk commented 7 months ago

Try new release xmm-modem https://github.com/koshev-msk/modemfeed/commit/b465971ca59b158d2a303083a520598cdfe8cf54 add in config next string

option profile '0'

newdanceradio commented 7 months ago

Спасибо, попробую, единственное, в какой именно конфиг прописать option profile '0' ?

koshev-msk commented 7 months ago

Example

# file /etc/config/network
config interface 'wwan'
    option proto 'xmm'
    option profile '0'
    option apn 'pro'
    option bla 'bla'
newdanceradio commented 5 months ago

Example

# file /etc/config/network
config interface 'wwan'
  option proto 'xmm'
  option profile '0'
  option apn 'pro'
  option bla 'bla'

Hi Konstantin, sorry for late reply. I can confirm, that wtih xmm-modem 0.1.3 and with option profile '0' in config APN pro is working correctly.