Hi,
Did someone already have tried to start an ICMP Ping inside a Telnet session?
My experience is that as soon the the "ping" is started the Telnet (TCP) session is reset (RST).
I am running a Telnet server on an Arduino Uno (1.01) with an Ethernet Shield.
With the simplest sketch below, without the "ping" function the Telnet is working.
With the ping function,while looping on the "ping" function a TCP RST is send to the client .
Any idea ?
Robert
// Trace
4 4.655949 192.168.0.252 192.168.0.104 TCP 60 telnet > 56676 [RST] Seq=1 Win=0 Len=0
// Script
#include <SPI.h>
#include <Ethernet.h>
#include <ICMPPing.h>
byte mac[] = {0xDE, 0xAD, 0xBE, 0xEF, 0xFE, 0xED}; // max address for ethernet shield
IPAddress ip (192,168,0,252); // ip address for ethernet shield
IPAddress gateway (192,168,0,1);
IPAddress subnet (255,255,255,0);
byte pingAddr[] = {195,130,131,38}; // ip address to ping
SOCKET pingSocket = 0;
int charsReceived = 0;
boolean connectFlag = 0;
char buffer [256];
EthernetServer myIPserver = 23;
EthernetClient myIPclient;
ICMPPing ping(pingSocket);
void setup()
{
Ethernet.begin(mac, ip, dns, gateway, subnet);
}
void loop()
{
if (myIPserver.available() && !connectFlag)
{
connectFlag = 1;
myIPclient = myIPserver.available();
printPrompt();
}
// COMMENT and UNCOMMENT THIS LINE
ping(4, pingAddr, buffer);
delay(500);
}
void printPrompt()
{
myIPclient.flush();
charsReceived = 0;
myIPclient.print("\n> ");
}