// Based on the EtherCard library example 'backSoon.ino' // 2011-01-30 // // License: GPLv2 // // Present an "I'm Alive' web page" #include #define STATIC 1 // set to 1 to disable DHCP (adjust myip/gwip values below) #if STATIC // ethernet interface ip address static byte myip[] = { 192,168,0,250 }; // gateway ip address static byte gwip[] = { 192,168,0,1 }; #endif // ethernet mac address - must be unique on your network static byte mymac[] = { 0x4e,0x61,0x6e,0x6f,0x64,0x65 }; byte Ethernet::buffer[500]; // tcp/ip send and receive buffer const char page[] PROGMEM = "HTTP/1.0 200 OK\r\n" "Content-Type: text/html\r\n" "Retry-After: 600\r\n" "\r\n" "" "" "I'm Alive" "" "" "

The Nanode Lives Again !!

" "

" "OK, so not exactly a lot to see here,
" "But the Nanode is alive.
" "

" "Link back to Mastodon" "" "" ; void setup(){ Serial.begin(57600); Serial.println("\n[ImAlive]"); // Change 'SS' to your Slave Select pin, if you arn't using the default pin if (ether.begin(sizeof Ethernet::buffer, mymac, 8) == 0) Serial.println( "Failed to access Ethernet controller"); #if STATIC ether.staticSetup(myip, gwip); #else if (!ether.dhcpSetup()) Serial.println("DHCP failed"); #endif ether.printIp("IP: ", ether.myip); ether.printIp("GW: ", ether.gwip); ether.printIp("DNS: ", ether.dnsip); } void loop(){ // wait for an incoming TCP packet, but ignore its contents if (ether.packetLoop(ether.packetReceive())) { memcpy_P(ether.tcpOffset(), page, sizeof page); ether.httpServerReply(sizeof page - 1); } }