GPRS example - connects even without modem :)

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

GPRS example - connects even without modem :)

Jump to solution
1,179 Views
Novalis
Contributor III

Hello,

I am trying PPP/GPRS example on FRDM-K64F (modified project from twrk60n512 - just pointed to another libraries and changed to hard float and enabled ITTYE) on MQX 4.2.0.1

I was getting this output:

ATDT*99***1#,"IP","internet"

Attempting to establish connection. Please wait.......................DNS server added successfuly.

Connection established

Local address:  216.172.3.241

Remote address: 244.21.73.114

PPP connection ok

GPRS modem connected successfuly

Trying to resolve hostname

Hostname resolution successful

Pinging on address:147.251.48.140

PING_ERROR: error = 0x1510

PING_ERROR: error = 0x1510

PING_ERROR: error = 0x1510

PING_ERROR: error = 0x1510

Trying to sync Time:

SNTP_ERROR: error = 0x1510

PPP connection closed

(I changed NTP name to IP 147.251.48.140 in config, so thats why it got resolved)

Then I accidentaly turned off GPRS modem when doing PPP connection and it still wrote connection established. So I tried to connect serial to my pc and just replied OK 5x and it still wrote "connection establieshed" Smiley Sad

Does anybody know how this can happen? Where is it taking the IPs? Smiley Happy

I found out that it even doesn't call IPCP_up from ipcpfsm.c

Is PPP so buggy or is something wrong with the example or am I doing something wrong?

I also added

ppp_params_ptr->up=modem_ppp_linkup;

ppp_params_ptr->down=modem_ppp_linkdown;

ppp_params_ptr->callback_param=&ppp_sem;

to  modem_ppp_start() and removed ipcp_data variable, because I think it has no use in modem_ppp_start() - PPP_init() is doing that assignment.

Thanks,

Martin

Labels (1)
0 Kudos
1 Solution
850 Views
Novalis
Contributor III

Sorry I didn't  see that there is no check for  ppp_link state after modem_wait_for_ppp(), so I added

if (context_ptr->ppp_link == FALSE)

        {

            modem_debug_print(debug_output, "PPP LINK = FALSE.\n");

            return MODEM_PPP_INIT_ERROR;

        }

after modem_wait_for_ppp()    in modem_supp.c  and changed MODEM_connect

if(error == MODEM_PPP_INIT_ERROR)

            {  

                modem_debug_print(context_ptr->terminal_serial_handler,"\nPPP connection error\n");

                fclose(context_ptr->terminal_serial_handler);

                 fclose(context_ptr->modem_serial_handler);

                _mem_free(context_ptr);

                return(0);

            }

and now it doesn't  write GPRS modem connected successfuly.

I still have to find out why the connection is not establihed with modem connected.

BTW: shell PPP  demo   FRDMK64 Host - WinXP guest is working for me,  vice versa not yet - XP is not replying anything back on serial line, will have to figure it out too ... but I think its more XP problem than MQX, i can see data from MQX coming to XP.

View solution in original post

0 Kudos
2 Replies
851 Views
Novalis
Contributor III

Sorry I didn't  see that there is no check for  ppp_link state after modem_wait_for_ppp(), so I added

if (context_ptr->ppp_link == FALSE)

        {

            modem_debug_print(debug_output, "PPP LINK = FALSE.\n");

            return MODEM_PPP_INIT_ERROR;

        }

after modem_wait_for_ppp()    in modem_supp.c  and changed MODEM_connect

if(error == MODEM_PPP_INIT_ERROR)

            {  

                modem_debug_print(context_ptr->terminal_serial_handler,"\nPPP connection error\n");

                fclose(context_ptr->terminal_serial_handler);

                 fclose(context_ptr->modem_serial_handler);

                _mem_free(context_ptr);

                return(0);

            }

and now it doesn't  write GPRS modem connected successfuly.

I still have to find out why the connection is not establihed with modem connected.

BTW: shell PPP  demo   FRDMK64 Host - WinXP guest is working for me,  vice versa not yet - XP is not replying anything back on serial line, will have to figure it out too ... but I think its more XP problem than MQX, i can see data from MQX coming to XP.

0 Kudos
850 Views
Novalis
Contributor III

Now it seems I have similar problem like   ppp with gprs modem  - I send some data, modem (also BGS2T) sends some data, but connection is not made. I will have to capture the packets and analyze them :smileysad: 

0 Kudos