I need to interface ethernet with my arduino and got an ENC28J60 module
from ebay
[ http://www.ebay.in/itm/ENC28J60-ETHERNET-LAN-NETWORK-MODULE-FOR-ARDUINO-AVR-and-others-/301760059363?hash=item46424d17e3:g:f3QAAOSwNNxWE50r ]
I followed the tutorial :
[//www.tweaking4all.com/hardware/arduino/arduino-enc28j60-ethernet/]
connected the module to my arduino UNO as,
ENC28J60 ETHER_28J60 Ethercard UIPEthernet My eBay Module
module <---------------arduino pin map (lib wise)------------------------>
Pin name
SS 10 8 (!) 10 10
MOSI (SI) 11 11 11 11
MISO (SO) 12 12 12 12
SCK 13 13 13 13
VCC <---------------------V3.3------------------->
GND <---------------------GND------------------->
I don't have an ethernet connection, i use USB dongle to connect net to my pc------so i shared my USB dongle connection to LAN
connected
RJ45 cable b/w pc and ENC28J60 module, turned on USB dongle net and No
status LEDs blink on ENC28J60 module's ethernet port ---------- OK
now I got UIPEthernet library, and uploaded the following example to my Arduino uno
<code style="max-height: none; height: 200px;" class="bbc_code">#include <UIPEthernet.h> // Used for Ethernet
// * ETHERNET SETTING *
byte mac[] = { 0x54, 0x34, 0x41, 0x30, 0x30, 0x31 };
IPAddress ip(192, 168, 1, 179);
EthernetServer server(80);
void setup() {
Serial.begin(9600);
// start the Ethernet connection and the server:
Ethernet.begin(mac, ip);
server.begin();
Serial.print("IP Address: ");
Serial.println(Ethernet.localIP());
}
void loop() {
// listen for incoming clients
EthernetClient client = server.available();
if (client)
{
Serial.println("-> New Connection");
// an http request ends with a blank line
boolean currentLineIsBlank = true;
while (client.connected())
{
if (client.available())
{
char c = client.read();
// if you've gotten to the end of the line (received a newline
// character) and the line is blank, the http request has ended,
// so you can send a reply
if (c == 'n' && currentLineIsBlank)
{
client.println("<html><title>Hello World!</title><body><h3>Hello World!</h3></body>");
break;
}
if (c == 'n') {
// you're starting a new line
currentLineIsBlank = true;
}
else if (c != 'r')
{
// you've gotten a character on the current line
currentLineIsBlank = false;
}
}
}
// give the web browser time to receive the data
delay(10);
// close the connection:
client.stop();
Serial.println(" Disconnectedn");
}
}
even now No status LEDs on ethernet port of ENC28J60 module glows, only red power indicator glows
it
seems that my pc is not 'giving' internet traffic to ENC28J60 module as
No status LEDs on ethernet port of ENC28J60 module glows,
also on my pc LAN icron shows unpluged ??
Do
i need a switch or router or ethernet connection only to use ENC28J60
module, i cannot share my pc net ??, or something else I am doing
wrong???
Please help me, I am scared.......is my ENC28J60 module faulty??
Please help
Thanks in advance