A few WiFi questions.

Greetings,

at the moment I'm using an ethernet shield for my Arduino (2560) device and
all runs fine except for the long wires all over the place :wink: I'm looking for a
WiFi solution so I started scrutinizing the 'official' WiFi library and the
also 'official' shield. To my surprise I couldn't find a way to set a static IP
address for my device (the library seems to rely on a DHCP server on the
network). My first question is: is this true or did I overlook something
in the software?

I also looked at the ASync Lab WiFi shield and the accompanying software but
it seems that one can only use that shield for a webserver configuration
(i.e. listening for http requests and spewing back html code). My second
and third question: is it true that this shield can only be used for
webserver applications? Or can this shield also be used with the 'original'
library software?

thanks for any tips, hints or answers.

kind regards,

Jos

is this true or did I overlook something in the software?

Yes, this is true, for the current version of the firmware (and libarary) there's not possibility to set the IP from the Arduino.

is it true that this shield can only be used for
webserver applications?

No, here's an example application
http://asynclabs.com/wiki/index.php?title=WebClient_sketch

Or can this shield also be used with the 'original'
library software?

No, it can't. The Asynclabs WiShield uses the Arduino process the TCP/IP stack where the Arduino Wifi Shield has it's own processor for that.

Thank you very much for your reply; it completely answered my questions. Especially that link was very valuable; it showed that one
can reconfigure the library to make it a web client instead of a web server, but still it speaks the http protocol; that protocol is too
verbose for my needs, I need a server/client than can just send bytes to the other party (it's a private protocol and much terser
than that http protocol). So the second shield is not what I need; the first shield is fine except for the lack of being able to specify
a static IP address. (a server with a changing IP address is a bit funny imho).

thanks again and

kind regards,

Jos

The web client example should be illustrative enough to show you how any client can be implemented. There are other examples in the appropriate directory in the library distribution. Probably SimpleClient is better suited for your needs.

I think I prefer the other board: one thing is that the entire TCP/IP stack is out of the way and the other 'advantage' is that the other library doesn't carry all the (for me unused) http overhead with it (memory space is precious :wink:

kind regards,

Jos

Which is the "other" board?

Both of them don't have HTTP overhead, they communicate on the TCP socket layer. Just because an example is often made with the most commonly used protocol on the internet it doesn't have to mean that you cannot do any other protocol.

By the 'other board' I mean the 'official' Arduino WiFi shield; it does almost everything I want (by reading the documentation); I haven't bought any of those Wifi shields yet but I can't find any documentation for the Async Labs shield whatsoever; especially nothing for those uip*.cpp and uip*.h files; I don't want to hack my way through it just to find out that the shield can't do what I want/need (my requirements aren't that demanding though :wink:

kind regards,

Jos

Both boards have the same problem: they have a library which doesn't support all features but the underlying hardware module (which does the actual WiFi communication) is undocumented (at least without signing an NDL). If you can live with the functionality the library offers, you may go with either shield but extending and adapting is almost impossible with both shields, unfortunately.

If you already have an Ethernet shield that you could continue to use for this project, then buying a rather expensive WiFi shield is unnecessary.
You don't need a WiFi shield to do WiFi with an Arduino board. You can simply buy a little pocket router for $30, for example a TP-Link wr702n and connect it with the short Ethernet cable that comes with it to the Ethernet card and you're in business.

I've done this in two projects already and it works like a charm!

@Headroom: I experimented with a similar configuration (I forgot the brand of that little router) and it worked great, except for the form factor; we want to embed the entire thing in a couple of (230V) AC outlets (and then some); two small shields stacked on top of eachother would be ideal; an additional router would become too large (I'm just responsible for the software, so don't shoot me, aim for the hardware guy :wink:

kind regards,

Jos

Good day JosAH,

I believe we are implementing the same thing and we're in the same situation.

I'm trying to implement an arduino WiFi shield onto my project that is currently running a ethernet shield. is it compatible? will it work by just modifying the code?

cheers

A wired ethernet shield and an Arduino WiFi shield are more or less compatible; one thing: you can't set a fixed IP address for the Arduino Wifi shield (a server with a changing IP address is a bit clumsy imho). The software for that other shield (Async Labs) is a mess because of a total lack of documentation (at least I haven't found it yet). It is based on a uip (micro IP) stack and there is a http server (or client) written on top of it; the uip stack comes from a Swedish university (according to the code itself). It should be possbile to use TCP sockets but I don't know how (due to the lack of that documentation). Software wise the best solution (for me at least) is an ordinary wired ethernet shield and a tiny wireless router ... but I'm open for any other acceptable solution :wink:

kind regards,

Jos

If you have to go the WiFi route - and I question that this is always necessary - and size matters to may want to look at the Platinum @ diysandbox.com. It integrates an Arduino compatible processor and a Gainspan WiFi module into a unit much smaller than any Arduino+Shield configuration.

Before attempting a solution with a WiFi router I tried my luck with a WiShield or the CopperHead - a clone of the WiShield. Ascynlabs, the maker of the WiShield closed their doors so ther is little if any development on the software side and there is not much traffic on the forum. I got it to receive raw UDP, but that was it. I could not integrate the ArdOSC and DHCP/Bonjour libraries to work.

While physical size is not so much of a concern in my projects trippylighting.com, due to the ( compiled) code size I wanted something with more flash memory than the UNO and found the fully Arduino compatible Teensy and Teensy++ controllers. The Teensy++ has 128k of flash which solved that problem. These boards are a magnitude smaller than an Arduino UNO not to speak about an Arduino Mega. You can combine a Teensy Teensy USB Development Board with a WizNet Ethernet module that works equivalent to an Ethernet shield http://www.saelig.com/BRD/ETH042.htm, or if that still is not small enough you can use this one http://www.saelig.com/BRD/BRD032.htm

All of the above is much, much smaller that an Arduino Mega with a WiFi shield. I have the Teensy++ connected with an Adapter board to the WIZ812 module in two projects, connected to a TP-Link WR703n in one case and a TP-Link WR702n in the other case. Works flawlessly in both cases.

The TP-Link routers are each around $30 and their footprint is half the site of an iPhone4 and about 2.5 times as thick.

The other approach for your project is to have only one WiFi shield on a central Arduino that communicates to the Internet and use another wireless technology - Xbee for example - to communicate to the units that are installed in the electrical outlets.

Those are a nice bunch of tips and links; thank you very much for those. I find the stuff from diysandbox quite interesting (too bad they're out of stock now) and I most certainly have a look at that Teensy++ thing ...

kind regards,

Jos

I know I'm a bit late on this topic, but came across it while looking to implement the same type of thing.

Regarding the dynamic IP with the wifi shield, my plan is to just have the client (arduino project) connect to the server (which has a static ip on local net) and pass it's ip to the server. That way it doesn't matter whether it's static or dynamic. The server will always immediately know what the client's IP is.

Just thought I'd share hoping it would help someone.