Post a new topicPost a reply Page 1 of 1   [ 10 posts ]
Author Message
 Post subject: otap64 sending problem
PostPosted: Fri May 25, 2012 2:37 pm 

Joined: Fri Oct 14, 2011 4:14 pm
Posts: 34
Location: Fribourg, Switzerland
Hello libelium-dev,

I've got some real problems with sending a program into the waspmote, i can't understant why.

The scan_nodes works, so I can see my waspmote, it gives me this output:
Code:
0 - Node 0013a200xxxxxxxx - $$$$$$$$$$$$$ - WASPMOT - READY


The get_boot_list command gives me this output:
Code:
Bootlist Node 0013a200xxxxxxxx - Length: 0


When I tried to upload a simple program to the waspmote through the command:
Code:
otap64 -send --mode UNICAST --mac 0013a200xxxxxxxx --file C:\otap\prova1.cpp.hex --pid prog001

I got this result:
http://imageshack.us/photo/my-images/831/waspsend.png/

So it took 1 hour for uploading a simple code, this is the code:

void setup()
{
xbee802.init(XBEE_802_15_4,FREQ2_4G,NORMAL);
xbee802.ON();
xbee802.checkNewProgram();
}
void loop()
{
USB.println("Hello");
}

but I didn't get a PROGRAM RECEIVED in the end.

There must be smth that doesn't work here, I tried to get the bootlist after this, but it is empty like before.

I would really appreciate your help (and everyone else) to solve this little issue.

Thank you in advance.


Top
 Profile  
 
 Post subject: Re: otap64 sending problem
PostPosted: Tue May 29, 2012 4:30 pm 

Joined: Mon Sep 28, 2009 1:06 pm
Posts: 7455
HellDrag,

let us make you some questions trying to find a solution for this.

  1. Can you post xbee.conf file?
  2. Are you using encryption? Try first with no encryption.
  3. Please take a look at section 7.7 of OTA programming guide and check how send command works.

Let us know before going further.

Best regards


Top
 Profile  
 
 Post subject: Re: otap64 sending problem
PostPosted: Tue May 29, 2012 4:43 pm 

Joined: Fri Oct 14, 2011 4:14 pm
Posts: 34
Location: Fribourg, Switzerland
Dear Libelium-dev

Here is my xbee.conf
Code:
# port where the xbee moduel is connected
port = COM7
# auth key of network
auth_key = LIBELIUM
# pan ID of network
panID = 0x1234
# xbee model
xbeeModel = 802.15.4
# channel number
channel = 0x13
# encryption of network
encryption = off
# encryption key of network
encryptionKey = 1234567890123456
# name of the file where discarded data goes
#discardedDataFile = data.txt


I don't use any encryption.
For the OTA guide, I have read it a lot of times, trying to find out any solution.
The communication between the mote and the gateway works perfectly, I can receive sensor data from the Events Board.
The -scan_nodes works, as I explained in my previous post, but still, I can't upload a new program on the mote.

I saw somewhere in the forum, that AmroQuandour has posted this:
Quote:
assume you have a 2GB SD card for the waspmote right?

Anyway, sometimes after initializing the SD card OTAP worked. so try the code which I used in the video but add the following in void setup():

Code:
SD.ON();


but it didn't help at all.

I have tried the send command with your code:

Quote:
/*
 *  ------Waspmote OTA set up Example------
 *
 *  Explanation: This example shows how to set up Waspmote for operating
 *  with OTA (Over The Air Programming). This code is valid for XBee 802.15.4
 *
 *  This code writes OTA's Authentication Key and Mote ID in EEPROM memory
 *  This code can be used as a template to develop any other code that
 *  provides OTA functionality.
 *  
 *
 *  Copyright (C) 2011 Libelium Comunicaciones Distribuidas S.L.
 *  http://www.libelium.com
 *
 *  This program is free software: you can redistribute it and/or modify
 *  it under the terms of the GNU General Public License as published by
 *  the Free Software Foundation, either version 2 of the License, or
 *  (at your option) any later version.
 * 
 *  This program is distributed in the hope that it will be useful,
 *  but WITHOUT ANY WARRANTY; without even the implied warranty of
 *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 *  GNU General Public License for more details.
 * 
 *  You should have received a copy of the GNU General Public License
 *  along with this program.  If not, see <http://www.gnu.org/licenses/>.
 *
 *  Version:                0.1
 *  Design:                 David Gascón
 *  Implementation:         Alberto Bielsa, Yuri Carmona
 */

#define key_access "LIBELIUM"
#define id_mote "WASPMOTE00000001"

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]);
  }

  // Initialize Xbee module
  xbee802.init(XBEE_802_15_4,FREQ2_4G,NORMAL);
  xbee802.ON();
   
  // 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);
    
}




and other code as well, but I get the same result.

I will try to reformat the sd card and see what happens, this is the only thing I can think of right now.
As soon as I try this, I will let you know.

Best regerds.

P.S the microSD card is from libelium.


Top
 Profile  
 
 Post subject: Re: otap64 sending problem
PostPosted: Tue May 29, 2012 4:55 pm 

Joined: Fri Oct 14, 2011 4:14 pm
Posts: 34
Location: Fribourg, Switzerland
Just checked the microSD card and it is empty, within the specifications that are declared in the ota guide.


Top
 Profile  
 
 Post subject: Re: otap64 sending problem
PostPosted: Tue May 29, 2012 5:10 pm 

Joined: Fri Oct 14, 2011 4:14 pm
Posts: 34
Location: Fribourg, Switzerland
This is what I get if I try to send a new firmware

http://imageshack.us/photo/my-images/198/waspsend1.png/

I have tried both modes, UNICAST and BROADCAST.

Once I saw on the terminal the:
"Delivery status 63" - or smth like this.


Top
 Profile  
 
 Post subject: Re: otap64 sending problem
PostPosted: Thu Jun 07, 2012 9:02 am 

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

1. Is your gateway configured with ATAP=1?
2. Is your battery connected?
3. The scan_nodes message you posted is not right. It should be something like this:
Code:
./otap -scan_nodes --mode UNICAST --mac 0013a200406b53ee
----------------------------------------------------------------
Total Nodes: 1 - Time elapsed: 2s
0   - Node 0013a200406b53ee - WASPMOTE00000001 - test519 - READY
----------------------------------------------------------------

When you receive this message when scanning your node, try uploading a code. A simple code like the one you posted should spent more or less 5 minutes. (not an hour).

Best regards


Top
 Profile  
 
 Post subject: Re: otap64 sending problem
PostPosted: Fri Jun 08, 2012 12:32 pm 

Joined: Fri Oct 14, 2011 4:14 pm
Posts: 34
Location: Fribourg, Switzerland
Hello,

I checked and overchecked the parameters of the gateway with the X-CTU program. These are the results:
Code:
---Networking & Security---
(13) CH - Channel
(1234) ID - PAN ID
(0) DH - Destination Address High
(0) DL - Destination Address Low
(FFFF) MY - 16-bit Source Address
(13A200) SH - Serial Number High
(40693719) SL - Serial Number Low
(0) MM - MAC Mode
(0) RR - Xbee Retries
(0) RN - Random Delay Slots
(19) NT - Node Discovery Time
(0) NO - Node Discovery Options
(0) CE - Coordinator Enable
(1FFE) SC - Scan Channels
(4) SD - Scan Duration
(0) A1 - End Device Association
(0) A2 - Coordinator Association
(0) AI - Association Indication
(1) EE - AES Encryption Enable
KY - AES Encryption Key
() NI - Node Identifier

---Serial Interfacing---
(5) BD - Interface Data Rate
(0) NB - Parity
(3) RO - Packetization Timeout
(1) AP - API Enable
(FF) PR - Pull-up Resistor Enable


I am currently using the Command Prompt of Windows 7 64-bit Enterprise
Processor: Intel(R) Core(TM)2 CPU 6400 @ 2.13GHz
RAM: 4.00 GB
System type: 64-bit Operating System
Service Pack 1

Otap version is
Code:
C:\otap>otap64 -version
(R) Libelium - Program version: 0.1-b70


Scan Nodes Result:
Code:
C:\otap>otap64 -scan_nodes --mode UNICAST --mac 0013a200406fb345
---------------------------------------------------------------------------
Total Nodes: 1 - Time elapsed: 2s
0   - Node 0013a200406fb345 - WASPMOTE00000001 - ??????? - READY
---------------------------------------------------------------------------


When I try to upload a new code, this is the result:
Code:
C:\otap>otap64 -send --mode UNICAST --mac 0013a200406fb345 --file prova1.cpp.hex --pid prog001

--------------------------------------------------------------------------
Name:                    prova1.cpp.hex
Date:                     Wed May 23 18:01:05 CEST 2012
Size:                      36578 bytes
Packets to send:      398
Estimated time:        119.4 seconds
--------------------------------------------------------------------------
Node: 0013a200406fb345
Device doesn't respond
Device doesn't respondds ¦
Device doesn't respond
Device doesn't respond
...


then I just terminate the task with Ctrl+C.

The waspmote works perfectly, I can receive messages from the Events Board and sensors on it.

The file prova1.cpp.hex is generated automatically from the Waspmote IDE when I tried to upload it into the mote (even though I didn't let it to be uploaded, I switched off the mote, so I maintained the previous code and in the same time the prova1.cpp.hex was generated.)

I don't know what other info to give you...
Please tell me if I have done smth wrong because I don't really understand.

Best regards
Helldrag


Top
 Profile  
 
 Post subject: Re: otap64 sending problem
PostPosted: Mon Jun 11, 2012 10:17 am 

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

As I see, you are using encryption. At least, this is what your X-CTU data says. Please try it without encryption (EE=0). And tell us what happens. Keep in mind that you'll have to disable the encryption mode in your waspmotes' xbees too.

Best regards


Top
 Profile  
 
 Post subject: Re: otap64 sending problem
PostPosted: Mon Jun 11, 2012 11:50 am 

Joined: Fri Oct 14, 2011 4:14 pm
Posts: 34
Location: Fribourg, Switzerland
Hello libelium-dev

I managed to turn off the encryption from both Xbees (gateway and the one on the mote), and I must admit that was the problem.

Now I can upload code to the mote, sometimes I get PROGRAM RECEIVED ERROR, other times it works just fine and I can see the result through the
Code:
otap64 --get_boot_list
command.

Thank you for the help.

Now I'll try to switch from one program to another.

Best regards

Helldrag


Top
 Profile  
 
 Post subject: Re: otap64 sending problem
PostPosted: Tue Jun 12, 2012 10:14 am 

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

You are welcome.
We look forward to hearing from you

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:


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