Post a new topicPost a reply Page 1 of 2   [ 12 posts ]
Go to page 1, 2  Next
Author Message
 Post subject: sending Data from the Gataway to the waspmote
PostPosted: Thu Jun 21, 2012 6:10 pm 

Joined: Thu Jun 21, 2012 5:34 pm
Posts: 19
Hello,
I would like to know how can i send a string of data from Digi's x-ctu software to my waspmote?
regards


Top
 Profile  
 
 Post subject: Re: sending Data from the Gataway to the waspmote
PostPosted: Thu Jun 21, 2012 8:04 pm 

Joined: Thu Jun 21, 2012 5:34 pm
Posts: 19
To clarify i do not know what function to use in the waspmote to enable reception of data. I tried xbee802.readXBee(); but the compiler says that it does not recognize it.

can u please advice me?

regards


Top
 Profile  
 
 Post subject: Re: sending Data from the Gataway to the waspmote
PostPosted: Thu Jun 21, 2012 9:41 pm 

Joined: Thu Jun 21, 2012 5:34 pm
Posts: 19
Apologies for the continuous messages. I have identified the problem the error_RX variables return 2 and then -1 identifying that the function is not supported in this module. How can i solve this issue?

regards


Top
 Profile  
 
 Post subject: Re: sending Data from the Gataway to the waspmote
PostPosted: Sun Jun 24, 2012 12:39 pm 

Joined: Sun May 16, 2010 5:59 pm
Posts: 96
Maybe you can solve the issue using the treatdata() function on your waspmote.

Regards


Top
 Profile  
 
 Post subject: Re: sending Data from the Gataway to the waspmote
PostPosted: Mon Jun 25, 2012 9:36 am 

Joined: Mon Sep 28, 2009 1:06 pm
Posts: 7479
aly1990,

Please take a look into examples provided with IDE and also in our development section. There is shown a way of receiving data.

As Alex says, you can use xbee802.treatData();

Regards.


Top
 Profile  
 
 Post subject: Re: sending Data from the Gataway to the waspmote
PostPosted: Mon Jun 25, 2012 12:20 pm 

Joined: Thu Jun 21, 2012 5:34 pm
Posts: 19
Hi I am already using xbee802.treatData(). The waspmote is not recieving and i get a flag of -2 when i check xbee802.error_RX.

I have included my code : In my code a send data and then i wait for 10sec to recieve some data

// sending and recieving from gataway + BATTERY LEVEL PRINTED ON THE USB

packetXBee* paq_sent;
int8_t state=0;
long previous=0;
char* data="Test message!";
char* data_rec;



uint8_t PANID[2]={0x12,0x34};

void setup()
{
// Inits the XBee 802.15.4 library
xbee802.init(XBEE_802_15_4,FREQ2_4G,NORMAL);

// Powers XBee
xbee802.ON();
}

void loop()
{







// Set params to send
paq_sent=(packetXBee*) calloc(1,sizeof(packetXBee));
paq_sent->mode=UNICAST;
paq_sent->MY_known=0;
paq_sent->packetID=0x52;
paq_sent->opt=0;
xbee802.hops=0;
//xbee802.setOriginParams(paq_sent, "0013A2004065F6A7", MY_TYPE);
//xbee802.setDestinationParams(paq_sent, "0013A200406918C4", data, MAC_TYPE, DATA_ABSOLUTE);
//xbee802.sendXBee(paq_sent);
char* data;


data = "Sent Data packet";
USB.print("Battery Level: ");
USB.print(PWR.getBatteryLevel(),DEC);
USB.println(" %");

xbee802.send("0013A200406918C4",data);
if( !xbee802.error_TX )
{
XBee.println("ok");
}
free(paq_sent);
paq_sent=NULL;

previous=millis();

while( (millis()-previous) < 10000 )
{

while(XBee.available())
{
USB.print("The packet is: ");
USB.println(XBee.available(),DEC);
USB.println(xbee802.error_RX,DEC);
USB.println(xbee802.pos,DEC);
state =0;

xbee802.treatData();
if(!xbee802.error_RX)
{
while(xbee802.pos>0)
{
// Treat the received packet
USB.print("The packet is: ");



USB.print(xbee802.packet_finished[xbee802.pos-1]->data[0]);


free(xbee802.packet_finished[xbee802.pos-1]);
xbee802.packet_finished[xbee802.pos-1]=NULL;
xbee802.pos--;
}
}

}

} // Waiting the answer


delay(1000);
}


Top
 Profile  
 
 Post subject: Re: sending Data from the Gataway to the waspmote
PostPosted: Mon Jun 25, 2012 2:58 pm 

Joined: Mon Sep 28, 2009 1:06 pm
Posts: 7479
aly1990,

Did you followed waspmote checklist? it is just to be sure you are doing main steps correctly.

Also, please upload exapme codes and try to test it before making your own code.

One last tip: be sure your XBee's have same network parameters.

Regards.


Top
 Profile  
 
 Post subject: Re: sending Data from the Gataway to the waspmote
PostPosted: Mon Jun 25, 2012 4:57 pm 

Joined: Thu Jun 21, 2012 5:34 pm
Posts: 19
thank you for your kind reply.

I am confused because i can send data but i cannot receive. when i send data from the gateway to the waspmote i use the x-ctu terminal provided by digi. Do u think the problem is with my transciever?


Top
 Profile  
 
 Post subject: Re: sending Data from the Gataway to the waspmote
PostPosted: Mon Jun 25, 2012 5:42 pm 

Joined: Thu Jun 21, 2012 5:34 pm
Posts: 19
Dear libelium-dev

I have solved the problem;the right function to use is XBee.read().

thank you for your support


Top
 Profile  
 
 Post subject: Re: sending Data from the Gataway to the waspmote
PostPosted: Mon Jun 25, 2012 6:19 pm 

Joined: Mon Sep 28, 2009 1:06 pm
Posts: 7479
Glad to hear that.

Regards


Top
 Profile  
 
Display posts from previous:  Sort by  
Post a new topicPost a reply Page 1 of 2   [ 12 posts ]
Go to page 1, 2  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:


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