<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META http-equiv=Content-Type content="text/html; charset=iso-8859-2">
<META content="MSHTML 6.00.2900.2523" name=GENERATOR>
<STYLE></STYLE>
</HEAD>
<BODY bgColor=#ffffff>
<DIV><FONT face=Arial size=2>Hi!</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV>
<DIV><FONT face=Arial size=2>We are evaluating Nut/OS for our telemetry
solution. We have selfmade ATMega128 board with 64 Kb SRAM equiped with Siemens
TC45 and f</FONT><FONT face=Arial size=2>ollowing code isn't
working:</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV>
<DIV><FONT face=Arial size=2>#include <stdlib.h><BR>#include
<string.h><BR>#include <stdio.h><BR>#include
<io.h><BR>#include <fcntl.h></FONT></DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV>
<DIV><FONT face=Arial size=2>#include <sys/socket.h><BR>#include
<sys/osdebug.h><BR>#include <sys/timer.h></FONT></DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV>
<DIV><FONT face=Arial size=2>#include <net/if_var.h><BR>#include
<net/route.h><BR>#include <net/netdebug.h></FONT></DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV>
<DIV><FONT face=Arial size=2>#include <netdb.h></FONT></DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV>
<DIV><FONT face=Arial size=2>#include <dev/debug.h></FONT></DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV>
<DIV><FONT face=Arial size=2>#include <dev/ppp.h><BR>#include
<dev/chat.h><BR>#include <dev/usartavr.h></FONT></DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV>
<DIV><FONT face=Arial size=2>#define PPPCHAT0 "'' AT\\\\Q3 OK AT+CPIN=3333
OK"</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV>
<DIV><FONT face=Arial size=2>#define PPPCHAT1 "'' AT+CGDCONT=1,\"IP\",\"mrt.pl\"
OK"</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV>
<DIV><FONT face=Arial size=2>#define PPPCHAT2 "'' ATD*99***1#
CONNECT"</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV>
<DIV><FONT face=Arial size=2>int main(void){<BR> int rc;<BR> int
pppcom;<BR> u_long baud1 = 9600;<BR> u_long baud0 =
115200; <BR> u_long timeout = 1000;</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV>
<DIV><FONT face=Arial size=2> NutRegisterDevice(&devUsartAvr0, 0,
0);<BR> NutRegisterDevice(&devUsartAvr1, 0,
0);<BR> NutRegisterDevice(&devPpp, 0,
0); <BR> NutRegisterDevice(&devDebug1, 0, 0);</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV>
<DIV><FONT face=Arial size=2> freopen("uart1", "w",
stdout);<BR> _ioctl(_fileno(stdout), UART_SETSPEED,
&baud1);<BR> printf("Debug output
done\n"); <BR> <BR> NutTracePPP(stdout,
1);<BR> NutTraceTcp(stdout,
1);<BR> NutTraceChat(stdout,1);</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV>
<DIV><FONT face=Arial size=2> //TC45 initialization <BR> DDRE =
(1<<DDE2)|(1<<DDE3)|(1<<DDE4)|(1<<DDE5)|(1<<DDE6);<BR> PORTE
=
(1<<PE4)|(1<<PE2)|(1<<PE7);<BR> NutDelay(250);<BR> PORTE
=
(0<<PE4)|(0<<PE2)|(1<<PE7);<BR> <BR> NutSleep(6000);</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV>
<DIV><FONT face=Arial size=2> printf("Open uart...");<BR> if
((pppcom = _open("ppp:uart0", _O_RDWR | _O_BINARY)) == -1) {<BR>
printf("failed to open \n");<BR> for (;;);<BR>
}<BR> puts("done");<BR> <BR> _ioctl(pppcom, UART_SETSPEED,
&baud0);</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV>
<DIV><FONT face=Arial size=2> rc = UART_RTSENABLED | UART_CTSENABLED |
UART_DTRENABLED;<BR> _ioctl(pppcom,UART_SETFLOWCONTROL,&rc);<BR> <BR> _ioctl(pppcom,UART_SETREADTIMEOUT,&timeout);</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV>
<DIV><FONT face=Arial
size=2> printf("Sending..."PPPCHAT0);<BR>
if ((rc = NutChat(pppcom, PPPCHAT0)) != 0)
{<BR>
printf("no connect, reason = %d\n", rc);<BR>
for(;;){<BR>
}<BR>
}<BR>
puts("done");<BR> <BR> NutSleep(4000);<BR> <BR> printf("Sending..."PPPCHAT1);<BR>
if ((rc = NutChat(pppcom, PPPCHAT1)) != 0)
{<BR>
printf("no connect, reason = %d\n", rc);<BR>
for(;;){<BR>
}<BR>
}<BR> puts("done");</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV>
<DIV><FONT face=Arial size=2> NutSleep(4000);</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV>
<DIV><FONT face=Arial
size=2> printf("Sending..."PPPCHAT2);<BR>
if ((rc = NutChat(pppcom, PPPCHAT2)) != 0)
{<BR>
printf("no connect, reason = %d\n", rc);<BR>
for(;;){<BR>
}<BR>
}<BR>
puts("done");<BR> <BR>
printf("Configure PPP...");<BR> rc =
NutNetIfConfig("ppp", 0, 0, 0);<BR> if
(rc != 0)
{<BR>
puts("failed");<BR>
}<BR> puts("done");</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV>
<DIV><FONT face=Arial
size=2> <BR> for(;;){<BR> }<BR> <BR> return
1;<BR> <BR>}<BR></FONT></DIV>
<DIV><FONT face=Arial size=2>and here is debug console output:</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV>
<DIV><FONT face=Arial size=2>
<DIV><FONT face=Arial size=2>Debug output done<BR>Chat trace flags=0x01<BR>Open
uart...<BR>[IPCP-OPEN]<BR>[LCP-OPEN]done<BR>Sending...'' AT+CPIN=3333 OKExpect
'', got ''<BR>Send 'AT+CPIN=3333'<BR>Expect 'OK', got
'AT+CPIN=3333\x0D\x0D\x0AOK'<BR>done<BR>Sending...'' AT+CGDCONT=1,"IP","mrt.pl"
OKExpect '', got ''<BR>Send 'AT+CGDCONT=1,"IP","mrt.pl"'<BR>Expect 'OK', got
'AT+CGDCONT=1,"IP","mrt.pl"\x0D\x0D\x0AOK'<BR>done<BR>Sending...'' ATD*99***1#
CONNECTExpect '', got ''<BR>Send 'ATD*99***1#'<BR>Expect 'CONNECT', got
'ATD*99***1#\x0D\x0D\x0ACONNECT'<BR>done<BR>Configure
PPP...failed<BR>done</FONT></DIV>
<DIV> </DIV>
<DIV>I have enabled RTS/CTS in Nut/OS configuration because this is recommended
for this modem in Siemens technical docs.</DIV>
<DIV> </DIV>
<DIV>Can anyone help me?</DIV>
<DIV> </DIV>
<DIV>Thanks,</DIV></DIV></FONT></BODY></HTML>