I am a newbie for use xbee, and i want to build MANET and use xbee for the transmit module. So to transfer sensor’s data from node to server, i don’t know how to print node’s address on arduino’s code so that the other nodes is knowing data from who.
I set xbee to broadcast mode.
PAN ID = 1111,
DL (Destination Low Address) = FFFF
DH (Destination High Address) = 0
Can u help me? Sorry if my language so bad.
1 Like
#include
SoftwareSerial XBee(3, 4); // RX, TX
String xbee_ir_data;
#define XBEE_BUF_LEN 70 //maximum payload
byte xbeeBuf[XBEE_BUF_LEN];
void setup()
{
// Open serial communications and wait for port to open:
Serial.begin(9600);
XBee.begin(9600);
}
void loop() // run over and over
{
if (XBee.available() > 0){
for(int i ;i < XBEE_BUF_LEN; i++){
xbeeBuf[i] = XBee.read();
delay(10);
}
//XBEE_BUF_START_DATA 15 // end 70
for(int i=15;i < 70; i++){
Serial.print(xbeeBuf[i],HEX);
}
Serial.println();
}
}
// see xbee address at the third byte >>
1 Like