Post a new topicPost a reply Page 1 of 3   [ 23 posts ]
Go to page 1, 2, 3  Next
Author Message
 Post subject: Problems in implementing waspmote android demo
PostPosted: Sat Jun 09, 2012 5:30 am 

Joined: Sat Aug 06, 2011 1:10 am
Posts: 109
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:
Image
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 %
        }
      }
    }
  }
}


Top
 Profile  
 
 Post subject: Re: Problems in implementing waspmote android demo
PostPosted: Mon Jun 11, 2012 9:07 am 

Joined: Mon Sep 28, 2009 1:06 pm
Posts: 7440
wzj_bj,

wzj_bj wrote:
Q1: What is the correct program for me to implement android video demo?
In the video is used Iphone APP. If you want to use android you create a network from your mobile, as is said in the Wifi module documentation. The correct program is WaspWIFI_14_android_example.pde.
wzj_bj wrote:
Q2: Is it OK to implement without SD card?
Yes
wzj_bj wrote:
Q3: Does the waspmote board with wifi module function like an access point?
In case of Iphone, the answer is yes. However, if you use Android AP is the mobile phone.
wzj_bj wrote:
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?

X-CTU tool is provided by Digi and it can be used only with Xbee modules. You can place wifi module into gateway, but you should use a serial monitor to establish serial communication.

We recommend you to read wifi module documentation carefully before use it.

Any other questions please feel free to ask.

Best Regards.


Top
 Profile  
 
 Post subject: Re: Problems in implementing waspmote android demo
PostPosted: Tue Jun 12, 2012 6:00 am 

Joined: Sat Aug 06, 2011 1:10 am
Posts: 109
Thanks. So I'm using the correct program "WaspWIFI_14_android_example.pde". Based on your reply, I downloaded "Open Garden WiFi Tether" to make my rooted Motorola Android(2.2) smartphone as an Access point.

When I start "Open Garden WiFi Tether" app after I set its SSID as "ANDROID", it can detect the MAC address of waspmote wifi module and let waspmote wifi module join "ANDROID". However, then I start "Waspmote Wifi Android APP", this waspmote app can't get the MAC address of waspmote wifi module as shown below:

Since the monitoring tab can catch the real-time acc x-y-z values, so I assume waspmote wifi module has successfully connected with Motorola Android(2.2) smartphone via wifi directly. Why is "Waspmote Wifi Android APP" is unable to get the MAC address of waspmote wifi module?

Image

Besides, in the the monitoring tab the blue icon of waspmote wifi module changes positions very slowly(almost every 8 seconds) and it's much worse than that in youtube video. How can I make it faster?


Top
 Profile  
 
 Post subject: Re: Problems in implementing waspmote android demo
PostPosted: Tue Jun 12, 2012 9:41 am 

Joined: Mon Sep 28, 2009 1:06 pm
Posts: 7440
wzj_bj,

Mac = 00:00... is due to Waspmote is not connected. Please follow next steps to achieve the connection:

  1. Create the Network with your mobile
  2. Turn On Waspmote and wait until led turns on.
  3. Now you can start android wifi app and it will works.

Let us know if you are success.

Best regards.


Top
 Profile  
 
 Post subject: Re: Problems in implementing waspmote android demo
PostPosted: Tue Jun 12, 2012 7:15 pm 

Joined: Sat Aug 06, 2011 1:10 am
Posts: 109
hi libelium-dev:

I followed your suggested steps but it's still unable to get MAC address.

step 1:Create the Network ""ANDROID" with my Open Garden WIFI Tether in Motorola android and let any device can join without password(no access control)
step 2:Turn On Waspmote and wait until led turns on (you can see some leds turn green while some turn red)
step 3: start android wifi app and it's still unable to get MAC address.

I still tend to believe waspmote wifi module is connected with Motorola android phone, otherwise how can you explain these:

1. After I turned on waspmote board, Open Garden WIFI Tether immediately notified me a device was connected.

2.In Network tab, the icon of Connectivity turned from white to blue.

3. In Monitoring tab, Movement Sensor showed the positions of waspmote icon changed when I moved waspmote board up and down.

Pls see the photo below:
Image


Top
 Profile  
 
 Post subject: Re: Problems in implementing waspmote android demo
PostPosted: Wed Jun 13, 2012 9:26 am 

Joined: Mon Sep 28, 2009 1:06 pm
Posts: 7440
wzj_bj,

You are true. You achieve connection successfully. Otherwise connectivity wont be blue.

We never seen that, and we will make some test about it, to figure out why MAC is 0.

In the meantime, could you please check if you have last APP version? there is an update which fix some bugs.

Moreover, could you try with other mobile?

Best Regards.


Top
 Profile  
 
 Post subject: Re: Problems in implementing waspmote android demo
PostPosted: Wed Jun 13, 2012 9:45 am 

Joined: Sat Aug 06, 2011 1:10 am
Posts: 109
libelium-dev wrote:
wzj_bj,

You are true. You achieve connection successfully. Otherwise connectivity wont be blue.

We never seen that, and we will make some test about it, to figure out why MAC is 0.

In the meantime, could you please check if you have last APP version? there is an update which fix some bugs.

Moreover, could you try with other mobile?

Best Regards.


My friend used his Motorola Android 2.3 to test it. He got the same result as mine.
We both downloaded waspmote android wif app yesterday to our motorola smartphones. Is it the latest one? where can we find its version number?


Top
 Profile  
 
 Post subject: Re: Problems in implementing waspmote android demo
PostPosted: Wed Jun 13, 2012 9:59 am 

Joined: Sat Aug 06, 2011 1:10 am
Posts: 109
Last app version?
Did you mean waspmote android wifi app from google play store,
or I should use Waspmote API v025 for my waspmote IDE?


Top
 Profile  
 
 Post subject: Re: Problems in implementing waspmote android demo
PostPosted: Wed Jun 13, 2012 10:09 am 

Joined: Mon Sep 28, 2009 1:06 pm
Posts: 7440
wzj_bj,

Ok, thanks for the information. we will make some test with Motorola devices and let you know.

In the mean time, is there any other missing feature of the application in your mobile? If not, you can keep using wifi module as normal while we fix this bug due to it does not affect to other module features.

We apologize about it. We will be back to you ASAP.

Regards.


Top
 Profile  
 
 Post subject: Re: Problems in implementing waspmote android demo
PostPosted: Wed Jun 13, 2012 10:24 am 

Joined: Wed Nov 10, 2010 9:45 am
Posts: 271
Location: Australia
Hi Libelium,

I have the exact first problem using a HTC legend Android 2.2.


Top
 Profile  
 
Display posts from previous:  Sort by  
Post a new topicPost a reply Page 1 of 3   [ 23 posts ]
Go to page 1, 2, 3  Next


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
cron


Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group
Libelium theme based on 610nm Style by Daniel St. Jules of http://www.gamexe.net


© Libelium Comunicaciones Distribuidas S.L. | Terms of use