Post a new topicPost a reply Page 1 of 1   [ 10 posts ]
Author Message
 Post subject: Scan_nodes issue
PostPosted: Tue Apr 10, 2012 11:43 am 

Joined: Fri Jan 13, 2012 2:27 pm
Posts: 34
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);

}


Top
 Profile  
 
 Post subject: Re: Scan_nodes issue
PostPosted: Wed Apr 11, 2012 9:29 am 

Joined: Fri Jan 13, 2012 2:27 pm
Posts: 34
As an additional note. The nodes running the standard OTA 802 example (WaspOTA_802_1.pde), Node B and C, while in the presence of the transmitting Node A, can be scanned successfully once after starting. Further tries are futile. If I rest Nodes B and C using the OTAP reset command, then they can be again scanned one more time.

Is there something non-persistent in this example code when in the presence of a node transmitting sensor frames?


Top
 Profile  
 
 Post subject: start_new_program - node response
PostPosted: Fri Apr 13, 2012 4:16 pm 

Joined: Fri Jan 13, 2012 2:27 pm
Posts: 34
Ok, if no-one can help me with that problem (and to save me from spamming the forum with another new post) can anyone help me with the following problem?


I have 2 programs downloaded to the SD cards of my waspmote. Running prog001, I send the following command to tell it to run prog002:

Code:
./otap -start_new_program --mac <waspmotemacID> --mode UNICAST --pid prog002


The command runs and I see the little 'busy' symbol (rotating '/'). I see the waspmote restart itself but on my laptop the OTAP command continues to wait with the output:

Code:
Waiting confirmation


Eventually timing out with the following:

Code:
Timeout reached without node response


The waspmote does indeed run prog002 after the command, so in that respect its fine, however the length of the timeout will cause my program problems.

Am I missing something from the code on my waspmote, that handles these responses?


Top
 Profile  
 
 Post subject: Re: Scan_nodes issue
PostPosted: Fri Apr 20, 2012 11:13 am 

Joined: Mon Sep 28, 2009 1:06 pm
Posts: 7516
Hi,

Fab4 wrote:
The waspmote does indeed run prog002 after the command, so in that respect its fine, however the length of the timeout will cause my program problems.

Am I missing something from the code on my waspmote, that handles these responses?
Does this new "prog002" include the function checkNewProgram?

Best regards


Top
 Profile  
 
 Post subject: Re: Scan_nodes issue
PostPosted: Fri Apr 20, 2012 11:51 am 

Joined: Fri Jan 13, 2012 2:27 pm
Posts: 34
libelium-dev wrote:
Hi,

Fab4 wrote:
The waspmote does indeed run prog002 after the command, so in that respect its fine, however the length of the timeout will cause my program problems.

Am I missing something from the code on my waspmote, that handles these responses?
Does this new "prog002" include the function checkNewProgram?

Best regards



Yes. It is just a direct copy of your 802 OTA example code.


Top
 Profile  
 
 Post subject: Re: Scan_nodes issue
PostPosted: Wed May 02, 2012 9:55 am 

Joined: Mon Sep 28, 2009 1:06 pm
Posts: 7516
Hi,

So, your motes are being programmed correctly but ota shell doesn't show the respnse with the afirmative or negative message?

Regards


Top
 Profile  
 
 Post subject: Re: Scan_nodes issue
PostPosted: Wed May 02, 2012 10:17 am 

Joined: Fri Jan 13, 2012 2:27 pm
Posts: 34
libelium-dev wrote:
Hi,

So, your motes are being programmed correctly but ota shell doesn't show the respnse with the afirmative or negative message?

Regards


Correct. It times out after ~45 seconds.

Even when things work 'correctly', for example, when sending a new program OTA using (-send), I do not receive the result indicated by the OTA users guide, i.e.:

Node <mac>: PROGRAM RECEIVED OK

But the program is delivered successfully.


Top
 Profile  
 
 Post subject: Re: Scan_nodes issue
PostPosted: Wed May 09, 2012 10:40 am 

Joined: Mon Sep 28, 2009 1:06 pm
Posts: 7516
Hi,

Does this happen in all your tries? Maybe the responding message doesn't arrive properly. But this could happen sometimes, not always.

Best regards


Top
 Profile  
 
 Post subject: Re: Scan_nodes issue
PostPosted: Thu May 10, 2012 8:50 am 

Joined: Fri Jan 13, 2012 2:27 pm
Posts: 34
libelium-dev wrote:
Hi,

Does this happen in all your tries? Maybe the responding message doesn't arrive properly. But this could happen sometimes, not always.

Best regards



I get no response every single time.


Top
 Profile  
 
 Post subject: Re: Scan_nodes issue
PostPosted: Thu Jun 07, 2012 9:12 am 

Joined: Mon Sep 28, 2009 1:06 pm
Posts: 7516
Hi,

1. Did you get your SD cards from Libelium?
2. Have you ever check if the program is inside the SD card? Try with get_boot_list
3. Does your Waspmote work correctly after not showing the message. Does it answer to scan_nodes?
4. Little trick: next time you try it indoors. Connect a USB port to your Waspmote and open a serial port to monitor the output of your Waspmote. Thus, you'll be able to see if the mote responds with the message OK or ERROR.

Best regards


Top
 Profile  
 
Display posts from previous:  Sort by  
Post a new topicPost a reply Page 1 of 1   [ 10 posts ]


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