Help with PPP connection - modem disconnects for no obvious reason...

classic Classic list List threaded Threaded
17 messages Options
Reply | Threaded
Open this post in threaded view
|

Help with PPP connection - modem disconnects for no obvious reason...

Freddie Chopin-2
Hello!

I'm hoping some good soul with more experience in PPP and GSM modems
will be able to help me out here. As a disclaimer, I have almost zero
experience with GSM modems, so please excuse any obviously stupid
things (;

I have Huawei me906e modem with a working SIM card (I've just checked
it again in my phone and it does connect to the internet and I can
browse www). Some time ago I've checked the modem as a network card for
PC and it was working fine in Windows, but I couldn't get it to work in
Linux, but generally it works fine (in Windows [; ). Now I'm testing it
with lwip in Linux with a simple test application. So I issue some AT
commands, switch the modem to data mode and start lwip. I based my code
on the "example_app" that can be found in the head of the repository. I
did not enable any authorization, as the card does not require user and
password. It seems to work somehow up to a certain point where the
modem just disconnects and switches back to command mode. Here's the
log of what is going on:

-- >8 -- >8 -- >8 -- >8 -- >8 -- >8 -- >8 -- >8 -- >8 -- >8 --

Wrote: AT
Read: OK

Wrote: ATI
Read: Manufacturer: Huawei Technologies Co., Ltd.
Read: Model: ME906E
Read: Revision: 12.430.19.08.00
Read: IMEI: ...
Read: +GCAP: +CGSM
Read: OK

Wrote: AT+COPS=1,0,"PLAY",2
Read: OK

Wrote: AT+COPS?
Read: +COPS: 1,0,"PLAY",2
Read: OK

Wrote: AT+CREG=2
Read: OK

Wrote: AT+CREG?
Read: +CREG: 2,1,"D6","1857B3",2
Read: OK

Wrote: AT+CGREG=1
Read: OK

Wrote: AT+CGREG?
Read: +CGREG: 1,1
Read: OK

Wrote: AT+CGATT=1
Read: OK

Wrote: AT+CGATT?
Read: +CGATT: 1
Read: OK

Wrote: AT+CGACT=1,1
Read: OK

Wrote: AT+CGACT?
Read: +CGACT: 1,1
Read: +CGACT: 2,0
Read: +CGACT: 16,0
Read: OK

Wrote: AT+CGDCONT?
Read: +CGDCONT: 1,"IP","Internet","0.0.0.0",0,0
Read: +CGDCONT: 2,"IP","internet","0.0.0.0",1,1
Read: +CGDCONT: 16,"IP","www.plusgsm.pl","0.0.0.0",0,0
Read: OK

Wrote: ATD*99#
Read: CONNECT 43200000
ppp phase changed[1]: phase=0
ppp_connect[1]: holdoff=0
ppp phase changed[1]: phase=3
pppos_connect: unit 1: connecting
ppp_start[1]
ppp phase changed[1]: phase=6
pppos_send_config[1]: out_accm=FF FF FF FF
ppp_send_config[1]
pppos_recv_config[1]: in_accm=FF FF FF FF
ppp_recv_config[1]
ppp: auth protocols: PAP=0 CHAP=0 CHAP_MD5=0 CHAP_MS=0 CHAP_MS2=0 EAP=0
sent [LCP ConfReq id=0x1 <asyncmap 0x0> <magic 0x7ecae32e> <pcomp> <accomp>]
pppos_write[1]: len=24
ppp_start[1]: finished
pppos_input[1]: got 53 bytes
rcvd [LCP ConfReq id=0x0 <asyncmap 0x0> <auth chap MD5> <magic 0x4fe5c633> <pcomp> <accomp>]
No auth is possible
sent [LCP ConfRej id=0x0 <auth chap MD5>]
pppos_write[1]: len=13
pppos_input[1]: got 46 bytes
rcvd [LCP ConfAck id=0x1 <asyncmap 0x0> <magic 0x7ecae32e> <pcomp> <accomp>]
pppos_input[1]: got 45 bytes
rcvd [LCP ConfReq id=0x1 <asyncmap 0x0> <magic 0x4fe5c633> <pcomp> <accomp>]
sent [LCP ConfAck id=0x1 <asyncmap 0x0> <magic 0x4fe5c633> <pcomp> <accomp>]
pppos_write[1]: len=24
netif_set_mtu[1]: mtu=1500
pppos_send_config[1]: out_accm=0 0 0 0
ppp_send_config[1]
pppos_recv_config[1]: in_accm=0 0 0 0
ppp_recv_config[1]
ppp phase changed[1]: phase=7
ppp phase changed[1]: phase=9
ccp_set[1]: is_open=1, is_up=0, receive_method=0, transmit_method=0
sent [IPCP ConfReq id=0x1 <compress VJ 0f 01> <addr 0.0.0.0> <ms-dns1 0.0.0.0> <ms-dns2 0.0.0.0>]
pppos_write[1]: len=32
pppos_input[1]: got 21 bytes
rcvd [LCP DiscReq id=0x2 magic=0x4fe5c633]
pppos_input[1]: got 14 bytes
^C

-- >8 -- >8 -- >8 -- >8 -- >8 -- >8 -- >8 -- >8 -- >8 -- >8 --

This last "pppos_input[1]: got 14 bytes" is just the "NO CARRIER" from
the modem after it disconnects. This all happens almost instantly -
after switching to data mode all the following commands take less than
a second.

Seeing the first request from the modem (request for CHAP MD5
authorisation), I've also tried to enable "ANY" authorisation mode (or
just CHAP) and using "" both for user and password, but the behaviour
is mostly similar - the modem starts sending CHAP challenges, lwip
doesn't answer anything (I assume this is because the user and password
are empty, right?), and after some time the modem disconnects
("pppos_input[1]: got 14 bytes" == "NO CARRIER"). Here's the log:

-- >8 -- >8 -- >8 -- >8 -- >8 -- >8 -- >8 -- >8 -- >8 -- >8 --

Wrote: AT
Read: OK

Wrote: ATI
Read: Manufacturer: Huawei Technologies Co., Ltd.
Read: Model: ME906E
Read: Revision: 12.430.19.08.00
Read: IMEI: ...
Read: +GCAP: +CGSM
Read: OK

Wrote: AT+COPS=1,0,"PLAY",2
Read: OK

Wrote: AT+COPS?
Read: +COPS: 1,0,"PLAY",2
Read: OK

Wrote: AT+CREG=2
Read: OK

Wrote: AT+CREG?
Read: +CREG: 2,1,"D6","1857B3",2
Read: OK

Wrote: AT+CGREG=1
Read: OK

Wrote: AT+CGREG?
Read: +CGREG: 1,1
Read: OK

Wrote: AT+CGATT=1
Read: OK

Wrote: AT+CGATT?
Read: +CGATT: 1
Read: OK

Wrote: AT+CGACT=1,1
Read: OK

Wrote: AT+CGACT?
Read: +CGACT: 1,1
Read: +CGACT: 2,0
Read: +CGACT: 16,0
Read: OK

Wrote: AT+CGDCONT?
Read: +CGDCONT: 1,"IP","Internet","0.0.0.0",0,0
Read: +CGDCONT: 2,"IP","internet","0.0.0.0",1,1
Read: +CGDCONT: 16,"IP","www.plusgsm.pl","0.0.0.0",0,0
Read: OK

Wrote: ATD*99#
Read: CONNECT 43200000
ppp phase changed[1]: phase=0
ppp_connect[1]: holdoff=0
ppp phase changed[1]: phase=3
pppos_connect: unit 1: connecting
ppp_start[1]
ppp phase changed[1]: phase=6
pppos_send_config[1]: out_accm=FF FF FF FF
ppp_send_config[1]
pppos_recv_config[1]: in_accm=FF FF FF FF
ppp_recv_config[1]
ppp: auth protocols: PAP=1 CHAP=1 CHAP_MD5=1 CHAP_MS=1 CHAP_MS2=1 EAP=1
sent [LCP ConfReq id=0x1 <asyncmap 0x0> <magic 0x8d98cb61> <pcomp> <accomp>]
pppos_write[1]: len=24
ppp_start[1]: finished
pppos_input[1]: got 53 bytes
rcvd [LCP ConfReq id=0x0 <asyncmap 0x0> <auth chap MD5> <magic 0x4fe7b5a6> <pcomp> <accomp>]
sent [LCP ConfAck id=0x0 <asyncmap 0x0> <auth chap MD5> <magic 0x4fe7b5a6> <pcomp> <accomp>]
pppos_write[1]: len=29
pppos_input[1]: got 45 bytes
rcvd [LCP ConfAck id=0x1 <asyncmap 0x0> <magic 0x8d98cb61> <pcomp> <accomp>]
netif_set_mtu[1]: mtu=1500
pppos_send_config[1]: out_accm=0 0 0 0
ppp_send_config[1]
pppos_recv_config[1]: in_accm=0 0 0 0
ppp_recv_config[1]
ppp phase changed[1]: phase=7
pppos_input[1]: got 22 bytes
rcvd [LCP DiscReq id=0x1 magic=0x4fe7b5a6]
pppos_input[1]: got 42 bytes
rcvd [CHAP Challenge id=0x1 <7eea571d3e05e4766c661474fc7750e7>, name = "UMTS_CHAP_SRVR"]
pppos_input[1]: got 41 bytes
rcvd [CHAP Challenge id=0x2 <08b8f55348400529024cbf177c231710>, name = "UMTS_CHAP_SRVR"]
pppos_input[1]: got 41 bytes
rcvd [CHAP Challenge id=0x3 <24aa1a5f425298cf88d54019aae082ef>, name = "UMTS_CHAP_SRVR"]
pppos_input[1]: got 41 bytes
rcvd [CHAP Challenge id=0x4 <be336c79383db9ae2681620386e70c38>, name = "UMTS_CHAP_SRVR"]
pppos_input[1]: got 41 bytes
rcvd [CHAP Challenge id=0x5 <282b34d778bdfda15e64a21976646bf4>, name = "UMTS_CHAP_SRVR"]
pppos_input[1]: got 41 bytes
rcvd [CHAP Challenge id=0x6 <56fc90b6bccfa6e8f8b6901ff863dc55>, name = "UMTS_CHAP_SRVR"]
pppos_input[1]: got 14 bytes
^C

-- >8 -- >8 -- >8 -- >8 -- >8 -- >8 -- >8 -- >8 -- >8 -- >8 --

Any ideas what am I doing wrong? There are just too many variables for
me to go further, as I'm not sure about anything here. Whether the AT
commands that I issue and their arguments are correct, I'm not sure
whether I should stick to "NONE" authentication or just keep using
"ANY" with empty user/password, maybe my lwipopts.h are wrong, and so
on and so on... So any help will be greatly appreciated!

Thanks in advance!

Regards,
FCh


_______________________________________________
lwip-users mailing list
[hidden email]
https://lists.nongnu.org/mailman/listinfo/lwip-users
Reply | Threaded
Open this post in threaded view
|

Re: Help with PPP connection - modem disconnects for no obvious reason...

Sylvain Rochet
Hi Freddie,

On Wed, Mar 20, 2019 at 05:06:29PM +0100, Freddie Chopin wrote:
>
> sent [IPCP ConfReq id=0x1 <compress VJ 0f 01> <addr 0.0.0.0> <ms-dns1 0.0.0.0> <ms-dns2 0.0.0.0>]
> pppos_write[1]: len=32
> pppos_input[1]: got 21 bytes
> rcvd [LCP DiscReq id=0x2 magic=0x4fe5c633]
> pppos_input[1]: got 14 bytes

Could you try with VJ_SUPPORT disabled ?

Sylvain

_______________________________________________
lwip-users mailing list
[hidden email]
https://lists.nongnu.org/mailman/listinfo/lwip-users

signature.asc (188 bytes) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: Help with PPP connection - modem disconnects for no obvious reason...

Freddie Chopin-2
Hello Sylvain!

On Wed, 2019-03-20 at 17:18 +0100, Sylvain Rochet wrote:
> Could you try with VJ_SUPPORT disabled ?

I've also thought about that and already tried that, but the result is
almost identical:

-- >8 -- >8 -- >8 -- >8 -- >8 -- >8 -- >8 -- >8 -- >8 -- >8 --

Wrote: AT
Read: OK

Wrote: ATI
Read: Manufacturer: Huawei Technologies Co., Ltd.
Read: Model: ME906E
Read: Revision: 12.430.19.08.00
Read: IMEI: ...
Read: +GCAP: +CGSM
Read: OK

Wrote: AT+COPS=1,0,"PLAY",2
Read: OK

Wrote: AT+COPS?
Read: +COPS: 1,0,"PLAY",2
Read: OK

Wrote: AT+CREG=2
Read: OK

Wrote: AT+CREG?
Read: +CREG: 2,1,"D6","1857B3",2
Read: OK

Wrote: AT+CGREG=1
Read: OK

Wrote: AT+CGREG?
Read: +CGREG: 1,1
Read: OK

Wrote: AT+CGATT=1
Read: OK

Wrote: AT+CGATT?
Read: +CGATT: 1
Read: OK

Wrote: AT+CGACT=1,1
Read: OK

Wrote: AT+CGACT?
Read: +CGACT: 1,1
Read: +CGACT: 2,0
Read: +CGACT: 16,0
Read: OK

Wrote: AT+CGDCONT?
Read: +CGDCONT: 1,"IP","Internet","0.0.0.0",0,0
Read: +CGDCONT: 2,"IP","internet","0.0.0.0",1,1
Read: +CGDCONT: 16,"IP","www.plusgsm.pl","0.0.0.0",0,0
Read: OK

Wrote: ATD*99#
Read: CONNECT 43200000

ppp phase changed[1]: phase=0
ppp_connect[1]: holdoff=0
ppp phase changed[1]: phase=3
pppos_connect: unit 1: connecting
ppp_start[1]
ppp phase changed[1]: phase=6
pppos_send_config[1]: out_accm=FF FF FF FF
ppp_send_config[1]
pppos_recv_config[1]: in_accm=FF FF FF FF
ppp_recv_config[1]
ppp: auth protocols: PAP=0 CHAP=0 CHAP_MD5=0 CHAP_MS=0 CHAP_MS2=0 EAP=0
sent [LCP ConfReq id=0x1 <asyncmap 0x0> <magic 0x8dada018> <pcomp> <accomp>]
pppos_write[1]: len=24
ppp_start[1]: finished
pppos_input[1]: got 53 bytes
rcvd [LCP ConfReq id=0x0 <asyncmap 0x0> <auth chap MD5> <magic 0x4fdbb468> <pcomp> <accomp>]
No auth is possible
sent [LCP ConfRej id=0x0 <auth chap MD5>]
pppos_write[1]: len=13
pppos_input[1]: got 46 bytes
rcvd [LCP ConfAck id=0x1 <asyncmap 0x0> <magic 0x8dada018> <pcomp> <accomp>]
pppos_input[1]: got 45 bytes
rcvd [LCP ConfReq id=0x1 <asyncmap 0x0> <magic 0x4fdbb468> <pcomp> <accomp>]
sent [LCP ConfAck id=0x1 <asyncmap 0x0> <magic 0x4fdbb468> <pcomp> <accomp>]
pppos_write[1]: len=24
netif_set_mtu[1]: mtu=1500
pppos_send_config[1]: out_accm=0 0 0 0
ppp_send_config[1]
pppos_recv_config[1]: in_accm=0 0 0 0
ppp_recv_config[1]
ppp phase changed[1]: phase=7
ppp phase changed[1]: phase=9
ccp_set[1]: is_open=1, is_up=0, receive_method=0, transmit_method=0
sent [IPCP ConfReq id=0x1 <addr 0.0.0.0> <ms-dns1 0.0.0.0> <ms-dns2 0.0.0.0>]
pppos_write[1]: len=26
pppos_input[1]: got 21 bytes
rcvd [LCP DiscReq id=0x2 magic=0x4fdbb468]
pppos_input[1]: got 14 bytes
^C

-- >8 -- >8 -- >8 -- >8 -- >8 -- >8 -- >8 -- >8 -- >8 -- >8 --

Here's the relevant part of my lwipopts.h:

-- >8 -- >8 -- >8 -- >8 -- >8 -- >8 -- >8 -- >8 -- >8 -- >8 --

#define PPP_SUPPORT             1
#define NUM_PPP                 1
#define PPPOE_SUPPORT           1
#define PPPOS_SUPPORT           1
#define PAP_SUPPORT             1
#define CHAP_SUPPORT            1
#define MSCHAP_SUPPORT          1
#define CCP_SUPPORT             1
#define VJ_SUPPORT              1
#define MD5_SUPPORT             1
#define EAP_SUPPORT                     1
#define PRINTPKT_SUPPORT                1
#define PPP_NOTIFY_PHASE                1
#define FSM_DEFTIMEOUT                  30
#define UPAP_DEFTIMEOUT                 30
#define CHAP_DEFTIMEOUT                 30
#define EAP_DEFREQTIME                  30
#define MPPE_SUPPORT                    1

-- >8 -- >8 -- >8 -- >8 -- >8 -- >8 -- >8 -- >8 -- >8 -- >8 --

Regards,
FCh


_______________________________________________
lwip-users mailing list
[hidden email]
https://lists.nongnu.org/mailman/listinfo/lwip-users
Reply | Threaded
Open this post in threaded view
|

Re: Help with PPP connection - modem disconnects for no obvious reason...

Patrick Klos-2
In reply to this post by Freddie Chopin-2
On 3/20/2019 12:06 PM, Freddie Chopin wrote:

> : : :
> -- >8 -- >8 -- >8 -- >8 -- >8 -- >8 -- >8 -- >8 -- >8 -- >8 --
>
> This last "pppos_input[1]: got 14 bytes" is just the "NO CARRIER" from
> the modem after it disconnects. This all happens almost instantly -
> after switching to data mode all the following commands take less than
> a second.
>
> Seeing the first request from the modem (request for CHAP MD5
> authorisation), I've also tried to enable "ANY" authorisation mode (or
> just CHAP) and using "" both for user and password, but the behaviour
> is mostly similar - the modem starts sending CHAP challenges, lwip
> doesn't answer anything (I assume this is because the user and password
> are empty, right?), and after some time the modem disconnects
> ("pppos_input[1]: got 14 bytes" == "NO CARRIER"). Here's the log:
>
> -- >8 -- >8 -- >8 -- >8 -- >8 -- >8 -- >8 -- >8 -- >8 -- >8 --
>
> Wrote: AT
> Read: OK
>
> Wrote: ATI
> Read: Manufacturer: Huawei Technologies Co., Ltd.
> Read: Model: ME906E
> Read: Revision: 12.430.19.08.00
> Read: IMEI: ...
> Read: +GCAP: +CGSM
> Read: OK
>
> Wrote: AT+COPS=1,0,"PLAY",2
> Read: OK
>
> Wrote: AT+COPS?
> Read: +COPS: 1,0,"PLAY",2
> Read: OK
>
> Wrote: AT+CREG=2
> Read: OK
>
> Wrote: AT+CREG?
> Read: +CREG: 2,1,"D6","1857B3",2
> Read: OK
>
> Wrote: AT+CGREG=1
> Read: OK
>
> Wrote: AT+CGREG?
> Read: +CGREG: 1,1
> Read: OK
>
> Wrote: AT+CGATT=1
> Read: OK
>
> Wrote: AT+CGATT?
> Read: +CGATT: 1
> Read: OK
>
> Wrote: AT+CGACT=1,1
> Read: OK
>
> Wrote: AT+CGACT?
> Read: +CGACT: 1,1
> Read: +CGACT: 2,0
> Read: +CGACT: 16,0
> Read: OK
>
> Wrote: AT+CGDCONT?
> Read: +CGDCONT: 1,"IP","Internet","0.0.0.0",0,0
> Read: +CGDCONT: 2,"IP","internet","0.0.0.0",1,1
> Read: +CGDCONT: 16,"IP","www.plusgsm.pl","0.0.0.0",0,0
> Read: OK
>
> Wrote: ATD*99#
> Read: CONNECT 43200000
> ppp phase changed[1]: phase=0
> ppp_connect[1]: holdoff=0
> ppp phase changed[1]: phase=3
> pppos_connect: unit 1: connecting
> ppp_start[1]
> ppp phase changed[1]: phase=6
> pppos_send_config[1]: out_accm=FF FF FF FF
> ppp_send_config[1]
> pppos_recv_config[1]: in_accm=FF FF FF FF
> ppp_recv_config[1]
> ppp: auth protocols: PAP=1 CHAP=1 CHAP_MD5=1 CHAP_MS=1 CHAP_MS2=1 EAP=1
> sent [LCP ConfReq id=0x1 <asyncmap 0x0> <magic 0x8d98cb61> <pcomp> <accomp>]
> pppos_write[1]: len=24
> ppp_start[1]: finished
> pppos_input[1]: got 53 bytes
> rcvd [LCP ConfReq id=0x0 <asyncmap 0x0> <auth chap MD5> <magic 0x4fe7b5a6> <pcomp> <accomp>]
> sent [LCP ConfAck id=0x0 <asyncmap 0x0> <auth chap MD5> <magic 0x4fe7b5a6> <pcomp> <accomp>]
> pppos_write[1]: len=29
> pppos_input[1]: got 45 bytes
> rcvd [LCP ConfAck id=0x1 <asyncmap 0x0> <magic 0x8d98cb61> <pcomp> <accomp>]
> netif_set_mtu[1]: mtu=1500
> pppos_send_config[1]: out_accm=0 0 0 0
> ppp_send_config[1]
> pppos_recv_config[1]: in_accm=0 0 0 0
> ppp_recv_config[1]
> ppp phase changed[1]: phase=7
> pppos_input[1]: got 22 bytes
> rcvd [LCP DiscReq id=0x1 magic=0x4fe7b5a6]
> pppos_input[1]: got 42 bytes
> rcvd [CHAP Challenge id=0x1 <7eea571d3e05e4766c661474fc7750e7>, name = "UMTS_CHAP_SRVR"]

For whatever reason, you're not responding to the CHAP challenges.

Are you dialing into an ISP (which would require authentication) or into
another system configured to be a "server"?  Either way, the peer is
expecting you to have a username and password of some kind, but you're
not responding to their challenges.

Also, what version of LwIP are you using?  I can't find some of these
debug strings (like "CHAP Challenge") in my (2.1.2) sources. And are you
sure all your modules were compiled with PPP_DEBUG defined as non-zero?

Patrick Klos
Klos Technologies, Inc.

> pppos_input[1]: got 41 bytes
> rcvd [CHAP Challenge id=0x2 <08b8f55348400529024cbf177c231710>, name = "UMTS_CHAP_SRVR"]
> pppos_input[1]: got 41 bytes
> rcvd [CHAP Challenge id=0x3 <24aa1a5f425298cf88d54019aae082ef>, name = "UMTS_CHAP_SRVR"]
> pppos_input[1]: got 41 bytes
> rcvd [CHAP Challenge id=0x4 <be336c79383db9ae2681620386e70c38>, name = "UMTS_CHAP_SRVR"]
> pppos_input[1]: got 41 bytes
> rcvd [CHAP Challenge id=0x5 <282b34d778bdfda15e64a21976646bf4>, name = "UMTS_CHAP_SRVR"]
> pppos_input[1]: got 41 bytes
> rcvd [CHAP Challenge id=0x6 <56fc90b6bccfa6e8f8b6901ff863dc55>, name = "UMTS_CHAP_SRVR"]
> pppos_input[1]: got 14 bytes
> ^C
>
> -- >8 -- >8 -- >8 -- >8 -- >8 -- >8 -- >8 -- >8 -- >8 -- >8 --
>
> Any ideas what am I doing wrong? There are just too many variables for
> me to go further, as I'm not sure about anything here. Whether the AT
> commands that I issue and their arguments are correct, I'm not sure
> whether I should stick to "NONE" authentication or just keep using
> "ANY" with empty user/password, maybe my lwipopts.h are wrong, and so
> on and so on... So any help will be greatly appreciated!
>
> Thanks in advance!
>
> Regards,
> FCh
>
>
> _______________________________________________
> lwip-users mailing list
> [hidden email]
> https://lists.nongnu.org/mailman/listinfo/lwip-users


_______________________________________________
lwip-users mailing list
[hidden email]
https://lists.nongnu.org/mailman/listinfo/lwip-users
Reply | Threaded
Open this post in threaded view
|

Re: Help with PPP connection - modem disconnects for no obvious reason...

Sylvain Rochet
In reply to this post by Freddie Chopin-2
Hello Freddie,

On Wed, Mar 20, 2019 at 05:56:10PM +0100, Freddie Chopin wrote:
> Hello Sylvain!
>
> On Wed, 2019-03-20 at 17:18 +0100, Sylvain Rochet wrote:
> > Could you try with VJ_SUPPORT disabled ?
>
> I've also thought about that and already tried that, but the result is
> almost identical:

The DiscReq LCP packet does not seem to be related at all to the PPP
exchange, but rather just timed after the PPP session is started no
matter what, right ? Could you try aggressively slowing down the serial
tx routine to check that ?

Could you try using `AT+CGDATA="PPP",1` instead of `ATD*99#` ?

Your setup allows you to check using pppd instead of lwIP, maybe that's
worth trying it to get another set of traces.

This is what I used a couple of years ago:

-- /etc/ppp/peers/gprs
show-password
noauth
connect '/etc/ppp/peers/gprs-chat.sh'
debug debug debug
/dev/ttyUSB0
115200
defaultroute
noipdefault
crtscts
novj
novjccomp
noaccomp
nobsdcomp
nopcomp
noccp
-ipv6

-- /etc/ppp/peers/gprs-chat.sh
#!/bin/sh

# call the preparation chat script
/usr/sbin/chat -v -f /etc/chatscripts/gprs-prep
# wait to switch between GPRS/UMTS
sleep 20
# the final chat script:
/usr/sbin/chat -v -f /etc/chatscripts/gprs

-- /etc/chatscripts/gprs-prep
ECHO ON
ABORT BUSY
ABORT 'NO CARRIER'
ABORT ERROR
REPORT CONNECT
TIMEOUT 20
'' ATZ
OK AT&F1
OK AT&D2
OK AT&K3
OK AT+CMEE=2
OK AT#CMEEMODE=1
OK AT#SLED=2
OK AT#GPIO=5,0,2
OK AT#TXMONMODE=1
OK AT+CPIN=1234
OK AT+CGDCONT=1,"IP","websfr","0.0.0.0",0,0
OK

-- /etc/chatscripts/gprs
ECHO ON
ABORT BUSY
ABORT 'NO CARRIER'
ABORT ERROR
REPORT CONNECT
TIMEOUT 20
'' AT+CGACT=1,1
OK AT+CGDATA="PPP",1
CONNECT \d\c

-- /etc/ppp/pap-secrets
"" gprs ""


Sylvain

_______________________________________________
lwip-users mailing list
[hidden email]
https://lists.nongnu.org/mailman/listinfo/lwip-users

signature.asc (188 bytes) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: Help with PPP connection - modem disconnects for no obvious reason...

Sylvain Rochet
In reply to this post by Patrick Klos-2
Hi Patrick,

On Wed, Mar 20, 2019 at 01:20:02PM -0400, Patrick Klos wrote:
>
> For whatever reason, you're not responding to the CHAP challenges.
>
> Are you dialing into an ISP (which would require authentication) or into
> another system configured to be a "server"?  Either way, the peer is
> expecting you to have a username and password of some kind, but you're not
> responding to their challenges.

Well, that's just PPP to a cellular modem, PPP link is only between the
device and the cellular modem to de/serialize IP packets on a serial
link. That's why authentication is never required, cellular modems
usually add some kind of fake authentication to support PPP clients
where authentication can't be disabled.


> Also, what version of LwIP are you using?  I can't find some of these debug
> strings (like "CHAP Challenge") in my (2.1.2) sources. And are you sure all
> your modules were compiled with PPP_DEBUG defined as non-zero?

"CHAP Challenge" is from "CHAP" from chap_protent and "Challenge" from
chap_code_names[].

Debugging seem pretty well enabled, for once in a while I have no clue
what is wrong here, usually it's straightforward from the trace but here
it really isn't.


Sylvain

_______________________________________________
lwip-users mailing list
[hidden email]
https://lists.nongnu.org/mailman/listinfo/lwip-users

signature.asc (188 bytes) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: Help with PPP connection - modem disconnects for no obvious reason...

Patrick Klos-2
On 3/20/2019 1:48 PM, Sylvain Rochet wrote:
> Hi Patrick,

Hi Sylvain,

> On Wed, Mar 20, 2019 at 01:20:02PM -0400, Patrick Klos wrote:
>> For whatever reason, you're not responding to the CHAP challenges.
>>
>> Are you dialing into an ISP (which would require authentication) or into
>> another system configured to be a "server"?  Either way, the peer is
>> expecting you to have a username and password of some kind, but you're not
>> responding to their challenges.
> Well, that's just PPP to a cellular modem, PPP link is only between the
> device and the cellular modem to de/serialize IP packets on a serial
> link. That's why authentication is never required, cellular modems
> usually add some kind of fake authentication to support PPP clients
> where authentication can't be disabled.

OK, but that just begs the question "why is the modem asking for CHAP
authentication"?  Maybe that's how GSM modems work?  Anyway, let's
explore the CHAP process further.

>
>> Also, what version of LwIP are you using?  I can't find some of these debug
>> strings (like "CHAP Challenge") in my (2.1.2) sources. And are you sure all
>> your modules were compiled with PPP_DEBUG defined as non-zero?
> "CHAP Challenge" is from "CHAP" from chap_protent and "Challenge" from
> chap_code_names[].

Oops... sorry, I didn't notice that.

> Debugging seem pretty well enabled, for once in a while I have no clue
> what is wrong here, usually it's straightforward from the trace but here
> it really isn't.

If all the debugging is enabled, I'm curious why we don't see a CHAP
Response being sent out?  I would suggest adding a few PPPDEBUG
statements to chap_input() (especially the few places where is silently
returns) and chap_respond() and see what that reveals?

Patrick


_______________________________________________
lwip-users mailing list
[hidden email]
https://lists.nongnu.org/mailman/listinfo/lwip-users
Reply | Threaded
Open this post in threaded view
|

Re: Help with PPP connection - modem disconnects for no obvious reason...

Freddie Chopin-2
In reply to this post by Sylvain Rochet
Hello again Sylvain!

On Wed, 2019-03-20 at 18:22 +0100, Sylvain Rochet wrote:
> The DiscReq LCP packet does not seem to be related at all to the PPP
> exchange, but rather just timed after the PPP session is started no
> matter what, right ? Could you try aggressively slowing down the
> serial
> tx routine to check that ?

This modem is connected with USB, so I could try adding a `sleep()`
inside the functions that read/write to the device. Would that be what
you have in mind? Previously I've tried to make sure this is not a case
of "modem disconnects X seconds after `ATD*99#`" so I've added a long
sleep (up to 60 seconds) between last AT command and starting lwip, but
this also did not change anything.

> Could you try using `AT+CGDATA="PPP",1` instead of `ATD*99#` ?

I'll try that - `ATD*99#` was recommended in the documentation for this
modem, so I used that.

> Your setup allows you to check using pppd instead of lwIP, maybe
> that's
> worth trying it to get another set of traces.

Generally I think that using pppd is possible here, but the funny thing
is that the first thing I tried was to use this modem as a network card
with Linux - using NetworkManager, ModemManader, pppd and so on. And it
_DID_ connect to the network, got an IP address, DNS servers, etc.,
but... did not work at all (;

https://bbs.archlinux.org/viewtopic.php?id=244862

That's why I then tried in Windows and in there - after a couple of
tricks and hacks - it worked correctly. My plan was therefore to try
using Wireshark to capture USB traffic to this modem to see what's
going on, maybe this will me some hints (assuming I'll manage to do
that)... I'll try to use pppd with your suggestions too.

But generally - is it possible for the modem to misbehave like this
because of some lwip settings or maybe whatever I would set in lwip it
should not result in the modem just disconnecting? I'm not 100% sure
about any part of this code really, so don't know where to focus.

Regards,
FCh


_______________________________________________
lwip-users mailing list
[hidden email]
https://lists.nongnu.org/mailman/listinfo/lwip-users
Reply | Threaded
Open this post in threaded view
|

Re: Help with PPP connection - modem disconnects for no obvious reason...

Freddie Chopin-2
In reply to this post by Patrick Klos-2
Hi Patrick!

On Wed, 2019-03-20 at 13:20 -0400, Patrick Klos wrote:
> For whatever reason, you're not responding to the CHAP challenges.

I assume this is because my user and password are just `""` (empty
strings), but this is just my very wild guess.

> Are you dialing into an ISP (which would require authentication) or
> into
> another system configured to be a "server"?  Either way, the peer is
> expecting you to have a username and password of some kind, but
> you're
> not responding to their challenges.

I'm trying to connect to a GSM modem connected via USB and with that
connect to the internet via ISPs GSM network. Wherever I look it says
that there is no authentication required for this ISP, also in my phone
the same SIM card uses no user and password, with authentication "not
configured".

https://www.play.pl/pomoc/serwis/reczna-konfiguracja-telefonu.html

This is in Polish, but the relevant part is here:

-- >8 -- >8 -- >8 -- >8 -- >8 -- >8 -- >8 --

Transmisja danych - Internet (APN Internet)

    punkt dostępu (apn): internet
    numer dostępowy: *99#
    nazwa użytkownika: brak
    hasło: brak
    dns: dynamiczny

-- >8 -- >8 -- >8 -- >8 -- >8 -- >8 -- >8 --

It says:

-- >8 -- >8 -- >8 -- >8 -- >8 -- >8 -- >8 --

Data transfer - Internet (APN Internet)

access point (apn): internet
dial number: *99#
username: none
password: none
DNS: dynamic

-- >8 -- >8 -- >8 -- >8 -- >8 -- >8 -- >8 --

> Also, what version of LwIP are you using?  I can't find some of
> these
> debug strings (like "CHAP Challenge") in my (2.1.2) sources.

This is git head from a week ago. These strings are built dynamically,
I could not find the complete string either (;

> And are you sure all your modules were compiled with PPP_DEBUG
> defined as non-zero?

In my lwipopts.h I have:

-- >8 -- >8 -- >8 -- >8 -- >8 -- >8 -- >8 --

#define LWIP_DEBUG 1
#define LWIP_DBG_MIN_LEVEL         LWIP_DBG_LEVEL_ALL
#define PPP_DEBUG                  LWIP_DBG_ON
...
#define PRINTPKT_SUPPORT                1

-- >8 -- >8 -- >8 -- >8 -- >8 -- >8 -- >8 --

Regards,
FCh


_______________________________________________
lwip-users mailing list
[hidden email]
https://lists.nongnu.org/mailman/listinfo/lwip-users
Reply | Threaded
Open this post in threaded view
|

Re: Help with PPP connection - modem disconnects for no obvious reason...

Sylvain Rochet
Hi Freddie,

On Wed, Mar 20, 2019 at 07:37:27PM +0100, Freddie Chopin wrote:
> On Wed, 2019-03-20 at 13:20 -0400, Patrick Klos wrote:
> > For whatever reason, you're not responding to the CHAP challenges.
>
> I assume this is because my user and password are just `""` (empty
> strings), but this is just my very wild guess.

I don't think so, CHAP packets are huge and if PPP_USE_PBUF_RAM is not
set and your PBUF_POOL_BUFSIZE is a low value then packet allocation
will fail (lwIP PPP stack does not support chained pbuf), this is my
wild guess about what is happening.

Null secret is allowed in CHAP. See `secret_len = 0; /* assume null
secret if can't find one */` from chap-new.c.

Anyway, PAP does not need big packets, and you should try PAP
authentication with a null login and a null secret. Why compiling the
somewhat huge CHAP support when this is just fake authentication
anyway ? :)

Sylvain

_______________________________________________
lwip-users mailing list
[hidden email]
https://lists.nongnu.org/mailman/listinfo/lwip-users

signature.asc (188 bytes) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: Help with PPP connection - modem disconnects for no obvious reason...

Freddie Chopin-2
On Wed, 2019-03-20 at 20:28 +0100, Sylvain Rochet wrote:

> Hi Freddie,
>
> On Wed, Mar 20, 2019 at 07:37:27PM +0100, Freddie Chopin wrote:
> > On Wed, 2019-03-20 at 13:20 -0400, Patrick Klos wrote:
> > > For whatever reason, you're not responding to the CHAP
> > > challenges.
> >
> > I assume this is because my user and password are just `""` (empty
> > strings), but this is just my very wild guess.
>
> I don't think so, CHAP packets are huge and if PPP_USE_PBUF_RAM is
> not
> set and your PBUF_POOL_BUFSIZE is a low value then packet allocation
> will fail (lwIP PPP stack does not support chained pbuf), this is my
> wild guess about what is happening.
>
> Null secret is allowed in CHAP. See `secret_len = 0; /* assume null
> secret if can't find one */` from chap-new.c.
>
> Anyway, PAP does not need big packets, and you should try PAP
> authentication with a null login and a null secret. Why compiling
> the
> somewhat huge CHAP support when this is just fake authentication
> anyway ? :)

I've enabled PPP_USE_PBUF_RAM and here's the log:

-- >8 -- >8 -- >8 -- >8 -- >8 -- >8 -- >8 -- >8 -- >8 -- >8 -- >8 --

ppp phase changed[1]: phase=0
ppp_connect[1]: holdoff=0
ppp phase changed[1]: phase=3
pppos_connect: unit 1: connecting
ppp_start[1]
ppp phase changed[1]: phase=6
pppos_send_config[1]: out_accm=FF FF FF FF
ppp_send_config[1]
pppos_recv_config[1]: in_accm=FF FF FF FF
ppp_recv_config[1]
ppp: auth protocols: PAP=1 CHAP=1 CHAP_MD5=1 CHAP_MS=1 CHAP_MS2=1 EAP=1
sent [LCP ConfReq id=0x1 <asyncmap 0x0> <magic 0x3123550b> <pcomp> <accomp>]
pppos_write[1]: len=24
ppp_start[1]: finished
pppos_input[1]: got 53 bytes
rcvd [LCP ConfReq id=0x0 <asyncmap 0x0> <auth chap MD5> <magic 0x50b674e9> <pcomp> <accomp>]
sent [LCP ConfAck id=0x0 <asyncmap 0x0> <auth chap MD5> <magic 0x50b674e9> <pcomp> <accomp>]
pppos_write[1]: len=29
pppos_input[1]: got 47 bytes
rcvd [LCP ConfAck id=0x1 <asyncmap 0x0> <magic 0x3123550b> <pcomp> <accomp>]
netif_set_mtu[1]: mtu=1500
pppos_send_config[1]: out_accm=0 0 0 0
ppp_send_config[1]
pppos_recv_config[1]: in_accm=0 0 0 0
ppp_recv_config[1]
ppp phase changed[1]: phase=7
pppos_input[1]: got 21 bytes
rcvd [LCP DiscReq id=0x1 magic=0x50b674e9]
pppos_input[1]: got 41 bytes
rcvd [CHAP Challenge id=0x1 <cefc86de84aa3f70aef9d363b441adf1>, name = "UMTS_CHAP_SRVR"]
No CHAP secret found for authenticating us to UMTS_CHAP_SRVR
sent [CHAP Response id=0x1 <18ccfbce71fa7190be42a696859524c4>, name = ""]
pppos_write[1]: len=25
pppos_input[1]: got 10 bytes
rcvd [CHAP Success id=0x1 ""]
CHAP authentication succeeded
CHAP authentication succeeded
ppp phase changed[1]: phase=9
ccp_set[1]: is_open=1, is_up=0, receive_method=0, transmit_method=0
sent [IPCP ConfReq id=0x1 <compress VJ 0f 01> <addr 0.0.0.0> <ms-dns1 0.0.0.0> <ms-dns2 0.0.0.0>]
pppos_write[1]: len=32
pppos_input[1]: got 14 bytes

-- >8 -- >8 -- >8 -- >8 -- >8 -- >8 -- >8 -- >8 -- >8 -- >8 -- >8 --

Authentication succeeds, yet the modem still disconnects as previously
(; With PAP:

-- >8 -- >8 -- >8 -- >8 -- >8 -- >8 -- >8 -- >8 -- >8 -- >8 -- >8 --

ppp phase changed[1]: phase=0
ppp_connect[1]: holdoff=0
ppp phase changed[1]: phase=3
pppos_connect: unit 1: connecting
ppp_start[1]
ppp phase changed[1]: phase=6
pppos_send_config[1]: out_accm=FF FF FF FF
ppp_send_config[1]
pppos_recv_config[1]: in_accm=FF FF FF FF
ppp_recv_config[1]
ppp: auth protocols: PAP=1 CHAP=0 CHAP_MD5=0 CHAP_MS=0 CHAP_MS2=0 EAP=0
sent [LCP ConfReq id=0x1 <asyncmap 0x0> <magic 0xd4163714> <pcomp> <accomp>]
pppos_write[1]: len=24
ppp_start[1]: finished
pppos_input[1]: got 55 bytes
rcvd [LCP ConfReq id=0x0 <asyncmap 0x0> <auth chap MD5> <magic 0x50b9186d> <pcomp> <accomp>]
sent [LCP ConfNak id=0x0 <auth pap>]
pppos_write[1]: len=12
pppos_input[1]: got 47 bytes
rcvd [LCP ConfAck id=0x1 <asyncmap 0x0> <magic 0xd4163714> <pcomp> <accomp>]
pppos_input[1]: got 53 bytes
rcvd [LCP ConfReq id=0x1 <asyncmap 0x0> <auth pap> <magic 0x50b9186d> <pcomp> <accomp>]
sent [LCP ConfAck id=0x1 <asyncmap 0x0> <auth pap> <magic 0x50b9186d> <pcomp> <accomp>]
pppos_write[1]: len=28
netif_set_mtu[1]: mtu=1500
pppos_send_config[1]: out_accm=0 0 0 0
ppp_send_config[1]
pppos_recv_config[1]: in_accm=0 0 0 0
ppp_recv_config[1]
ppp phase changed[1]: phase=7
sent [PAP AuthReq id=0x1 user="" password=""]
pppos_write[1]: len=10
pppos_input[1]: got 22 bytes
rcvd [LCP DiscReq id=0x2 magic=0x50b9186d]
pppos_input[1]: got 11 bytes
rcvd [PAP AuthAck id=0x1 ""]
PAP authentication succeeded
ppp phase changed[1]: phase=9
ccp_set[1]: is_open=1, is_up=0, receive_method=0, transmit_method=0
sent [IPCP ConfReq id=0x1 <compress VJ 0f 01> <addr 0.0.0.0> <ms-dns1 0.0.0.0> <ms-dns2 0.0.0.0>]
pppos_write[1]: len=32
pppos_input[1]: got 14 bytes

-- >8 -- >8 -- >8 -- >8 -- >8 -- >8 -- >8 -- >8 -- >8 -- >8 -- >8 --

With no authentication it's the same as previously.

I've also tried now with `AT+CGDATA="PPP",1`, but the result is
identical... );

Regards,
FCh


_______________________________________________
lwip-users mailing list
[hidden email]
https://lists.nongnu.org/mailman/listinfo/lwip-users
Reply | Threaded
Open this post in threaded view
|

Re: Help with PPP connection - modem disconnects for no obvious reason...

Freddie Chopin-2
In reply to this post by Freddie Chopin-2
Alternative approach to the problem - could someone recommend a GSM
modem, commercially available in reasonable numbers, M.2 interface,
that works with lwIP? Maybe its the Huawei me906e that is the problem
here, who knows...

Regards,
FCh


_______________________________________________
lwip-users mailing list
[hidden email]
https://lists.nongnu.org/mailman/listinfo/lwip-users
Reply | Threaded
Open this post in threaded view
|

Re: Help with PPP connection - modem disconnects for no obvious reason...

Sylvain Rochet
In reply to this post by Patrick Klos-2
Hi Patrick,

On Wed, Mar 20, 2019 at 02:19:48PM -0400, Patrick Klos wrote:
>
> OK, but that just begs the question "why is the modem asking for CHAP
> authentication"?  Maybe that's how GSM modems work?  Anyway, let's explore
> the CHAP process further.

This is to support PPP clients that require a secure CHAP authentication
although we don't care at all for authentication on a cellular modem.
The cellular modem is going to accept a downgrade to PAP or even no
authentication at all. PPP is designed that authentication methods are
asked/(n)acked in order from the best one to the worst one until both
agrees on a common one, that's why the cellular modem start by CHAP.


> >Debugging seem pretty well enabled, for once in a while I have no clue
> >what is wrong here, usually it's straightforward from the trace but here
> >it really isn't.
>
> If all the debugging is enabled, I'm curious why we don't see a CHAP
> Response being sent out?  I would suggest adding a few PPPDEBUG statements
> to chap_input() (especially the few places where is silently returns) and
> chap_respond() and see what that reveals?

(Answering so this question is not left unanswered for future readers,
although there are clues in the thread)

This is because packet allocation for the reponse failed, probably
because PPP_USE_PBUF_RAM is not set and PBUF_POOL_BUFSIZE is too small
(< RESP_MAX_PKTLEN).


Sylvain

_______________________________________________
lwip-users mailing list
[hidden email]
https://lists.nongnu.org/mailman/listinfo/lwip-users

signature.asc (188 bytes) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: Help with PPP connection - modem disconnects for no obvious reason...

Sylvain Rochet
In reply to this post by Freddie Chopin-2
Hi Freddie,

On Wed, Mar 20, 2019 at 07:29:31PM +0100, Freddie Chopin wrote:

> On Wed, 2019-03-20 at 18:22 +0100, Sylvain Rochet wrote:
> > The DiscReq LCP packet does not seem to be related at all to the PPP
> > exchange, but rather just timed after the PPP session is started no
> > matter what, right ? Could you try aggressively slowing down the
> > serial
> > tx routine to check that ?
>
> This modem is connected with USB, so I could try adding a `sleep()`
> inside the functions that read/write to the device. Would that be what
> you have in mind? Previously I've tried to make sure this is not a case
> of "modem disconnects X seconds after `ATD*99#`" so I've added a long
> sleep (up to 60 seconds) between last AT command and starting lwip, but
> this also did not change anything.
So it always disconnect after the first IPCP packet. That's all what I
wanted to know :)


> > Your setup allows you to check using pppd instead of lwIP, maybe
> > that's worth trying it to get another set of traces.
>
> Generally I think that using pppd is possible here, but the funny thing
> is that the first thing I tried was to use this modem as a network card
> with Linux - using NetworkManager, ModemManader, pppd and so on. And it
> _DID_ connect to the network, got an IP address, DNS servers, etc.,
> but... did not work at all (;
>
> https://bbs.archlinux.org/viewtopic.php?id=244862
That is bad news… if it does not work with plain pppd there is no way it
could work with lwIP.


> That's why I then tried in Windows and in there - after a couple of
> tricks and hacks - it worked correctly. My plan was therefore to try
> using Wireshark to capture USB traffic to this modem to see what's
> going on, maybe this will me some hints (assuming I'll manage to do
> that)...

Having a dump of the working trace would be very helpful. I doubt there
is an issue on PPP itself because the dumped PPP trace is perfectly sane
until the modem stop at first IPCP packet received. But we have no clue
about modem initialization and I'm confident this is where it might be
different and significant.


> I'll try to use pppd with your suggestions too.
>
> But generally - is it possible for the modem to misbehave like this
> because of some lwip settings or maybe whatever I would set in lwip it
> should not result in the modem just disconnecting? I'm not 100% sure
> about any part of this code really, so don't know where to focus.

It should not result in the modem just disconnecting… especially by
sending a "NO CARRIER" raw frame in the middle of a PPP session
bypassing HDLC encoding. This is just never allowed once the modem
entered DATA mode, it should not send garbage in the middle of an HDLC
stream this way… the proper way for the modem to end the PPP session is
to send a LCP TermReq request.


Sylvain

_______________________________________________
lwip-users mailing list
[hidden email]
https://lists.nongnu.org/mailman/listinfo/lwip-users

signature.asc (188 bytes) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: Help with PPP connection - modem disconnects for no obvious reason...

Sylvain Rochet
In reply to this post by Freddie Chopin-2
Hi Freddie,

On Wed, Mar 20, 2019 at 10:16:46PM +0100, Freddie Chopin wrote:
> Alternative approach to the problem - could someone recommend a GSM
> modem, commercially available in reasonable numbers, M.2 interface,
> that works with lwIP? Maybe its the Huawei me906e that is the problem
> here, who

Well, I don't know if they manufacture modems with an M.2 interface, but
I used both Telit and U-blox cellular modems with full success.

Sylvain

_______________________________________________
lwip-users mailing list
[hidden email]
https://lists.nongnu.org/mailman/listinfo/lwip-users

signature.asc (188 bytes) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: Help with PPP connection - modem disconnects for no obvious reason...

Sergey A. Borshch
On 21.03.2019 00:27, Sylvain Rochet wrote:

> Hi Freddie,
>
> On Wed, Mar 20, 2019 at 10:16:46PM +0100, Freddie Chopin wrote:
>> Alternative approach to the problem - could someone recommend a GSM
>> modem, commercially available in reasonable numbers, M.2 interface,
>> that works with lwIP? Maybe its the Huawei me906e that is the problem
>> here, who
>
> Well, I don't know if they manufacture modems with an M.2 interface, but
> I used both Telit and U-blox cellular modems with full success.

Same with Simcom SIM800C, SIM800L, SIM7500E

--
Regards,
   Sergey A. Borshch            mailto: [hidden email]
     SB ELDI ltd. Riga, Latvia

_______________________________________________
lwip-users mailing list
[hidden email]
https://lists.nongnu.org/mailman/listinfo/lwip-users
Reply | Threaded
Open this post in threaded view
|

Re: Help with PPP connection - modem disconnects for no obvious reason...

Freddie Chopin-2
In reply to this post by Freddie Chopin-2
Hello again!

Last week I finally found a proper way to talk to this modem and today
I've tried to systematically investigate it deeper.

First of all - the modem works, I can connect with LTE 4G network, I
can connect to the internet with lwip's PPP, I can connect to MQTT test
broker (with full encryption and authentication of both parties) with
lwip's MQTT code. So far so good (;

It seems that for correct operation of the modem - which turned out to
be the one and only obstacle in making it all work smoothly - I need to
make sure the following conditions are all met.

1. Modem's preferneces of networks is set to 4G-3G-2G
(`AT^SYSCFGEX="030201",3FFFFFFF,1,2,7FFFFFFFFFFFFFFF,,`).

2. Modem selects the network automatically (`AT+COPS=0`).

3. This seems to be most important part! There must be TWO PDP contexts
available - at CID 1 (exactly at 1!) I need to have the usual APN
configuration, at CID 16 (exactly at 16!) I need to have a context with
IP protocol and empty APN (it actually doesn't matter what's in the APN
here) - without that, the modem will NEVER connect to LTE 4G network.

AT+CGDCONT?
+CGDCONT: 1,"IP","internet","0.0.0.0",0,0
+CGDCONT: 16,"IP","","0.0.0.0",0,0
OK

4. There is no need to automatically activate any of the PDP contexts,
however CID 16 will be activated automatically whenever the modem is
connected to LTE 4G.

AT+CGACT?
+CGACT: 1,0
+CGACT: 16,1
OK

5. The modem should be manually attached to the "PS domain" with
`AT+CGATT=1`, otherwise it will work with 3G even if 4G is available.
Executing this command will automatically activate PDP context with CID
16 and connect to LTE 4G.

There may be some flaws here, but so far this procedure has worked
well. I'm not 100% sure that these are all required steps to actually
use a brand new, unconfigured modem, but we will see - let's hope that
this method will work too.

Regards,
FCh


_______________________________________________
lwip-users mailing list
[hidden email]
https://lists.nongnu.org/mailman/listinfo/lwip-users