hi libelium:
I'm trying to follow the youtube video(
http://www.youtube.com/watch?v=Ybn-K8ZZCPE) to
directly connect waspmote wifi sensors with my Motorola smartphone(android 2.2)
without wifi router, but didn't succeed.
I put wifi module in socket 0 of waspmote board. Note there is no SD card in my waspmote board and the wifi module is combined with expansion board when I get it from box. By following checklist, I upload WaspWIFI_14_android_example program in waspmote IDE to waspmote board successfully via USB connection to my PC.
But my Motorola smartphone(android 2.2) is unable to find a wifi network called "ANDROID". Even I manually add SSID "Network SSID = ANDROID, Security = Open", it just prompts that "ANDROID" is not in range.
I guess I use the wrong program, in which there are no code to set ESSID. Also, the parameters of "WIFI.setUDPclient("255.255.255.255",12345,2000)" are not right for me.
I can use X-CTU to look at the profile settings of XBee Pro s2 module by plugging it into gateway USB interface. Can I do the same thing to Waspmote wifi module?
My questions are:
Q1: What is the correct program for me to implement android video demo?
Q2: Is it OK to implement without SD card?
Q3: Does the waspmote board with wifi module function like an access point?
Q4: Can I use X-CTU to look at the profile settings of Waspmote wifi module by plugging it into gateway USB interface? Or is some other approach to do that?
My current waspmote board with wifi module look like this:

WaspWIFI_14_android_example program is shown below:
Code:
// Specifies the message that is sent to the WiFi module.
char tosend[128];
void setup(){
// Initialize the accelerometer
ACC.begin();
ACC.setMode(ACC_ON);
// First, initialize the WIFI API and the connections with the waspmote
WIFI.begin();
// Then switch on the WIFI module on the desired socket.
WIFI.ON(socket0);
// If we don't know what configuration had the module, reset it.
WIFI.resetValues();
// 1. Configure the transport protocol (UDP, TCP, FTP, HTTP...)
WIFI.setConnectionOptions(UDP);
// 2. Configure the way the modules will resolve the IP address.
WIFI.setDHCPoptions(DHCP_ON);
}
void loop(){
// 3. Configure how to connect the AP.
WIFI.setJoinMode(MANUAL);
while(1){
// 3.1 Call join giving the name of the AP.
while(!WIFI.join("ANDROID")){}
// Switches on green led to show us it's connected.
Utils.setLED(LED0, LED_ON);
// 4. Creates UDP connection.
if (WIFI.setUDPclient("255.255.255.255",12345,2000))
{
// 5. Now we can use send and read functions to send and
// receive UDP messages.
while(1){
// 6. Send data to the IOS smartphone
sprintf(tosend,"Wasp-1;19;20;21;22;23;24;%d;%d;%d;",
ACC.getX(),ACC.getY(),ACC.getZ());
WIFI.send(tosend);
// Reads data to the IOS smartphone
WIFI.read(NOBLO);
// Waspmote acts depending on the answer.
uint8_t period = (WIFI.answer[6] - 48) * 10 + (WIFI.answer[7] - 48);
if (period<11){
// Switches on a lamp with intensity= period %
}
}
}
}
}