i am finally jumping in to use the UIPEthernet library, but rather than add this waay too elementary problem into that ongoing thread, though i'd just make a separate one.
i'm trying out this Example code; TcpServer.ino;
/*
* UIPEthernet EchoServer example.
*
* UIPEthernet is a TCP/IP stack that can be used with a enc28j60 based
* Ethernet-shield.
*
* UIPEthernet uses the fine uIP stack by Adam Dunkels <adam@sics.se>
*
* -----------------
*
* This Hello World example sets up a server at 192.168.1.6 on port 1000.
* Telnet here to access the service. The uIP stack will also respond to
* pings to test if you have successfully established a TCP connection to
* the Arduino.
*
* This example was based upon uIP hello-world by Adam Dunkels <adam@sics.se>
* Ported to the Arduino IDE by Adam Nielsen <malvineous@shikadi.net>
* Adaption to Enc28J60 by Norbert Truchsess <norbert.truchsess@t-online.de>
*/
#include <UIPEthernet.h>
EthernetServer server = EthernetServer(23); // was '1000'
void setup()
{
Serial.begin(9600);
uint8_t mac[6] = {0x00,0x01,0x02,0x03,0x04,0x05};
IPAddress myIP(192,168,6,5); // was 192,168,1,6
Serial.println("starting Ethernet...");
Ethernet.begin(mac,myIP);
server.begin();
}
void loop()
{
// Serial.println("begin loop");
size_t size;
if (EthernetClient client = server.available())
{
while((size = client.available()) > 0)
{
uint8_t* msg = (uint8_t*)malloc(size);
size = client.read(msg,size);
Serial.write(msg,size);
free(msg);
}
client.println("DATA from Server!");
client.stop();
}
}
so, it seems straightforward, run the sketch and simply connect to that IP via telnet, perhaps type a character to trigger a response ?; but it doesn't even connect.
is there some fundamental connection i have failed to see ?
i actually tried HyperTerminal first because that's what i'd been using to test Serial communication, then after searching 'telnet' found there was a command line utility.
this was using HyperTerminal (which should also work, right ?)
and then i used telnet;
i changed some parameters thinking it had to be default settings;
it just hangs... but if i unplugged the connection, then i get a response !
i tried Google just to confirm i CAN telnet to somewhere;
and eventually found a confirmed site one CAN telnet to;
could anyone help troubleshoot where the connection to the Arduino fails ?
EDIT:
changed subject to be more useful for future searches