Go Down

Topic: XBee Mesh Communication (Read 659 times) previous topic - next topic

fricolicious

Hi guys.

For my university degree I'm working on a ZigBee mesh but I can't get it to correctly send data.
For now i use a XBee S2 Coordinator (API mode of course) with the SparkFun USB Explorer controlled by the Java XBee-API examples and a mobile device (Router in API mode) based on a Pro Mini 3.3v and a SparkFun Explorer Regulated to connect it to the FTDI port easily. The Arduino is using the XBee-arduino library. (The only one out there afaik)

What works:

  • Sending packets from the PC to the arduino (including ACK sent back from the arduino's XBee

  • AT Commands on the arduino



Does not work:
Sending packets from the arduino to the PC. The Din LED of the arduino's XBee adapter flashes, but the Dout does not. So noting is even sent out. Invalid Packet? No idea since I'm using all the example codes out there.

Code: [Select]
uint8_t payload[] = { 1, 2 };
XBeeAddress64 addr64 = XBeeAddress64(0x0013a200, 0x4079014d);
ZBTxRequest zbTx = ZBTxRequest(addr64, payload, sizeof(payload));
xbee.send(zbTx);


Note: The Devices are in the same PAN and xbee.readPacket() does not receive any message from the xbee, not even an MODEM_STATUS_RESPONSE.

After trying hundreds of code changes and even shortwiring the explorer's regulation stuff i put both XBees in AT mode and used just Serial.print() to send chars. Worked like a charm and the Dout LED flashed as expected. So the hardware stuff must be alright.

Don't know what could be the reason now, except the library which is receiving but apparently not sending correct(?!)
I really hope for any advise. Thanks ;)

PaulS

Quote
Sending packets from the arduino to the PC.

This is a multi-step process. The Arduino sends a packet to the XBee. The XBee sends the packet over the air. The packet is received by the other XBee. The packet is passed to the PC by the USB Explorer. The application on the PC does something with the package. That the Din light flashes tells me that the USB Explorer got the data and tried to pass is to the PC.

What I see is a failure of the PC to accept and process the packet. What code is running on the PC?

fricolicious

#2
Dec 29, 2012, 11:19 am Last Edit: Dec 29, 2012, 11:29 am by fricolicious Reason: 1

Quote
Sending packets from the arduino to the PC.

This is a multi-step process. The Arduino sends a packet to the XBee. The XBee sends the packet over the air. The packet is received by the other XBee. The packet is passed to the PC by the USB Explorer. The application on the PC does something with the package. That the Din light flashes tells me that the USB Explorer got the data and tried to pass is to the PC.

What I see is a failure of the PC to accept and process the packet. What code is running on the PC?

Guess you got me wrong there.
The flashing Din led is the one on the sender side, not the receiving USB explorer.


OH MY GOD.
i just reverted all XBees to default, set everything again, and it works. Tried this 20 times with 5 modules..
Problem solved.

Go Up