Arduino 1.0 with enc28j60 Ethernet Shield V1.1

18 december 2011 | Classified in: Electronic | Tags: arduino, ethernet, shield

Here is how to use the enc28j60 Ethernet Shield V1.1 with Arduino 1.0.

Introduction

The Arduino team recently released the Arduino software in version 1.0, which adds a lots of new feature and bug fix (see release notes) but also breaks backward compatibility with sketches and libraries written for the previous versions of the software.

From now, in order to use the cheap enc28j60 Ethernet Shield V1.1 you will need a library that is compatible with the latest revision of the Arduino IDE.

After some research on the web, I found a library that works properly but I still had to change a few path name before I could compile a sketch without error.

Download and install the library

  • On Linux: $HOME/sketchbook/libraries
  • On Mac: $HOME/Documents/Arduino/libraries
  • On Windows: ..\My Documents\Arduino\libraries
  • Open the Arduino software and go to "File → Examples → ETHER_28J60" and try some of the examples.

Use a web browser to turn an LED on or off

  • Connect the Ethernet Shield and Ethernet cable to the Arduino.
  • Upload the code below.
  • Connect an LED between Pin 6 and Ground.
  • Open a web browser and visit http://192.168.1.15/
  • Click the button to turn the LED on or off.

Code

The code below is taken from the library example with some minor modifications from myself:


// A simple web server that turn an LED on or off"

#include "etherShield.h"
#include "ETHER_28J60.h"

int outputPin = 6;

static uint8_t mac[6] = {0x54, 0x55, 0x58, 0x10, 0x00, 0x24};   // this just needs to be unique for your network, 
                                                           
static uint8_t ip[4] = {192, 168, 1, 15}; // IP address for the webserver

static uint16_t port = 80; // Use port 80 - the standard for HTTP

ETHER_28J60 e;

void setup()
{ 
  e.setup(mac, ip, port);
  pinMode(outputPin, OUTPUT);
}

void loop()
{
  char* params;
  if (params = e.serviceRequest())
  {
    e.print("<h1><a href='/?led=off'>Arduino Web Remote</a></h1>");
    if (strcmp(params, "?led=on") == 0)
    {
      digitalWrite(outputPin, HIGH);
      e.print("<a href='?led=off'><button style='border: 1px solid #ff0000; border-left: 10px solid #ff0000' type='button'>LED IS ON</button></a>");
    }
    else if (strcmp(params, "?led=off") == 0)
    {
      digitalWrite(outputPin, LOW);
      e.print("<a href='?led=on'><button style='border: 1px solid #000; border-left: 10px solid #000' type='button'>LED IS OFF</button></a>");
    }
    e.respond();
  }
}

Video

Going further

Here is another example using 2 buttons to control 2 LED, as requested in the comments below.

Reader Contribution

EDIT 01/01/2013: Reader "Nio" have sent me a modified version of the library described above, removing the buffer size limit and adding new print_P function.

If you would like to try Nio's version of the library, you will find it here. (*Not* tested yet)

96 comments

Avatar Gravatar Zephyros said: transparent#1 [wednesday 11 january 2012 at 22:20]

Thank you very much for this updated library. Could you explain how to use this to create a webclient. The examples on this matter from the previous version also don't seem to work any more.

Avatar Gravatar Virtualmix said: transparent#2 [thursday 12 january 2012 at 07:56]

@Zephyros: I'm sorry but so far I haven't tried to use this shield to create a webclient.

I had a quick look around and I would actually recommend you to use the previous versions of the IDE (Arduino 022) in order to have the old webclient examples working.

As far as I can tell, the enc28j60 shield seems very limited compared to the one based on Wiznet W5100. I believe its probably not a bad idea to get one of them for building more complicated projects.

Avatar Gravatar Sebastian said: transparent#3 [thursday 23 february 2012 at 17:08]

It´s possible to set Gateway and Netmask to your example ??? I cannot find how to, with Ethernet Shield V1.1 (Arduino 1.0)

Avatar Gravatar Chaudhry said: transparent#4 [wednesday 21 march 2012 at 22:33]

I tried example 'WebRemote' in ETHER_28J60, but could not upload the program. The error is "ETHER_28J60" does not name a type" and other errors:" 'e' was not declared in this type....". This is my first day of using Arduino. Any help will be appreciated.

Avatar Gravatar Virtualmix said: transparent#5 [saturday 31 march 2012 at 04:22]

@Chaudhry: What version of the Arduino software do you use? (It must be 1.0 or superior)

Did you moved the folders "ETHER_28J60" and "etherShield" into your libraries folder? (I have updated the article for clarification)

Good luck!

Avatar Gravatar citakis said: transparent#6 [monday 02 april 2012 at 09:40]

For me it is working almost perfect. The only problem is that I when I change the port to other than the default 80 (for example 32645) I have no communication (through 192.168.1.15:32645). Am I doing something wrong?

Avatar Gravatar Virtualmix said: transparent#7 [tuesday 03 april 2012 at 12:48]

@ citakis: I guess if you want to use port 32645 you will have to allow incoming traffic from your router to your computer on port 32645 so maybe check your router and firewall settings.
I haven't tried to use a different port but I hope this help. Cheers

Avatar Gravatar André Martins said: transparent#8 [thursday 05 april 2012 at 20:27]

hey man.. nice a lot your mod.. really, really, thnks..
because this library, i can use my ethernet shield now! \o/

so.. 1 more question..
I can show more entrys in the same page using this code?
exemple:
where has this "web remote" I want to put 2 different links to control 2 different things..
just for example: in 1 link I control 1 led.. in other link, in the same page, I control other entry, or led, or something like that..
can i do this? u understand me?

sorry for my english.. i'm a brazilian nerd and i like a lot of arduino and other projects.. if u can help me, i'll congrat u a lot! really nice! =D

thkns man.. see ya
{}'s

Avatar Gravatar Virtualmix said: transparent#9 [friday 06 april 2012 at 19:02]

@André Martins: Yes you can. Here is another example using 2 buttons and 2 LED.
As you can see, the more output you control, the more complicated the code gets...
(I also added the link at the end of the article)

Avatar Gravatar André Martins said: transparent#10 [monday 09 april 2012 at 01:08]

really really thnks man!
sorry for don't see the link..

i'll use this code NOW for my test!
congrats.. and thnks again!
=D

Avatar Gravatar citakis said: transparent#11 [monday 09 april 2012 at 09:17]

Every example is more than welcome. It helps to understand the library better.

I mentioned above a problem I had when using a port other than the default 80. I needed that because I wanted to enter arduino's webserver from outside my lan. I finally understood that I cannot use a port greater than 240. Any unused port from 80 to 240 is working great.

Avatar Gravatar Sebastiaan said: transparent#12 [monday 09 april 2012 at 15:59]

Wow, I finally found some usefull code for my elcheapo enc28j60 :) Thank you very much!

I am trying to make a web controlled relay set for my sun shades. To create a base for my project I found you code very usefull! I have tried to make some changes to the code and instead of switching leds I want to switch relays.

So far so good, however it seems that it goes about 5 times through my loop. Though I haven't defined a loop for 5 times, I most probably think there is something within the library that let my void run for 5 times.

Does anybody know if this is inherent to a function in the library?

if (strcmp(params, "?screen=down") == 0)
{
e.print("<a href='?screen=up'><button style='border: 1px solid #ff0000; border-left: 10px solid #ff0000' type='button'>Scherm omhoog(green led off)</button></a>");
screendown(); //execute lowering sun shade, though this void is repeated 5 times?
}

full code:
http://code.google.com/p/sun-shade-webcontrol/downloads/list

Avatar Gravatar Sebastiaan said: transparent#13 [monday 09 april 2012 at 20:39]

Solved! It seems by using delay, the respond is not in time.

Avatar Gravatar Virtualmix said: transparent#14 [tuesday 10 april 2012 at 10:43]

@citakis: Thank you for your research and for letting us know about how you solved this issue. These sort of information are always very good to know :-)

@Sebastiaan: Glad you solved your problem. Your project seems very cool and I'm glad you found this code useful!

Avatar Gravatar spiri said: transparent#15 [sunday 22 april 2012 at 23:15]

i am trying to make a web controlled light remote for my rf relays. I am trying to use your script with rclibrary, it work very good if i use them from my phone but if i try them from my explorer it halts and crashes the server can you help please. here is the code
// A simple web server that always just says "Hello World"

#include "etherShield.h"
#include "ETHER_28J60.h"
#include <RCSwitch.h>

RCSwitch mySwitch = RCSwitch();

static uint8_t mac[6] = {0x54, 0x55, 0x58, 0x10, 0x00, 0x24}; // this just needs to be unique for your network,
// so unless you have more than one of these boards
// connected, you should be fine with this value.

static uint8_t ip[4] = {192, 168, 0, 15}; // the IP address for your board. Check your home hub
// to find an IP address not in use and pick that
// this or 10.0.0.15 are likely formats for an address
// that will work.

static uint16_t port = 81; // Use port 80 - the standard for HTTP

ETHER_28J60 e;

void setup()
{
e.setup(mac, ip, port);
mySwitch.enableTransmit(8);
}

void loop()
{


char* params;
if (params = e.serviceRequest())

{
e.print("<H1><a href='?cmd=on'>Web Remote</a></H1>");
if (strcmp(params, "?cmd=on") == 0)
{
mySwitch.send(1048597, 24);

e.print("<A HREF='?cmd=off'>Turn off</A>");
}
else if (strcmp(params, "?cmd=off") == 0) // Modified -- 2011 12 15 # Ben Schueler
{
mySwitch.send(1048596, 24);

e.print("<A HREF='?cmd=on'>Turn on</A>");
}
e.respond();
}
}

Avatar Gravatar Virtualmix said: transparent#16 [monday 23 april 2012 at 12:21]

@spiri: Why not using port 80 for your web server?
Also, you said it doesn't work when using "your explorer". Do you mean Internet Explorer?
In that case, I suggest you try with a proper web browser like Firefox.
Also, if you look at the source code of the html page, you can see it is not a standard html document and this might be the reason why your browser gets confused.
(a standard html document should start with a doctype...)
Hope this help :-)

Avatar Gravatar Spiri said: transparent#17 [monday 23 april 2012 at 12:37]

I tryied every explorer i use firefox ... i will try the doctype

Avatar Gravatar CoX# said: transparent#18 [monday 23 april 2012 at 20:08]

Hi. Good i found your site I tried 10 other libraries and codes and none works, finally I tried yours and its works perfectly. Well done. Can someone can show how to add DS18b20 (OneWire.h) sensor to this code. Sry for my english. Regards

Avatar Gravatar Virtualmix said: transparent#19 [wednesday 25 april 2012 at 05:16]

@Spiri: This is strange. If you don't use port 80, make sure you specify the port in the URL like 192.168.1.15:81 for example. (I'm sure you did but it's just incase...)

@Cox#: Sorry I have no experience using this sensor but you can find some help here.

Avatar Gravatar Ustas said: transparent#20 [monday 14 may 2012 at 21:27]

Thx for great library!!! Its work perfectly!

Q: how to change SC pin for ENC28J60 from 10 to 8???

im usung this shield: http://iteadstudio.com/store/index.php?main_page=product_info&cPath=18&products_id=349

if i change:

#define ENC28J60_CONTROL_CS 10

to

#define ENC28J60_CONTROL_CS 8

in file enc28j60.c (and change jumper) - programs not work :(

Avatar Gravatar Derek said: transparent#21 [sunday 20 may 2012 at 12:46]

This library is great... Thanks !
I'd like to add RTC to my project (tinyRTC via I2C). The problem is that with
#include "Wire.h", the sketch compiles... but the server hangs...

Any suggestion ?

Avatar Gravatar Julian said: transparent#22 [tuesday 22 may 2012 at 22:16]

Hello, the shield Arduino ethernet v1.1 it's compatible with the arduino mega 2560?
Thanks! (sorry about my english)

Avatar Gravatar Raghav said: transparent#23 [wednesday 23 may 2012 at 17:28]

Did you restart the router/hub and see if the enc28j60 works?

Avatar Gravatar Derek said: transparent#24 [wednesday 23 may 2012 at 22:08]

Raghav : you can experience what I get myself... just put #include wire.h in you sketch... and you ethershield will hang silently. Remove the same line... it will work.
Where is the bug ?

Yes Julian, Ethershield 1.1 can be used with both mega 1280 or 2560. You have to do some pin bending to on pin 11, 12 and 13 see :
http://www.arduino.cc/cgi-bin/yabb2/YaBB.pl?num=1240732088
but ignore what is said about oin 10 : leave it as it is.

Avatar Gravatar Virtualmix said: transparent#25 [thursday 24 may 2012 at 14:02]

@Derek: Thank you :-)

Avatar Gravatar Derek said: transparent#26 [saturday 26 may 2012 at 09:53]

SOLVED
ethershield 1.1 DOES run with wire.h loaded... if there is enough memory avaible. My sketch just became too big when the wire library was added.

Avatar Gravatar Borges said: transparent#27 [saturday 26 may 2012 at 16:31]

Hello Dereck,

I have an ethernet shield from http://www.ekitszone.com/p/8/enc28j60-ethernet-shield-for-arduino-mega-mega2560 and a arduino mega 1280. I tried to use your libraries for the new arduino 1.0 but it did not work, I saw your post where you suggested to change the pins at enc28j60.c, but nothing happens. Do you have any suggestions ?! Do you believe my problem could be caused by my ethernet shield version ?!

Best Regards.

Avatar Gravatar Julian said: transparent#28 [monday 28 may 2012 at 19:31]

Hello again, I cant connect the arduino ethernet with an arduino mega. I try with the example and library downloaded from this page, with negative results. please help me!. upload a picture of my arduino,,, just for case...
<a href="http://www.mediafire.com/convkey/ec6f/8191zx5xmz5m0n15g.jpg">
Ethernet + Mega 2560</a>

<a href="http://www.mediafire.com/convkey/780c/vv0t8d3x1x6h05s5g.jpg">Ethernet mount</a>

this is the code used:
// A simple web server that always just says "Hello World"

#include "etherShield.h"
#include "ETHER_28J60.h"

int outputPin = 6;

static uint8_t mac[6] = {0x54, 0x55, 0x58, 0x10, 0x00, 0x24}; // this just needs to be unique for your network,
// so unless you have more than one of these boards
// connected, you should be fine with this value.

static uint8_t ip[4] = {192, 168, 1, 15}; // the IP address for your board. Check your home hub
// to find an IP address not in use and pick that
// this or 10.0.0.15 are likely formats for an address
// that will work.

static uint16_t port = 80; // Use port 80 - the standard for HTTP

ETHER_28J60 e;

void setup()
{
e.setup(mac, ip, port);
pinMode(outputPin, OUTPUT);
}

void loop()
{
char* params;
if (params = e.serviceRequest())
{
e.print("<H1>Web Remote</H1>");
if (strcmp(params, "?cmd=on") == 0)
{
digitalWrite(outputPin, HIGH);
e.print("<A HREF='?cmd=off'>Turn off</A>");
}
else if (strcmp(params, "?cmd=off") == 0) // Modified -- 2011 12 15 # Ben Schueler
{
digitalWrite(outputPin, LOW);
e.print("<A HREF='?cmd=on'>Turn on</A>");
}
e.respond();
}
}


thanks again......

Avatar Gravatar Vas said: transparent#29 [tuesday 29 may 2012 at 07:57]

In case someone else is not having much luck using the ENC28J60 Ethernet Shield from ekitszone.com, you MUST first set Pin 4 to HIGH in setup, otherwise the shield will behave erratically (or not work at all).

ex.

pinMode(4, OUTPUT);
digitalWrite(4, HIGH);

After several nights, and countless libraries, it's finally working!! Thank you!!!!

PS. ICMP requests (pings) respond faster with EtherCard library, however this one is smaller.

Avatar Gravatar Derek said: transparent#30 [thursday 31 may 2012 at 21:33]

Hello Borges,

Your shield looks like it is build to match the mega's pinout. I believe you should not remap the pins (only useful to make an "old" ethernet shield work with the mega).
Have you tested the suggested library and examples http://www.ekitszone.com/download/EKitsZoneEtherShield(MEGA).zip ?
Best Regards.

Avatar Gravatar Derek said: transparent#31 [thursday 31 may 2012 at 22:02]

Hello Julian,

Yes, my shield is exactly the same as yours. I've retrieved my memento about "old version" ethershield + Arduino mega for IDE 1.0. It seems that pin 10 must be also bended !!! (sorry, my tries occured last year, but I'm shure it was working). I was bored by these four extra jumpers... Today, I own two shields : the old one associated with a 2009 (latest ethercard library) and the new wz5100 with the mega 1280. Both are cool.

===========
1.Bend Shield pins 10, 11, 12, and 13 slightly away from the mega's connector
2. Using short male-to-male jumpers, make 4 connections from Mega to Shield :
MEGA pin 53 (SS) to Arduino Ethernet Shield pin 10.
MEGA pin 50 (MISO) to Arduino Ethernet Shield pin 12.
MEGA pin 51 (MOSI) to Arduino Ethernet Shield pin 11.
MEGA pin 52 (SCK) to Arduino Ethernet Shield pin 13.

3. Edit arduino 1.0/libraries/Ethercard/enc28j60.cpp as follows :
void ENC28J60::initSPI () {

// modif MEGA
const byte SPI_SS = 53; //10;
const byte SPI_MOSI = 51; //11;
const byte SPI_MISO = 50; //12;
const byte SPI_SCK = 52; //13;
// end modif

Hope it will help !

Avatar Gravatar Borges said: transparent#32 [friday 01 june 2012 at 04:41]

Hello Derek,

I have an ethernet shield from http://www.ekitszone.com/p/8/enc28j60-ethernet-shield-for-arduino-mega-mega2560 and a arduino mega 1280. I tried to use your libraries for the new arduino 1.0 but it did not work, I saw your post where you suggested to change the pins at enc28j60.c, but nothing happens. Do you have any suggestions ?! Do you believe my problem could be caused by my ethernet shield version ?!

Best Regards.

Avatar Gravatar Derek said: transparent#33 [friday 01 june 2012 at 21:22]

Hello Borges,

I think your shield does'nt need any pin bending : it's designed to work directly with the mega. No library modification to do if you use the library linked on the vendors page. Check the file enc28j60.h and you will see :
#define ENC28J60_CONTROL_CS 53
#define SPI_MOSI 51
#define SPI_MISO 50
#define SPI_SCK 52
That's ok for the mega...

If you'd like to use ethercard library, then you should probably edit the lines listed in my post.
Best Regards.

Avatar Gravatar Matthew Peter said: transparent#34 [tuesday 05 june 2012 at 20:55]

Hi mate.
I bought this crappy card the other month on eBay.

So, i mounted the shield, plugged the usb into my arduino and PC.
downloaded the librarys you've provided, and then copy/pasted the sketch.
Uploaded the sketch no dramas.

Plugged the ethernet cable into my router and to the ethernet shield, then plugged my arduino in to power.
green link light comes on, but the amber light flashes very briefly every 10 seconds or so.

Can't see the ip address in my router's attached devices page, nor can i even ping the port.
I've literally tried everything i can, including other librarys and examples from other pages, but still can't even see this thing on my network.

I tried it on a friends network too, still nothing.

Faulty board you think?

Regards, Matt.

Avatar Gravatar Matthew Peter said: transparent#35 [tuesday 05 june 2012 at 20:56]

Ping the IP i meant.**

Avatar Gravatar Matthew Peter said: transparent#36 [tuesday 05 june 2012 at 21:03]

FUCK ME!
AFTER 6 HOURS RESEARCHING, ALL I NEEDED TO DO WAS SET PIN 4 HIGH AND AS AN OUTPUT...

Never buying shit chinese cards again.

Thank's trollmaker for this nice little tutorial :)

Avatar Gravatar Paulvk said: transparent#37 [thursday 07 june 2012 at 06:21]

Have the ENC28J60 working with Bascom with dynamic pages, NTP, serial outputs and lots more for those who are interested have a look at the blog section in the forum at www.mcselec.com/index2.php?option=com_forum&Itemid=59
Regards Paul

Avatar Gravatar Julian said: transparent#38 [thursday 07 june 2012 at 20:58]

Thanks for responding, I had success by connecting the shield. I Have now ask another question, somebody have a functions manual of the library ethernet? for example, function "ES_fill_tcp_data()". I research for internet but i cant find anything.
Thanks again, regards...

Avatar Gravatar CarlosDuino said: transparent#39 [friday 22 june 2012 at 21:24]

I downloaded the zip file and ran the Web server example and it worked just fine. Then I added an HTML code to refresh the web every 20 seconds and realized that after about 200 e.ServiceRequest() events the communication drops. I couldn't find any property to flush the bad packages or a gracefull way to catch this error. The only way out is pushing the RST button on the ethershield, which defits the purpose of having it remotelly.
Anyway is there any way around this? Thx

Avatar Gravatar CarlosDuino said: transparent#40 [monday 25 june 2012 at 17:39]

First of all my apologies for the “defit”. I really meant defeat. This is what I get to press the send button before reading through one more time. Anyway, I added a serial command to the code and I monitored the sensor for 48 hours just to prove that the error was not coming from another part of the code and sure enough the e.ServiceRequest is the one that quits working on me.

Avatar Gravatar BHSU said: transparent#41 [wednesday 27 june 2012 at 02:23]

I'm trying to use your software with a physical button(push button).
I'm not able to update the status LED on the html page when triggered by physical button.
Do you have some software like this?

Avatar Gravatar FACUNDO said: transparent#42 [friday 29 june 2012 at 14:50]

Hello, I downloaded the library and I have loaded, but I have a compilation problem. I could help my email is: facu18_lp@hotmail.com. If anyone can help me in an email I pass the Print Screen error.

Avatar Gravatar Virtualmix said: transparent#43 [friday 29 june 2012 at 17:15]

@BHSU: There is no way you can refresh the html page in your navigator by using a push button. I recommend that you set the html page to refresh itself automatically every x seconds. Try to this in the html part of the code: <meta http-equiv="refresh" content="5">
for refreshing the page every 5 seconds.

@FACUNDO: Please make sure you use Arduino software version 1.0 or superior. If you still have compilation error after that, please make sure you followed the tutorial exactly as described. It should work :-)

Avatar Gravatar Virtualmix said: transparent#44 [friday 29 june 2012 at 17:18]

@CarlosDuino: Sorry but I don't know how to solve this issue :-s

Avatar Gravatar Kiriti said: transparent#45 [saturday 30 june 2012 at 13:36]

Virtualmix awesome work :)
thanks for sharing it and also helping out others :D

i downloaded the library uploaded and everything is fine but when i enter 192.168.1.15 it does not respond :(, pinged it and request timed out, in my router lan dhcp settings no new device is visible
what am i doing wrong here ??
wiring is,CS --> 10,MOSI --> 11,MISO --> 12,SCK --> 13

please help me as i need to complete this project :)

Avatar Gravatar Virtualmix said: transparent#46 [saturday 30 june 2012 at 17:54]

@Kiriti: Hello and thanks for the comment.
Regarding your issue, I don't understand why you have some wiring, is it a shield you are using? I imagine this is where the problem is because the code example definitely work.

Avatar Gravatar kiriti said: transparent#47 [saturday 30 june 2012 at 21:10]

no actually i am using an enc28j60 breakout board, so its just the same thing but in a different packaging, so it has sck,si,so,wdl,int,rst,cs,clkout pins so i want to know what all pins is the shield using in interfacing with arduino.

so maybe a schematic of the shield which this code is designed for would help....

this is the module i am using http://www.embeddedmarket.com/products/ENC28J60-Ethernet-Module/

Avatar Gravatar Virtualmix said: transparent#48 [wednesday 04 july 2012 at 12:36]

@Kiriti: Sorry for late answer. Have a look here:
http://www.nuelectronics.com/download/projects/Ethernet_v1_0.pdf

Avatar Gravatar olivierdel said: transparent#49 [saturday 07 july 2012 at 23:57]

thank for your work

What should I do to really for my "ENC28J60 Ethernet Shield ekitszone.com" on my arduino mega?

i have tried looooooooot of things ......

Thanks

Avatar Gravatar Virtualmix said: transparent#50 [sunday 08 july 2012 at 04:37]

@olivierdel: Thank you.
I do not understand your question.

Avatar Gravatar olivierdel said: transparent#51 [sunday 08 july 2012 at 09:54]

hello

I actually bought a shield in ekitszone ebay to connect on my mega. I tried many solutions on a lot of forum, I also tested the procedure of the seller but without success. I do not know if this is the shield that has a problem or a detail that I forget.
in this forum have seen some Particularities with shield from this supplier

I verified:
my library is compatible mega
-----
the file enc28j60.h and You Will See:
# define ENC28J60_CONTROL_CS 53
# define SPI_MOSI 51
# define SPI_MISO 50
# define SPI_SCK 52
That's ok for the mega ...
-------

I have specified:
-------
void setup ()
{
e.setup (mac, ip, port);
pinMode (outputPin, OUTPUT);
pinMode (4, OUTPUT);
digitalWrite (4, HIGH);
}
-------
thanks

Avatar Gravatar Julian said: transparent#52 [tuesday 10 july 2012 at 15:09]

Hello again, can help me with the ethernet shield v1.1. I need to send data with TCP/IP protocol or UDP protocol. How i do it ?
Thanks

Avatar Gravatar rss said: transparent#53 [wednesday 11 july 2012 at 09:36]

iam using ENC28J60 for developing web server application using at89s52 .as the ethernet module is responding to my SPI code but iwas unable build the server application so just u please tell me the steps so i can develop my code

Avatar Gravatar Oleg said: transparent#54 [tuesday 17 july 2012 at 12:52]

Hi! Can you help me with simple client on ETHER_28J60 (get a page content from www, like in arduino ethernet sheild tutorial. Simle exemple)? 2 days think and nothing...
And, maybe you know about ES_client_set_gwip on ETHER_28J60? How to use this one with this short library?
Thanks a LOT!

Avatar Gravatar HEKO said: transparent#55 [thursday 26 july 2012 at 22:37]

Hello. I have a trouble. I can`t find a MAC address for this shield. Where can i found it?

Avatar Gravatar Heko said: transparent#56 [friday 27 july 2012 at 02:51]

Actually, you create your own mac address by using hex characters and put in ur code.

Avatar Gravatar HEKO said: transparent#57 [friday 27 july 2012 at 12:10]

Thanks. But it`s not working( I use this library with "static" ip (192.168.0.17, and port 80). and i can`t connect to the this adress,

Avatar Gravatar Treehouse Projects said: transparent#58 [tuesday 31 july 2012 at 20:41]

Hi,

Thanks for a nice tutorial. One question though. Does the shields ethernet port connect into my laptop, or does it have to connect to the router. I'd guess router, but I'm not too sure. Thank you.

Avatar Gravatar François said: transparent#59 [wednesday 01 august 2012 at 00:50]

@olivierdel
did you solved your problem with your card?
Regards. François

Avatar Gravatar Dvixer said: transparent#60 [wednesday 01 august 2012 at 20:54]

Hi @Virtualmix .
I have problem - i can`t get my shield outdoor.
I use port 142. (It`s opened). IP 192.168.0.13
I can connect to the local adress (192.168.0.13:142), but my friends can`t connect to the (my outdoor adress:142). May be i can use older libraries, or You can fix this one?
Greetings.

Avatar Gravatar Virtualmix said: transparent#61 [thursday 02 august 2012 at 00:35]

@treehouse Projects: Yes to the router.

@Dvixer: You must set your router to redirect outside connection to 192.168.0.13 port 42. Look for port forwarding.
Your friend will have to connect using your external ip address.
Good luck :-)

Avatar Gravatar Domonetic said: transparent#62 [tuesday 07 august 2012 at 06:50]

Can you tell me if the function of WOL and INT pins are used or can be ignored?

Avatar Gravatar beverageexpert said: transparent#63 [wednesday 08 august 2012 at 02:48]

@Kiriti
that ip address doesnt work for me either. I am using cheap 8$ breakout board. When I change the ip address to 192.168.0.5 or 6 it works like a champ. how would one go about controlling say 10 things.

Avatar Gravatar Edmond said: transparent#64 [friday 17 august 2012 at 15:25]

Hi,

I can't seem to get my Dealextreme ethernet shield to work. I'm almost at the point accepting it is a DOA.

I've installed the libraries and they compile fine (I'm on a Mac). The link LED is on and I see the yellow traffic LED lighting up. I can't ping the interface and a network scan does not show the MAC address on the network.

I've tried setting pin 4 to HIGH, to no avail. Do you guys have any tips?

Thanks a lot.

This is the board I'm trying to use: http://www.dealextreme.com/p/ethernet-shield-v1-1-for-arduino-66908

Avatar Gravatar Edmond said: transparent#65 [friday 17 august 2012 at 15:52]

Almost forgot; It is stacked on a Arduino One clone from DX. This one: http://www.dealextreme.com/p/arduino-uno-2011-atmega328p-pu-atmega8u2-usb-board-with-usb-cable-118043?item=26

Avatar Gravatar Maxim said: transparent#66 [tuesday 21 august 2012 at 00:27]

Hi Edmond,

You need to use this one:::
http://www.elektor.nl/StreamFile.lynkx?path=Uploads/Forum/Posts/etherShield-v1.1-for-Arduino-v1.0.rar

Avatar Gravatar Edmond said: transparent#67 [tuesday 21 august 2012 at 23:25]

Hi Maxim,

Thanks for your reply, but I'm afraid I did use that one. I was not clear in my first post. Sorry about that. I'm writing to DX now that I've received a DOA.

Avatar Gravatar Meshal said: transparent#68 [tuesday 11 september 2012 at 19:03]

Anyone faced a problem when changing the port from 6 to any other port ? (tried 11.10.13, .. etc)

Avatar Gravatar Nitec said: transparent#69 [thursday 13 september 2012 at 15:39]

Hey great work! I've tried your web remote code but only the heading Web Remote is displayed the on/off button not display. Old code from nuelectronics is work correctly
what am I missing.

Avatar Gravatar ashraf said: transparent#70 [tuesday 18 september 2012 at 23:03]

please give us a udp client and server examples because my project depends on it

Avatar Gravatar wayne said: transparent#71 [wednesday 19 september 2012 at 16:18]

How to request the web to get some html?

Avatar Gravatar dimwap said: transparent#72 [friday 12 october 2012 at 15:38]

For these who wants output on web page a floated numbers needed some hints http://www.cplusplus.com/forum/beginner/2927/ to add function ftoa()

Avatar Gravatar Tom said: transparent#73 [saturday 03 november 2012 at 23:58]

Hi. First of all I am a newbie and am needing some help to use this library with a Nokia5110 LCD. I've tried many options, libraries, pin variations but doesn't work. Both device work independently..but for some reason there is an issue with an SPI bus and ChipSelect (I guess..). I'd like to use both in my project. Heeelp please.

Avatar Gravatar Tom said: transparent#74 [monday 05 november 2012 at 17:36]

Hii!

Anyone got the ethernet shield v1.1 working together with nRF24l01 on SPI?

Avatar Gravatar Niclas said: transparent#75 [tuesday 06 november 2012 at 03:37]

Hi Tom. That's exactly what am I looking! RF24 + ENC28J60
Have you found?

Avatar Gravatar Vishal K M said: transparent#76 [sunday 25 november 2012 at 06:42]

Hello,
I am using an application as client side. I dont need HTML. The clint simply sent a string to network stream of given IP and PORT. The server (Arduino) receives the string and reply to it. What modification i need to make in the program. Please reply soon as possible
Regards
Vishal

Avatar Gravatar Jek said: transparent#77 [friday 07 december 2012 at 17:10]

hi there!

this tutorial is great.

but I'm having trouble updating the 2LED to 3LED button, when i try to display the third button, it's not working.

I hope somebody help me with my problem, i really need this in studying in college...thank you guys..please help me...

Avatar Gravatar mon said: transparent#78 [monday 10 december 2012 at 09:31]

can this control a 220V bulb?

Avatar Gravatar virtualmix said: transparent#79 [tuesday 11 december 2012 at 09:45]

@mon: Yes but not directly.
Arduino output is around 5V which is enough to control a relay. This relay can then be used to switch 200V power connected to a light bulb or anything else.

Avatar Gravatar Ruzel said: transparent#80 [monday 17 december 2012 at 12:34]

i have an error encounter what does this mean?
avrdude: stk500_getsync(): not in sync: resp=0x06

Avatar Gravatar drcref said: transparent#81 [monday 24 december 2012 at 15:25]

I am using this library with an enc28j60 module I bought from ebay (http://www.ebay.com/itm/170929813328).

I run the HelloWorld example to test the module and it works as it should (when I enter the IP address into my browser it loads and displays "hello world") but after some time it eventually stops responding. That's a problem to me as I want to make a small server which must always be accessible. I hope someone here can help me. Thanks in advance.

PS: I use an Atmega828p on a breadboard, with Arduino 1.0.1.

Avatar Gravatar drcref said: transparent#82 [monday 24 december 2012 at 15:50]

UPDATE: This only seems to happen if there is no delay() in the loop. If there is a 10ms delay it seems to be stable (I've been reloading for the last 30 minutes and it's still responding).

But I want to eliminate the delay and find the actual cause of the lock-up.

Avatar Gravatar Frank said: transparent#83 [wednesday 26 december 2012 at 18:25]

I just received my enc28 card (not a shield!) and your library helped me to test it. Thank you for helping me (and others) getting this to work.
Just a few notes that may be helpful for others:
The examples need specific url to work - echoparams needs ' http://192.168.1.15/1234567890123456789012345678901234567890' - webremote needs ' http://192.168.1.15/?cmd=off' - webremote2 needs ' http://192.168.1.15/?led1=off&led2=off'
you do not need to know the mac address - you specify it in the code - just as long as it is not the same as another ethernet device on your network, all is good
Using arduino Uno R3, ide 1.0.2
Will test this on my mega1280 soon - if you like I can post any issues that come up

Avatar Gravatar rafalll1984 said: transparent#86 [saturday 05 january 2013 at 19:31]

Hi,

I used a modified library from "Nio". All calls to the "print" function i switched to function "print_P". I do not know what I'm doing wrong but instead hand, receives bushes characters.

Avatar Gravatar James2k13 said: transparent#87 [sunday 13 january 2013 at 10:45]

SIr this is really much the same to my project study.. can i ask where will i get the ip adress? and is it possible that the webserver could receive digital outputs form the arduino?

Avatar Gravatar Keens said: transparent#88 [sunday 13 january 2013 at 11:55]

sir i just want to ask... with this code.. does only users who connects on the same internet service with ethernet shield could take control? or is there a way were any computer anywhere could control it? because what i really want is to control it form anywhere thank you reply will be much appreciated...

Avatar Gravatar tupitochka said: transparent#89 [saturday 19 january 2013 at 13:44]

for you controlling a device from outside a local net you must configure you router and provide static-IP from provider (ISP) also you can use dyndns.com

Avatar Gravatar Schnallnix said: transparent#90 [saturday 09 february 2013 at 18:16]

Hay,
I used the example for two buttons and want to expand it for 4 or more buttons,

but I am to stupid to understand it and I am not expired in HTML programming.

Is there anybody who could help?

But thanks of course I learned a lot here

Avatar Gravatar Heeviii said: transparent#91 [tuesday 19 february 2013 at 20:35]

Just notised that Safari is sensitive to proper HTML, so you have ti put all
necessary statements in beginnig and not forgetting end of body line.
After taking care of these, my Safari browser is acting normally, no more "Page not found " comments

Otherwise the code is all that old one,

Cheers!





// A simple web server that always just tells temperature when working"

#include "etherShield.h"
#include "ETHER_28J60.h"


static uint8_t mac[6] = {0x54, 0x55, 0x58, 0x10, 0x00, 0x24}; // this just needs to be unique for your network,
// so unless you have more than one of these boards
// connected, you should be fine with this value.

static uint8_t ip[4] = {xx, xx, xxx, xx}; // the IP address for your board. Check your home hub
// to find an IP address not in use and pick that
// this or 10.0.0.15 are likely formats for an address
// that will work.

static uint16_t port = 80; // Use port 80 - the standard for HTTP

ETHER_28J60 ethernet;

void setup()
{
ethernet.setup(mac, ip, port);
}

void loop()
{
if (ethernet.serviceRequest())

{

ethernet.print("<!DOCTYPE HTML PUBLIC -//W3C//DTD HTML 4.00 TRANSITIONAL//EN>");
ethernet.print("<html>");
ethernet.print("<head>");
ethernet.print("<title>Preview</title>");
ethernet.print("</head>");
ethernet.print("<body>");
ethernet.print("<hr>");
ethernet.print("<hr>");
ethernet.print("<H1>Hello World </H1>");
ethernet.print("<hr>");
ethernet.print("<hr>");
ethernet.print("<BR>");
ethernet.print("<H2>Time is 20:31</H2>");

ethernet.print("Analog Value: ");
ethernet.print(analogRead(0));
ethernet.print("<hr>");
ethernet.print("<hr>");

ethernet.print(" ");


ethernet.respond();

}

delay(100);

ethernet.print("</body>");

}

Avatar Gravatar julz said: transparent#92 [tuesday 19 february 2013 at 23:35]

thank you mate for the of your code!!! your the maaaaaan!!!

Avatar Gravatar sisy said: transparent#93 [wednesday 20 february 2013 at 17:00]

Hi! Please help me, I did the stated instruction, but still I can't access the IP address in my web browser.. What wrong with this? Is it my ethernet shield or it just need some modification? pls pls.. help me to figure out whats the problem! Thank you!

Avatar Gravatar julz said: transparent#94 [thursday 28 february 2013 at 18:47]

dude can u make me an arduino login auth before accessing my arduino web server?thnx in advance man you're the best!!!

Avatar Gravatar Dan said: transparent#95 [monday 04 march 2013 at 01:54]

Hi guys,
I was looking for a sketch like the one at the link below, but for the ENC28J60 shield.
Can anyone help with this, please ?
http://arduino.omalleyland.com/2010/08/my-arduino-webserver.html?showComment=1362334577835#c415405553637617558

Avatar Gravatar PaulB said: transparent#96 [wednesday 06 march 2013 at 09:43]

Can I send email with enc28j60 Ethernet Shield V1.1?
Please for some kind of example.

Write a comment

Capcha
Enter image code : 

Categories

Last articles

Last comments


Member of the Internet Defence League