Dear libelium-dev,
Good afternoon. Thank you for your kind reply.
Now it is succussed, both
"waspmote to gateway" and
"waspmote to waspmote", the reason is that one of the Xbee(digi international) can't create network, so I tried to use X-CTU, updating its version same as the good Xbee, then change the API=2, Channel and PANID are same as the good one too. Broadcast and Unicast are both ok. Thank you so much!
Now, my next objective(under 802.15.4): A send data to B, A is Waspmote, B is
Waspmote or Gateway, B is connected to the PC, I want to use PC to manage the B, like sending back the ACK, sending a command from B to A.
From A to B, we can achieve, but from B(gateway) to A, I used
java to write some codes, and we follow the guide "waspmote-802.15.4-networking_guide.pdf" to organize the data structure, A received nothing. I do not know why?
For achieve
the communication from B to A, using Waspmote as B or using Gateway as B, which one is better for my project, any suggestion?
Java codeCode:
byte[] packet= new byte[30];
InputStream is;
OutputStream os;
SerialPort serialPort;
serialPort = (SerialPort) portId.open("MYPort", 2000);
serialPort.setSerialPortParams(38400,//BaudRate
SerialPort.DATABITS_8,//Databits
SerialPort.STOPBITS_1,// Stopbits
SerialPort.PARITY_NONE);// Parity
os = new BufferedOutputStream(serialPort.getOutputStream());
is = new BufferedInputStream(serialPort.getInputStream());
//prepare data
int macGW[] = {0x00, 0x13, 0xA2, 0x00, 0x40,0x4A,0x38,0xA0};
int macMote[] = {0x00, 0x13, 0xA2, 0x00, 0x40, 0x69, 0x18,0xA7};
int i = 0;
int j = 0;
//start Byte
packet[i++] = 0x7E;
//lenght
packet[i++] = 0x00;
packet[i++] = 0x18;
//API ID
packet[i++] = 0x10;
//FRAME ID
packet[i++] = 0x01;
//MAC Destination
for (j=0; j < 8 ; j++) {
packet[i++] = (byte) macMote[j];
}
//Options
packet[i++] =0x00;
//Application ID
packet[i++] = 0x52;
//Fragment Numer
packet[i++] = 0x01;
//First Number
packet[i++] = 0x23;
//Source type ID
packet[i++] = 0x01;
//Mac Source
for (j=0; j < 8 ; j++) {
packet[i++] = (byte) macGW[j];
}
//data
packet[i++] = 0x01;
packet[i++] = checksum(packet);
os.write(packet);
Thanks again.
Best Regards,
cyyss