24 Apr 2008

A couple weeks ago I bought an Ethernet shield for my arduino with a plan to get it connecting to the world directly. The stripped down TCP implementation that comes with it is much more geared towards making the board act as a web-server rather than client. This means you have to poll for information rather than have the arduino send it out. Unfortunately, it is this second case that I am most interested in.

Julian Bleecker’s paper “Why Things Matter” introduced the term “blogjects” – objects that blog. A natural extension of which are “tweetjects” – objects that twitter. A good example being Tower Bridge which twitters whenever the bridge opens or closes and announces which ship is passing by. (Roo has written more on this stuff here.)

I see an ethernet-enabled arduino as a perfect platform for building such objects from. But to do this, it needs to establish the outgoing connection itself.

There is another shield that provides a much more powerful option based on the Lantronix XPort ethernet hardware. It even has a demo sketch that will post to twitter. The advantage of this shield is that it provides a serial interface to run the connection – putting much less strain on the arduino. However, this power comes at a cost – the XPort itself is around $50, whereas the Nuelectronics shield is £12.99 already assembled.

So for now, I am persevering with the cheaper board and have been learning far more about TCP packets than I ever thought necessary. So far, I have got my board doing an ARP request to map IP to MAC address, establishing a TCP connection and then sending a single blob of data (naturally, “HELLO WORLD”). This is all a couple layers lower down in the OSI model than I am used to working with in my day job.

It is still a bit too hard-coded to be easily reused and attempts to re-factor what I’ve done has broken it all; so I still have lots to do.

One thing I have discovered whilst playing with this all is Wireshark – a superb tool for sniffing packets on the network and examining their content. This has helped a lot in working out which bits and bytes are going awry in my packets.

DIY and decorating allowing, I hope to make progress on this over the next couple weeks.

  1. DarrenApril 25, 2008

    Sounds interesting, I’m always really impressed by people who can get down to the electronics level. Look forward to seeing what you do with it.

  2. Julian BleeckerApril 25, 2008

    Hey — this is great stuff! I’ve been waiting for someone to turn that Microchip ENC28J60 into a convenient Ethernet interface. Super inexpensive and does well-enough, so that even small 8-bit microcontroller’s can get on a network without too much hassle. I’ll be watching this project!

  3. PaddyJune 4, 2009

    Did you ever have any luck with this project? I’ve just bought the same ethernet shield and ran into the same problem. If only the arduino Ethernet library would work with the shield! I suppose things aren’t greatly helped by the fact that my C++ skills are somewhat lacking

  4. nickJune 4, 2009

    Paddy, I got a hold of the official Arduino Ethernet shield last year which took a lot of the motivation away from getting this shield working as fully as I needed. I’m sure I’ll get back to it at some point – it is considerably cheaper, so worth the effort.

  5. leave a comment

    You must be logged in to post a comment.