0
Offline
Newbie
Karma: 0
Posts: 14
Arduino rocks
|
 |
« on: March 20, 2008, 09:50:02 am » |
[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 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
God Member
Karma: 0
Posts: 731
skcor oniudrA
|
 |
« Reply #1 on: March 20, 2008, 11:57:54 am » |
|
|
|
|
« Last Edit: March 20, 2008, 11:59:00 am by John_Ryan »
|
Logged
|
|
|
|
|
0
Offline
Newbie
Karma: 0
Posts: 49
|
 |
« Reply #2 on: March 20, 2008, 12:26:24 pm » |
very cool, and how much space would the library take on the chip? Will it work on a atmega8 as well ?
|
|
|
|
|
Logged
|
|
|
|
|
0
Offline
Newbie
Karma: 0
Posts: 14
Arduino rocks
|
 |
« Reply #3 on: March 20, 2008, 01:12:20 pm » |
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
Newbie
Karma: 0
Posts: 9
Arduino rocks
|
 |
« Reply #4 on: March 20, 2008, 03:29:34 pm » |
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=5458but 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  (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
Sr. Member
Karma: 0
Posts: 452
Freeduino rocks
|
 |
« Reply #5 on: March 20, 2008, 03:37:07 pm » |
@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
God Member
Karma: 0
Posts: 869
|
 |
« Reply #6 on: March 22, 2008, 05:15:43 am » |
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
Newbie
Karma: 0
Posts: 14
Arduino rocks
|
 |
« Reply #7 on: March 25, 2008, 08:06:04 am » |
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 
|
|
|
|
|
Logged
|
|
|
|
|
Wuppertal/Germany
Offline
God Member
Karma: 0
Posts: 869
|
 |
« Reply #8 on: March 25, 2008, 09:02:01 am » |
Hi, 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  Now it compiles without errors. Eberhard
|
|
|
|
|
Logged
|
|
|
|
|
0
Offline
Full Member
Karma: 0
Posts: 173
Arduino rocks
|
 |
« Reply #9 on: March 25, 2008, 03:08:25 pm » |
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
God Member
Karma: 0
Posts: 593
|
 |
« Reply #10 on: March 26, 2008, 02:14:36 am » |
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
Newbie
Karma: 0
Posts: 49
|
 |
« Reply #11 on: March 26, 2008, 08:28:30 am » |
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 ... 
|
|
|
|
|
Logged
|
|
|
|
|
0
Offline
Newbie
Karma: 0
Posts: 14
Arduino rocks
|
 |
« Reply #12 on: March 26, 2008, 10:41:00 am » |
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
Newbie
Karma: 0
Posts: 9
Arduino rocks
|
 |
« Reply #13 on: March 26, 2008, 01:40:03 pm » |
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..... // 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
God Member
Karma: 0
Posts: 593
|
 |
« Reply #14 on: March 26, 2008, 03:53:26 pm » |
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
|
|
|
|
|
|