Pages: [1] 2 3 4   Go Down
Author Topic: Arduino Ethernet Shield  (Read 10565 times)
0 Members and 1 Guest are viewing this topic.
0
Offline Offline
Newbie
*
Karma: 0
Posts: 14
Arduino rocks
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

[size=16]Put your Arduino on-line [/size]  

I have developed a Ethernet shield for Arduino boards.  The board uses the Microchip's ENC28J60 SPI based ethernet controller.  A tiny open-source TCP/IP stack has been developed as an Arduino IDE library.  The memory usage is moderate -- 7700 bytes FLASH space  and around 520 bytes of SRAM are used for the following application, A webserver with temperature sensor reading.  It leaves around half of the FLASH and SRAM space for your own application smiley

The schematic and the open-source TCP/IP stack are avaiable on my website http://www.nuelectronics.com.  

There is also a details project description at http://www.nuelectronics.com/estore/index.php?main_page=project_eth


Fig 1. EtherShield V1.0

Fig 2. EtherShield with Arudino and the DS18B20 temperature senor (in the middle board)

Fig 3. Arduino Webserver with Temperature reading

« Last Edit: March 20, 2008, 09:53:36 am by nuelectronics » Logged

0
Offline Offline
God Member
*****
Karma: 0
Posts: 731
skcor oniudrA
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Very nice.

On this page

http://www.nuelectronics.com/estore/index.php?main_page=product_info&cPath=1&products_id=4

"Open-source TCP/IP stack  -- available as an Arduino library, download here"

Is linking to the LCD library

http://www.nuelectronics.com/download/projects/LCD4Bit_mod.zip

This page

http://www.nuelectronics.com/estore/index.php?main_page=project_eth

Has the correct link smiley
« Last Edit: March 20, 2008, 11:59:00 am by John_Ryan » Logged

0
Offline Offline
Jr. Member
**
Karma: 0
Posts: 56
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

very cool, and how much space would the library take on the chip? Will it work on a atmega8 as well ?
Logged

0
Offline Offline
Newbie
*
Karma: 0
Posts: 14
Arduino rocks
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

The memory usage -- for the above webserver with Temperature reading example

[size=16]Flash -- 7700 bytes;  SRAM -- around 520 bytes [/size]

So for ATMEGA8 with 8K flash and 1K SRAM, this example will be difficult to fit in unless you don't use bootloader.   But the temperature reading routine takes around 2K space in the Flash. my other example, the webserver example, only use 5.5K flash space, so it should fit into the ATMEGA8 without problems.
Logged

0
Offline Offline
Newbie
*
Karma: 0
Posts: 9
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

very nice... by coincidence just today i posted some really really feeble arduino webserver code at ladyada's forum, based on the xport ethernet shield; http://forums.ladyada.net/viewtopic.php?t=5458

but your system looks a LOT more robust! looks like you can have some nice CGI on there too... hope you have a few in stock smiley-wink

(incidentally, accessing your website directly www.nuelectronics.com attempts to forward to the nonexistent http://estore/ rather than http://www.nuelectronics.com/estore/)

Logged

USA
Offline Offline
Sr. Member
****
Karma: 0
Posts: 452
Freeduino rocks
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

@nuelectronics, nice work!

I realized you are using the name "Arduino" in your products... did you check the Arduino Team policy regarding the use of the Arduino name? http://www.arduino.cc/en/Main/Policy.
« Last Edit: March 20, 2008, 04:16:40 pm by nkcelectronics » Logged

Wuppertal/Germany
Offline Offline
God Member
*****
Karma: 1
Posts: 895
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Hi,

the library does not compile (on linux) because etherShield.cpp tries to include EtherShield.h but the name of the file is etherShield.h (camelCase).

Ususally the C-header/source-files are in all lower-case so I suggest you rename the files to ethershield.h ethershield.cpp
or go with the classname EtherShield.h EtherShield.cpp

Eberhard



Logged

0
Offline Offline
Newbie
*
Karma: 0
Posts: 14
Arduino rocks
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

Quote
Hi,

the library does not compile (on linux) because etherShield.cpp tries to include EtherShield.h but the name of the file is etherShield.h (camelCase).

Ususally the C-header/source-files are in all lower-case so I suggest you rename the files to ethershield.h ethershield.cpp
or go with the classname EtherShield.h EtherShield.cpp

Eberhard




Thanks for the advice.  

The library was only tested on Windows machine, since I don't have a Linux PC.   I've changed the line #include "EtherShield.h to #include "etherShield.h" in file etherShield.cpp.  The new file has been uploaded to my website.

Hope it will work on Linux.  I'd really appreciate if someone could test it.  Thanks  smiley-wink
Logged

Wuppertal/Germany
Offline Offline
God Member
*****
Karma: 1
Posts: 895
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Hi,
Quote
Quote
Hi,

the library does not compile (on linux) because etherShield.cpp tries to include EtherShield.h but the name of the file is etherShield.h (camelCase).

Ususally the C-header/source-files are in all lower-case so I suggest you rename the files to ethershield.h ethershield.cpp
or go with the classname EtherShield.h EtherShield.cpp

Eberhard




Thanks for the advice.  

The library was only tested on Windows machine, since I don't have a Linux PC.   I've changed the line #include "EtherShield.h to #include "etherShield.h" in file etherShield.cpp.  The new file has been uploaded to my website.

Hope it will work on Linux.  I'd really appreciate if someone could test it.  Thanks  smiley-wink
Now it compiles without errors.
Eberhard


Logged

0
Offline Offline
Full Member
***
Karma: 0
Posts: 173
Arduino rocks
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

Really nice, do you plan on selling unassembled kits?

It should drop the price, and I for one don't mind assembling my shields.
Logged

Brisbane, Australia
Offline Offline
God Member
*****
Karma: 1
Posts: 593
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

Also have you considered putting a AVR on the shield so the code required to interface with it is reduced?
Put all the low level code on the on board processor and expose a simple API over I2C or something.
Logged

0
Offline Offline
Jr. Member
**
Karma: 0
Posts: 56
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

Quote
Also have you considered putting a AVR on the shield so the code required to interface with it is reduced?
Put all the low level code on the on board processor and expose a simple API over I2C or something.

I agree that would be pretty cool and not only for arduino but avr/microcontrollers in general. Just make sure that we can still program the onboard avr as well .... Darn, now I wish I thought of such a shield with the onboard avr idea. Let me know if you need help with the firmware for your onboard avr. if your planning on doing it ...  smiley-wink
Logged

0
Offline Offline
Newbie
*
Karma: 0
Posts: 14
Arduino rocks
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

Quote
Also have you considered putting a AVR on the shield so the code required to interface with it is reduced?
Put all the low level code on the on board processor and expose a simple API over I2C or something.
En...  It is a good idea - can be implemented with Full TCP/IP protocol rather than the Single data packet at the moment.   But are we going to reinvent the WIZNET module?  
Logged

0
Offline Offline
Newbie
*
Karma: 0
Posts: 9
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

the example code was perhaps a *little* daunting for newbies.

to make it a bit more straightforward i've pulled out a few of the functions -- probably worth adding something like this to the library to make it simpler for those who basically just want to be able to serve webpages with dynamic values.  

you can download the template here (just make sure you have the etherShield library installed; and set your IP address to one that doesn't already exist on your network).

then your setup and loop would look simply like this.....

Code:
// you can change this line if you want to serve, for example, XML or some other content type
#define HTTP_HEADER "HTTP/1.0 200 OK\r\nServer: arduino\r\nContent-Type: text/html\r\n\r\n"

void setup(){
  setupEthernet("192.168.000.060", 80);   // must include padded 0s in the IP address
}

void loop(){

  //put your code here
  
  // then check for requests, and if so, serve the webpage  
  if (ethernetRequest()){
    writeHeader();    
    writePage("<h1>This is your Arduino speaking!</h1>");    
    writePage("<h3>Analog values:</h3>");    
    for (int i = 0; i < 6; i++){
      writePage("<br>");
      writePage(analogRead(i));
    }
    servePage();
  }
}




(btw, couldn't get alternative ports to work either in my example or in the original; however didn't spend a long time debugging)
« Last Edit: March 26, 2008, 01:58:10 pm by uh » Logged

Brisbane, Australia
Offline Offline
God Member
*****
Karma: 1
Posts: 593
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

Quote
En...  It is a good idea - can be implemented with Full TCP/IP protocol rather than the Single data packet at the moment.   But are we going to reinvent the WIZNET module?  
What? Your shield only does single packets? (UDP only?)
Hmm that limits its usefulness.

Maybe switch over to Wiznet with a onboard AVR controller?
The Wiznet chews about 8kb as well to interface with it.
But it can handle TCP/IP in hardware which makes it substantially simpler.
Logged

Pages: [1] 2 3 4   Go Up
Jump to: