Hi,
I have a setup with 3 nodes (A, B and C). Nodes B and C are running the standard OTA 802 example (WaspOTA_802_1.pde), and Node A is running the same code but modified to send sensor frames as from the standard waspmote start program (wasp_start_program-full_802_v1.pde).
If I run Node A on its own, I can collect the sensor frames from it and scan the node (using the OTAP scan_nodes command in BROADCAST mode). Everything is fine.
If I now turn on Nodes B and C, I am still able to collect the sensor frames from Node A. However, if I run the OTAP scan_nodes command in BROADCAST mode, am I only ever able to see Node A. never Node B and/or Node C. I can however reset each node individually using the OTAP reset command.
If I turn on all three nodes and perform the OTAP scan_nodes command in BROADCAST mode, then I am initially able to see all three nodes, but never again there after.
If I switch off Node A after the problem occurs, I still cannot see Nodes B and C until i reset them.
If only Nodes B and C are on, then scan_nodes always performs as expected...i.e. it works ;)
The code on the Nodes was compiled using Waspmote IDE v0.2 (API v22.0) under Linux.
The code running on Node A is as follows:
Code:
// XBee packet forming variables
packetXBee* paq_sent;
int8_t state=0;
long previous=0;
char aux[200];
char* macHigh=" ";
char* macLow=" ";
int aux_1 = 0;
int aux_2 = 0;
#define key_access "LIBELIUM"
#define id_mote "WASPMOTE00000001"
uint8_t direccion[8]={0x00,0x00,0x00,0x00,0x00,0x00,0xFF,0xFF};
void setup()
{
USB.begin();
USB.println("Waspmote OTA Setup");
// Write Authentication Key in EEPROM memory
for(int i=0;i<8;i++)
{
Utils.writeEEPROM(107+i,key_access[i]);
}
// Write Mote ID in EEPROM memory
for(int i=0;i<16;i++)
{
Utils.writeEEPROM(147+i,id_mote[i]);
}
RTC.ON();
ACC.ON();
XBee.setMode(XBEE_ON);
XBee.begin(9600);
delay(1000);
XBee.print("+++");
delay(2000);
XBee.println("ATBD5,AP2,WR,CN");
delay(150);
XBee.setMode(XBEE_OFF);
XBee.close();
// Flash LEDs on Set-UP
Utils.setLED(LED0, LED_ON);
Utils.setLED(LED1, LED_ON);
delay(5000);
Utils.setLED(LED0, LED_OFF);
Utils.setLED(LED1, LED_OFF);
for (int i=0;i<24;i++){
Utils.blinkLEDs(125);
}
// Initialize Xbee module
xbee802.init(XBEE_802_15_4,FREQ2_4G,NORMAL);
xbee802.ON();
int counter = 0;
while(xbee802.getOwnMac()==1&&counter<4){
xbee802.getOwnMac();
counter++;
}
Utils.hex2str(xbee802.sourceMacHigh,macHigh,4);
Utils.hex2str(xbee802.sourceMacLow,macLow,4);
// CheckNewProgram is mandatory in every OTA program
xbee802.checkNewProgram();
}
void loop()
{
// Check if new data is available
if( XBee.available() )
{
xbee802.treatData();
// Keep inside this loop while a new program is being received
while( xbee802.programming_ON && !xbee802.checkOtapTimeout() )
{
if( XBee.available() )
{
xbee802.treatData();
}
}
}
// Blink LED1 while messages are not received
//Utils.setLED(LED1,LED_ON);
//delay(100);
//Utils.setLED(LED1,LED_OFF);
//delay(100);
sprintf(aux,"-mac:%s%s -x:%d,y:%d,z:%d -temp:%d -bat: %d%c%c%c",macHigh,macLow,ACC.getX(),ACC.getY(),ACC.getZ(),RTC.getTemperature(),PWR.getBatteryLevel(),'%','\r','\n');
paq_sent=(packetXBee*) calloc(1,sizeof(packetXBee));
paq_sent->mode=BROADCAST;
paq_sent->MY_known=0;
paq_sent->packetID=0x52;
paq_sent->opt=0;
xbee802.hops=0;
xbee802.setOriginParams(paq_sent,MAC_TYPE);
xbee802.setDestinationParams(paq_sent, direccion, aux, MAC_TYPE, DATA_ABSOLUTE);
xbee802.sendXBee(paq_sent);
free(paq_sent);
paq_sent = NULL;
delay(1000);
}