Connecting to ISP with PPP module

Allo i am really trying to connect to my internet service provider (ISP)

using PPP but with no success up to now. Can someone help me solve this

did anybody do this i nned some examples. I tried the examples from

samples folder with no success. Thanks in advance Alain

… i’m looking for the same problem. I’ve looking on how the tcp/ip stak works but no exaple founded.

There are some undocumented or unsupported guides?

Marco

you have a PPP add-on modules!!! That’s right?

only now i’ve doscovered it…

i buyed and now i’m waiting for the code… with the window opened…

tnx

but i’ll not close these tread untill it 'll work :slight_smile:

Marco

ok, i’ve installed the ppp developing add-on but when i scall my PPP activation procedure i get:
While Debugging: Timeout while waiting for response from target."

doh!

I use a LP3500 board with DC 9.52 and ppp lib latest.

I compile and execute in RAM withoux xmem

here is my procedure and configuration:

( it writes “AttivaPPP: tentativo n. 1” ) and crashes!

#define TCPCONFIG 0 //

#define TIMEZONE +1
#define LCP_TIMEOUT 5000

//Use serial port C (IF_PPP2)
#define USE_PPP_SERIAL 0x01

// ECCO COSA POSSO DEBUGGARE CON IL PPP
#define PPP_VERBOSE
//#define PPP_DEBUG
//#define PPPLINK_VERBOSE
//#define PPPLINK_DEBUG
//#define SMTP_VERBOSE
//#define SMTP_DEBUG 1
#define CHAT_VERBOSE
//#define CHAT_DEBUG

// utenti e numero da comporre ( solo quando registrato! )
#define DIALUP_NAME “”
#define DIALUP_PASSWORD “”
#define DIALUP_NUMBER “#777

#use “dcrtcp.lib”

/*-=0=-
** connessione **
se co volessimo connettere da zero:
#define DIALUP_SENDEXPECT “ATZ #ok ATDT” DIALUP_NUMBER " #CONNECT ‘’ #ogin: @%0 #word: @%1 ~"

non abbiamo il chat script quindi:

  1. resetto il modem
  2. aspetto OK
  3. chiamo il numero del mio amato ISP
  4. attendo il CONNECT
  5. attendo la ~ che vuol dire che il PPP e’ partito
    -=0=-*/
    #define DIALUP_SENDEXPECT “ATZ #ok ATDT” DIALUP_NUMBER " #CONNECT ‘’ ~"

int AttivaPPP ( void ) {
/*-=0=-
Attiva la connessione internet via PPP

ritorna 1 in caso di successo, 0 altrimenti

esegue NTENTATIVIPPP prima di dire che ha fallito
-=0=-*/

static int count;
static char buffer[100];
static unsigned long int tempo, t;

tempo = LeggiRTC();
printf( "AttivaPPP: entro ed inizio a connettermi…
");
Disable_HW_WDT(); // qua posso perdere un bel po di tempo!!!
for(count = 0; count < 3; count++)
{
printf( "AttivaPPP: tentativo n. %d
", count+1);
//configure PPP for dialing in to ISP and bring it up
ifconfig(IF_DEFAULT,
IFS_PPP_SPEED, 19200L,
IFS_PPP_RTSPIN, PBDR, NULL, 7, // Note: the NULL is for the shadow register. From DC9.0,
// this is computed automatically - the value passed here
// for the shadow register is ignored.
IFS_PPP_CTSPIN, PBDR, 0,
IFS_PPP_FLOWCONTROL, 1,
IFS_PPP_SENDEXPECT, DIALUP_SENDEXPECT,
IFS_PPP_HANGUP, “ATH #ok”,
IFS_PPP_MODEMESCAPE, 1,
IFS_PPP_ACCEPTIP, 1,
IFS_PPP_ACCEPTDNS, 1,
IFS_PPP_REMOTEAUTH, DIALUP_NAME, DIALUP_PASSWORD,
IFS_UP,
IFS_END);

while(ifpending(IF_DEFAULT) & 1) {
tcp_tick(NULL);
}
if (ifstatus(IF_DEFAULT)) break;
}
Enable_HW_WDT();
hitwd();
if(ifstatus(IF_DEFAULT) == 0 ) {
printf( "AttivaPPP: errore di connessione
");
return 0;
}
// ok mi sono connesso!
ifconfig(IF_DEFAULT, IFG_IPADDR, &t, IFS_END);
printf("AttivaPPP: IP address: %s in %ld s
", inet_ntoa( buffer, t), LeggiRTC() - tempo);
return 1;

}

Allo !

I am still confused on how to connect with ISP using PPP2.03 i emailed

customer service and they sent back some usefull info. My problem seem to

be very basic but i still can’t get it done. This is the line of code responsible

for sending and receiving ASCII cars

#define DIALUP_SENDEXPECT1 “ATDT18193212390\r CONNECT ‘’ ogin: xxxxx word: zzzzz PPP”

where xxxxx is my Login(username) and zzzzz is my password. The thing

is i configured the modem on my PC to be linked with com5 serial port

this could be changed to any available port, but when i run the examples for

PPP in the samples folder, the Rabbit running the program doesn’t see

the modem. I disabled flow control and i am only using Tx, Rx, GND, to

communicate with the modem. I’m also using a serial to USB converter

i don’t know if this could create problem since my PC doesn’t have a DB9

Basically it is very straith forward to send a string of command using a

serial port but in this case something is not happening. I would like to know

why the example programs can’t communicate with my modem. Thanks

Allo Ventunocm!

Try to go in project options
—> communications

and take check off of Enable Processor Verification. Ciao! Alain

now i connect…

connect but no connection works example:

int InviaSentenzeRaccolte( char vettore, charbuff ) {
int conta, bl;
unsigned long int tempo;
char *punta;
//static buff[MAXBUFF+1];

hitwd();
if ( tcp_open(&socket,0,atol(DEST),PORT,NULL) == 0L ) {
printf( "InviaSentenzeRaccolte: non sono riuscito a connettermi!
");
return 0;
}

// ok ho iniziato i tentativi di connessione
tempo = LeggiRTC()+TCPTOUT;

while(!sock_established(&socket) && sock_bytesready(&socket)==-1 && LeggiRTC()= tempo ) {
printf( "InviaSentenzeRaccolte: errore chiudendo dolcemente la socket!
");
sock_abort(&socket);
}
return 1;
}

I should send the content of vettore and what i receive i put into buff

but he sad to me that has an error on:
tcp_open(&socket,0,atol(DEST),PORT,NULL)

socket is defined in the general space as:

static tcp_Socket socket;

Hi all, i’ve solved the problem using a Wism GPRS modem

if you want some working fine i’ve buyed from:

http://www.rccitaly.com/Erco-Gener/Prodotti-ErcoGener.htm

If you want refer that i’ve sent to you the adress!

Marco B.