ok, after watching this video(
http://www.youtube.com/watch?v=XdSMQwJAkjE),i know clearly what am i doing.
Yet,it doesnt work.
so here are the codes.
xbeeDM
Code:
/*
* ------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 Digimesh
*
* 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
xbeeDM.init(DIGIMESH,FREQ2_4G,NORMAL);
xbeeDM.ON();
// CheckNewProgram is mandatory in every OTA program
xbeeDM.checkNewProgram();
}
void loop()
{
// Check if new data is available
if( XBee.available() )
{
xbeeDM.treatData();
// Keep inside this loop while a new program is being received
while( xbeeDM.programming_ON && !xbeeDM.checkOtapTimeout() )
{
if( XBee.available() )
{
xbeeDM.treatData();
}
}
}
// Blink LED1 while messages are not received
Utils.setLED(LED1,LED_ON);
delay(100);
Utils.setLED(LED1,LED_OFF);
delay(100);
}
xbee.conf
Code:
# port where the xbee moduel is connected
port = COM14
# auth key of network
auth_key = LIBELIUM
# pan ID of network
panID = 0x0102
# xbee model
xbeeModel = DM
# 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 know that it cant discover the node,i think that the problem is the xbee.conf
any suggestions?