#include #include // For Wiznet W5500 chip static byte MAC[] = {0x74,0x69,0x69,0xef,0xef,0xef}; static EthernetServer PORT23(23); /* Listen on telnet port 23 for inbound connections */ void loop() { EthernetClient port23 = PORT23.available(); if (port23 && port23.connected()) { Serial.println("port23 Connect"); while (port23) { if (!port23.connected()) { port23.stop(); } else { while (Serial.available()) port23.write(Serial.read()); } int len = port23.available(); if (len) { byte buf[128]; if (len > sizeof(buf)) len = sizeof(buf); len = port23.read(buf, len); Serial.write(buf, len); } } Serial.println("port23 Disconnect"); } } void setup() { Serial.begin(115200); delay(1000); Serial.println("Setup()"); Ethernet.begin(MAC); Serial.println("DHCP done."); delay(200); // Necessary?? Serial.print("Local IP is "); Serial.println(Ethernet.localIP()); PORT23.begin(); // Start listening for inbound connections Serial.println("Listening on TCP port 23"); }