Hi libelium-dev,
Quote:
In order to test communication you can upload also example called "wasp_start_program_full_802 and place second Xbee into the gateway to see output.
I tried this pogram and used a Waspmote and Gateway. Everything works fine. I can see the different XBee Mac, of course changing the modules to check.
Quote:
Moreover, take a look into this post, It can be useful for you.
I read the post and my Waspmote have the same PAID, channel and different netAddr. Same firmware. I used X-CTU to check.
Code:
uint8_t PANID[2] ={0x99, 0x99};
uint8_t netAddr[2] ={0x88, 0x88};
uint8_t channel = 0x18;
Code:
uint8_t PANID[2] ={0x99, 0x99};
uint8_t netAddr[2] ={0x12, 0x34};
uint8_t channel = 0x18;
Once tried everything, I came to the conclusion that the transmission is working properly but in the receiver I can't pass the step of
if (XBee.available())I attached the code again. The transmission shows
ok if the receiver is turned on and
error if the receiver is turned off, so that the transmitter works well.
What is the problem?.
Thanks for everything!
Regards.
TransmiterQuote:
//MAC 0013A2004069185D #99 -> 0013A20040691859 #31
uint8_t PANID[2] ={0x99, 0x99}; // Mismo
uint8_t netAddr[2] ={0x12, 0x34}; // Diferente
uint8_t channel = 0x18; // Mismo
packetXBee* paq_sent;
int8_t state = 0;
char* data;
char aux[200];
char* macHigh=" ";
char* macLow=" ";
void setup()
{
USB.begin();
// Inits the XBee_802_15_4 library
xbee802.init(XBEE_802_15_4, FREQ2_4G, NORMAL);
// Powers XBee
xbee802.ON();
delay(500);
xbee802.setPAN(PANID);
xbee802.setChannel(channel);
xbee802.setOwnNetAddress(netAddr[0], netAddr[1]);
xbee802.setNodeIdentifier("Transmisor");
xbee802.writeValues();
// Get the XBee MAC address
int counter = 0;
while(xbee802.getOwnMac()==1&&counter<4){
xbee802.getOwnMac();
counter++;
}
Utils.hex2str(xbee802.sourceMacHigh,macHigh,4);
Utils.hex2str(xbee802.sourceMacLow,macLow,4);
delay(1000);
}
void loop(){
sprintf(aux,"-mac:%s%s Envio Realizado",macHigh,macLow);
USB.println(aux);
paq_sent=(packetXBee*) calloc(1,sizeof(packetXBee));
paq_sent->mode=UNICAST;
paq_sent->packetID=0x52;
paq_sent->opt=0;
xbee802.setOriginParams(paq_sent, "0013A2004069185D", MAC_TYPE);
xbee802.setDestinationParams(paq_sent, "0013A20040691859", aux, MAC_TYPE, DATA_ABSOLUTE);
xbee802.sendXBee(paq_sent);
if( !xbee802.error_TX ){
XBee.println("ENVIO CORRECTO");
Utils.blinkLEDs(100);
}else{
XBee.println("ERROR AL ENVIAR");
}
Utils.blinkLEDs(100);
free(paq_sent);
paq_sent=NULL;
delay(5000);
}
ReceiverQuote:
//MAC 0013A2004069185D #99 -> 0013A20040691859 #31
uint8_t PANID[2] ={0x99, 0x99}; // Mismo
uint8_t netAddr[2] ={0x88, 0x88}; // Diferente
uint8_t channel = 0x18; // Mismo
long previous=0;
void setup()
{
USB.begin();
// Inits the XBee_802_15_4 library
xbee802.init(XBEE_802_15_4, FREQ2_4G, NORMAL);
// Powers XBee
xbee802.ON();
delay(500);
xbee802.setPAN(PANID);
xbee802.setChannel(channel);
xbee802.setOwnNetAddress(netAddr[0], netAddr[1]);
xbee802.setNodeIdentifier("Receptor");
xbee802.writeValues();
delay(1000);
}
void loop()
{
previous=millis();
while( (millis()-previous) < 20000 ){
USB.println("Check 1"); //To check the running state
if (XBee.available()) { //It checks if there is available data waiting to be read.
USB.println("Check 2");
XBee.println("XBee is available");
xbee802.treatData();
if (!xbee802.error_RX) {
USB.println("Check 3");
while(xbee802.pos>0){
Utils.blinkLEDs(100);
USB.println("Ha llegado algo");
}
previous=millis();
}
}
}
delay(1000);
}