Arduino Uno + enc28j60 - still not working
hello everyone,
i'm trying connect arduino uno enc28j60 ethernet module. wiring seems right (it made this:
the red , green led on ethernet module on, yellow led blinking
the router use d-link dir-300, standard firmware, ethernet cable enc plugged 1 of lan ports of router.
the library used ethercard, test sketch "backsoon" taken 1 of tutorials (so problem must not in code):
the device ip adress set 192.168.0.200 there's no other device ip, mac taken 1 of sketches (there must no devices such mac in network). gateway set same ip adress use open router control panel (is right?).
the result is, after [backsoon] serial monitor shows nothing, ends "dhcp failed". if use static ip (#define static 1), in serial monitor ip, gw , mac shown, same i've set previously, going ip browser (or pinging it) pc gives no result.
can me such issue? have read lot, , still haven't found useful case.
ps ide i've tried use 1.0.4 , 1.0
thanks.
paul.
i'm trying connect arduino uno enc28j60 ethernet module. wiring seems right (it made this:
code: [select]
vcc - 3.3v
gnd - gnd
sck - pin 13
so - pin 12
si - pin 11
cs - pin 8
the red , green led on ethernet module on, yellow led blinking
the router use d-link dir-300, standard firmware, ethernet cable enc plugged 1 of lan ports of router.
the library used ethercard, test sketch "backsoon" taken 1 of tutorials (so problem must not in code):
code: [select]
// present "will web page", stand-in webserver.
// 2011-01-30 <jc@wippler.nl> http://opensource.org/licenses/mit-license.php
#include <ethercard.h>
#define static 0 // set 1 disable dhcp (adjust myip/gwip values below)
#if static
// ethernet interface ip address
static byte myip[] = { 192,168,0,200 };
// gateway ip address
static byte gwip[] = { 192,168,0,1 };
#endif
// ethernet mac address - must unique on network
static byte mymac[] = { 0xdd,0xdd,0xdd,0x00,0x00,0x01 };
byte ethernet::buffer[500]; // tcp/ip send , receive buffer
char page[] progmem =
"http/1.0 503 service unavailable\r\n"
"content-type: text/html\r\n"
"retry-after: 600\r\n"
"\r\n"
"<html>"
"<head><title>"
"service temporarily unavailable"
"</title></head>"
"<body>"
"<h3>this service unavailable</h3>"
"<p><em>"
"the main server off-line.<br />"
"please try again later."
"</em></p>"
"</body>"
"</html>"
;
void setup(){
serial.begin(57600);
serial.println("\n[backsoon]");
if (ether.begin(sizeof ethernet::buffer, mymac) == 0)
serial.println( "failed 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 incoming tcp packet, ignore contents
if (ether.packetloop(ether.packetreceive())) {
memcpy_p(ether.tcpoffset(), page, sizeof page);
ether.httpserverreply(sizeof page - 1);
}
}
the device ip adress set 192.168.0.200 there's no other device ip, mac taken 1 of sketches (there must no devices such mac in network). gateway set same ip adress use open router control panel (is right?).
the result is, after [backsoon] serial monitor shows nothing, ends "dhcp failed". if use static ip (#define static 1), in serial monitor ip, gw , mac shown, same i've set previously, going ip browser (or pinging it) pc gives no result.
can me such issue? have read lot, , still haven't found useful case.
ps ide i've tried use 1.0.4 , 1.0
thanks.
paul.
do have link on router? (that's led on router showing there physical connection between 2 devices).
you don't need gateway if you're connecting lan.
you don't need gateway if you're connecting lan.
Arduino Forum > Using Arduino > Networking, Protocols, and Devices (Moderator: fabioc84) > Arduino Uno + enc28j60 - still not working
arduino
Comments
Post a Comment