Can WiFi Shield go into adhoc (infrastructure) mode?

I have no idea if this is possible but it is a most for my project. I know wifly modules can go into adhoc infrastructure mode.. But i have not clue if the WifiShield can do it...

It is a most, becuase that is how i setup my device to connect to wifi base stations... I want to startup, scan for available networks, then go into infrastructure mode so the user can connect to the module... visit a webpage and setup which network he wants to connect.....

Does anyone knows if Wifi Shield listed here (http://arduino.cc/en/Guide/ArduinoWiFiShield#toc5) can do that?

There is no "adhoc infrastructure" mode. Adhoc and Infrastructure are two different (and incompatible) modes.

So make up your mind and ask again ;).

adhoc mode... Where the wiFly module becomes the network advertised so computers can connect to it as the arduino module was the base station. This is for simplicity in the configuration

Doesn't seem to be the case... Here is mini datasheet for the H&D module used on the shield:

In your specific case, why not the alternative of setting up a network on the computer's end, and connecting to it from the Wifi shield?

I was really excited about the official wifi shield since the wifly rn-xv I am using does weird things when I try to pass a lot of data back and forth,but the official shield not only doesn't support ad-hoc mode it also doesn't seem to support udp. Frustrating.

giantsfan3:
Doesn't seem to be the case... Here is mini datasheet for the H&D module used on the shield:
http://media.digikey.com/PDF/Data%20Sheets/H&D%20Wireless%20PDFs/HDG104_Product_Brief.pdf

In your specific case, why not the alternative of setting up a network on the computer's end, and connecting to it from the Wifi shield?

I am looking to do this for an end product. It seems easier if the user just hooks it up, turns up the computer see's a new network named as the device "My Thermostat" for say... and when you connect to the thermostat, any page you go to will point to a config page...

But since there's no ADHOC mode.... No go with this design.. Will look for another alternative.

If I understand you correctly you want:

  1. A WiFi shield to automatically detect networks within range and then select one to connect to automatically ?
  2. Then you want the user to turn on their computer and be able to select the service the Arduino/WiFishield offers ?

1.) that can be down, however, of course this would only work for open networks. And of course you don't know what network your user sits on. Perhaps you need to study the general workings TCP/IP networking a little bit more before giving up on the project. You can run some WiFi shield in AP (Access Point) mode. that way they create their os network the user then can connect to. Or you have it connect to the users existing network. If it's a closed network the Arduino/WiFi shield will have to provide some form of authentication via passphrase/password to be able to log into the network.

2.) Sure, that technology os called ZeroConf with the most prominent implementation being Apple's Bonjour. There are libraries for Arduino that help you do that like DHCP, Bonjour libraries etc.

Having said all that. Nothing happens by itself magically. You'll have to write software to do it :wink:

Headroom:
If I understand you correctly you want:

  1. A WiFi shield to automatically detect networks within range and then select one to connect to automatically ?
  2. Then you want the user to turn on their computer and be able to select the service the Arduino/WiFishield offers ?

1.) that can be down, however, of course this would only work for open networks. And of course you don't know what network your user sits on. Perhaps you need to study the general workings TCP/IP networking a little bit more before giving up on the project. You can run some WiFi shield in AP (Access Point) mode. that way they create their os network the user then can connect to. Or you have it connect to the users existing network. If it's a closed network the Arduino/WiFi shield will have to provide some form of authentication via passphrase/password to be able to log into the network.

2.) Sure, that technology os called ZeroConf with the most prominent implementation being Apple's Bonjour. There are libraries for Arduino that help you do that like DHCP, Bonjour libraries etc.

Having said all that. Nothing happens by itself magically. You'll have to write software to do it :wink:

I don't mind writing software :slight_smile: Just to clarify...

I scan the networks in range ONLy to get the names of the nearby wifi base stations.... Then i go into ADHOC mode so that the module will broadcast or advertise itself as a wifi network so that the user can see it in available wifi networks..... He connects to it and go to a webpage to configure which of the available networks wants to use and set a password for it and such....

Nextime the device boots looks for the base station specified by the user and attempts to join it...

That's how i think its simplest for my device to get configured. If i use Bonjour, it assumes the device is connected to the network... Which it is not the first time you boot it..

Ad hoc and infrastructure modes are incompatible, meaning you cannot connect a WiFi shield Lin ad hoc mode to an Access Point (infrastructure mode).

When you are scanning you are likely scanning for infrastructure mode networks or in other words for APs within range. Most WiFi networks are operated in infrastructure mode.

From your description I am gathering that you want to provide your user with comfort functions similar to connecting your iPhone ( or Android phone) to a given WiFi network. On an iOS device you go into "Settings -> WiFi" and ther are you presented with a list of available WiFi networks that you could connect to. What you are seeing in that in that list are Access points.
Then you want the user to select which network to connect to and depending on that networks settings provide a password.

Once you are connected to a network, provided these devices Support Bonjour, you can see what services are offered and other devices can see what services are bing offered by your device.

I am, not sure that can be easily done with any WiFi shield as the Arduino DHCP/Bonjour libraries depend on the Arduino Ethernet library and thus you need an Arduino Ethernet shield. But you can easily connect a little pocket router, e.g. A TP Link TP 702 router?

However I am sure that soon the newly released Arduino WiFi shield will provide a lot of functionality that was previously not available.

@epinc and @Kikolobo:

What problems did you have with the RN-XV if/when you tried it? The setup should be very straightforward for the purpose of adhoc mode and accessing it from a remote computer/iPhone...

To put it in adhoc mode, just solder or connect a wire between Pin 8 and GND (Pin 10). Then if you provide power to the RN-XV (maybe convenient via Sparkfun USB explorer, or some other Xbee breakout), you should see the name "Wifly-GSX-..." on the wireless networks on your iPhone or your computer, etc. I believe you can also rename that to any network name you would like by configuring the RN-XV.

epinc, how much data throughput are you attempting that is giving you problems when data is going back and forth?
I had some trouble with the infrastructure mode and UDP on the RN-XV but adhoc and TCP turned out pretty straightforward.

Headroom:
Ad hoc and infrastructure modes are incompatible, meaning you cannot connect a WiFi shield Lin ad hoc mode to an Access Point (infrastructure mode).

When you are scanning you are likely scanning for infrastructure mode networks or in other words for APs within range. Most WiFi networks are operated in infrastructure mode.

From your description I am gathering that you want to provide your user with comfort functions similar to connecting your iPhone ( or Android phone) to a given WiFi network. On an iOS device you go into "Settings -> WiFi" and ther are you presented with a list of available WiFi networks that you could connect to. What you are seeing in that in that list are Access points.
Then you want the user to select which network to connect to and depending on that networks settings provide a password.

Once you are connected to a network, provided these devices Support Bonjour, you can see what services are offered and other devices can see what services are bing offered by your device.

I am, not sure that can be easily done with any WiFi shield as the Arduino DHCP/Bonjour libraries depend on the Arduino Ethernet library and thus you need an Arduino Ethernet shield. But you can easily connect a little pocket router, e.g. A TP Link TP 702 router?

However I am sure that soon the newly released Arduino WiFi shield will provide a lot of functionality that was previously not available.

Let me see if i can explain my self better..

I want my arduino device to behave like an access point.. So that my user in his computer will see it as a wifi access point for him to connect to.. So that this is easier to configure the device with a web browser...

The problem is that my device will not have a screen or keyboard.. So how can the user configure the device to connect to a wifi network that is protected with password? The only way or easiest way is for my arduino device to behave like an access point "ad-hoc" so that the first time the user configures the password for his home or office access point... Next boot the arduino device will attempt to connect to the configured access point....

Do you know when will the new WIFI shield be released or if theres one coming?

Kikolobo:
Let me see if i can explain my self better..

I want my arduino device to behave like an access point.. So that my user in his computer will see it as a wifi access point for him to connect to.. So that this is easier to configure the device with a web browser...

The problem is that my device will not have a screen or keyboard.. So how can the user configure the device to connect to a wifi network that is protected with password? The only way or easiest way is for my arduino device to behave like an access point "ad-hoc" so that the first time the user configures the password for his home or office access point... Next boot the arduino device will attempt to connect to the configured access point....

Do you know when will the new WIFI shield be released or if theres one coming?

I have the exact same problem to tackle. Have you made any progress?

I've done this with an ESP8266 using the Captive Portal example. It starts as an adhoc network, once you join it lists the available SSID's on it's web page. Then you type in the SSID and Password. It keeps the ad-hoc network up at 10.0.0.1 but redirects all calls to your infrastructure network over the IP it obtains when it joins that network. Black magic - and well worth time to look at: