Several sites sell variations of a shield that costs $12-$30 and you have to add on an xport or a wiznet for $25-50. (www.ladyada.net, www.adafruit.com, www.makershed.com,
I have also seen options where you can purchase an xport or wiznet, or chipset and make your own PCB or wire up your own breadboard, which is the cheapest way to go, but I would rather purchase a kit or pre-built unit that I know will work...
So it would seem the best option is probably the nuelectronics board for $22, or a board off ebay. Anyone have any bad experiences with these or other advice?
My application is that I need a basic server that I can connect to and look at register values (what is on/off/temperature, etc.) and switch registers (turn things on/off).
the best option is probably the nuelectronics board for $22
That's the cheapest option. The best depends on what you are trying to do.
The different devices provide different amounts of support for the network stack. The official device and other Wiznet variants provide TCP (and UDP, although I'm not sure about Arduino library support there) support and are supported in the core Arduino environment. The xport has higher layer support, but as far as I know is not supported in the arduino core. The nueelectronics board, while definitely cheaper, uses Microchip's ethernet chip, which provides layer 2 (ethernet) functionality, leaving it up to you and your arduino to implement IP and TCP or UDP.
I personally would get an official board, unless I was seriously broke and/or knew my applications would allow the arduino's processor to take the brunt of the work in communication.
I've kind of lost track of where ethernet development has gone with Arduino. Is it at a point now where we can easily connect to the Arduino from the internet to interact with hardware connected the Arduino (turning on lights, reading door sensors, etc)?
I just spent some time looking at the nueelectronics board, and reading the code for the server example. It looks like it is pretty simple, their example shows how to create a web server with a menu showing status of a register and led, and an option to turn it on/off, which is what I am looking for... They also have a temperature sensor read example. I do not need udp or anything else fancy, so I think it might work for me - as long as I see nothing negative here...
My only concern is memory space... so the amtega168 has 1k of space? Their site says something about you having 500 byes available after the library is in there if I understand properly, so hopefully it is enough space...
I bought a nuelectronics board a while back and the sample code at that time was a really messy port of some existing AVR stuff, and very low level. I haven't touched it since, but the code situation may have improved for all I know.
Also got 2 Ladyada shields, one with an Xport and one with a Wiznet module. The Xport works at a higher level and you send it simple text-string commands to open connections. It also supports DHCP, which might clinch it for you. The downside is you need to use a serial port.
Also the Xport is a bit fiddly to configure... it stores its own settings so you have to set these up independently of the arduino code. But on the other hand it can act as a web server in its own right.
The wiznet option on the other hand uses SPI, so all serial options still are available for you to use for other stuff; plus it's compatible with the new arduino Ethernet library. But no DHCP support.
So in practice your decision might be based around what other I/O options you also want to have available, and whether you need DHCP to get an IP address. Also consider how much memory you'll need. Using the software serial and ethernet libraries together uses a lot of memory that leaves very little of the 14336 byte limit on current Arduinos.
If cost is an issue you can get the WIZnet modules cheaper than from lady ada, as she points out on her site.
I've not seen the 'official' ethernet shields yet.
So I need to clarify - regarding memory space, what is the different in the options?
For example, if I were to get the 'official' ethernet board that users "Ethernet.h", would I have more memory space available to me that using the nuelectronics board that uses its own .c/.h and includes avr/io.h and WConstants.h ??
I would assume all the other alternatives would be similar, they all have their own libraries?
I am thinking there may be an advantage to using the 'official' board if I do not loose half my memory space (500 bytes) to the library - but maybe the official board you loose it anyway?
For example, if I were to get the 'official' ethernet board that users "Ethernet.h", would I have more memory space available
I suspect so, but I don't know for sure.
You can probably test this yourself, without even buying any hardware. Just compile an example program and throw in the code to check free RAM (search the forum/playground for that one).
If not extremely precise, that may at least tell you how much is tied up in buffers, etc.
re: memory - you can try testing this yourself since you don't need the hardware present to include a couple of libraries and compile. the arduino IDE should tell you how many bytes used in total.
one thing I made a note of recently: i was using software serial and ethernet libraries together, plus a bit of code to parse serial data. this used 13700 bytes out of the total 14336 available.
If you're going to order anything from adafruit, then you could also get a couple of her ATmega328's at the same time... these have twice the memory available on the ATmega168, and are a drop-in replacement on arduinos using DIL package processors.
I've been working with the ethernet shield. I got mine from RobotShop, i think. I'm using the library provided with the IDE V0012.
The code is simple and connects, but am having lots of problems. I think it's all due to memory, like you've been discussing. I'm sending an XML document back from the board and have lots of strings in tags.
I wrote the code for serial and it works great, but switching it to the ethernet has caused lots of problems.
I think it was because I was using all the available RAM and it was stepping on things. So, I moved all my strings to program memory, now with the libraries and the string data, my program size is about 14k, so not much room left.
After moving all the strings, it now works, but hangs after a while. it's on a one minute timer and each loop it writes an xml document with the data from sensors. it works for about 20 or 30 loops, then hangs.
One weird thing is that when it is hung and i turn on the IDE serial monitor, the board spits out another message.
I'm very frustrated. The board is monitoring a bunch of temperature and ligth sensors on a solar heating array and solar water heater. i'm trying to get data to improve the design. i planned on putting the arduino board with the ethernet board downstairs and collect data on my computer upstairs, but now need to rethink things, because it's just not reliable.
Just FYI -- I did some testing as suggested using the memory test code, and used two different sketches that include the ethernet libraries - one that includes the standard arduino library, the other that includes the nuelectronics libraries. Then the code sets up the ethernet, has code to listen as a server, accepts a connection, and sends html data - a pretty good sized chunk (I used PSTR which saves a lot of ram).
The arduino version had over 700 bytes free.
The nuelectronics version had over 200 bytes free.
I believe the reason for this difference is that the nue version is pre-allocating 500 bytes to a buffer.
This also means I believe you are limited to a maximum 'response' packet of the size of that buffer.
For example, a request comes in from a client, you build your response in to this buffer variable and send it all at the same time, but you can only send as much as the size of that buffer.
In the arduino library it looks like you can make multiple print/println calls, so you do not have to pre-allocate a buffer or fill it, thus it leaves you a lot more space free.
I think if the nuelectronics device could solve the issue with having to create this big buffer and have multiple print calls, it would be my choice without a doubt. However, with less than 300 bytes to work with vs. over 700, I will have to consider that maybe the cost differential is worth it.
If anyone has an experience with the other libraries for the other boards available, especially as far as memory, buffers and such, that would be nice to see.