I haven't tried but I think when you upload code, you should set jumpers to usb position.
To upload the code I switched jumpers to USB position, but for a right behaviour they must be at xbee position. Unless someone could tell me another thing...
The problem is in 'send side'.
- I tried making the frames by myself and send them by x-ctu software, and it works fine!!
- Moreover, I send the handmade frame by x-ctu (from router) and I receive it (to coordinator). [I have problems showing the entire data, but this is my fault].
- In the other way, sending data with API and receiving it without it, it doesn't work.
I can't find what is the code problem. I think it might be because of the S2B chips , which are different from the S2 ones.
Try removing the Serial.print() and Serial.println() calls from your sketch and see it that makes any difference.
I tried it but there's no difference. It didn't work.
I'm thinking it could be a problem with 'send' instruction and the 'escape' character when it creates the frame.
I'm taking a look of the code.
Hi,
thanks!!
The Xbees are setted by X-CTU to AP2.
I was checking the library and in the XBee.cpp, at 'sendByte' function I substituted the 'write' instructions for 'Serial.print(xxx, HEX)', where xxx are 'ESCAPE', 'b^20' or 'b'. And it shows the frame to send, but this frame is wrong (I know that when a byte is '00', it only shows one '0').
I couldn't tell you if it because of the 'Serial.print' instruction this wrong behaviour, but how I told you before if I send the frame manually, the mesage is delivered to the receiver (in my case the coordinator).
Regards
Hi,
I've been doing more attempts today. I modified the 'send' function when it adds '2' to the frame length because the didn't be equal as the length of my frame. But it doesn't matters it didn't work yet.
So, I was looking for another thing, and I did the next things:
- I was sending data in AT mode and the coordinator received it in api mode (AP2).
- Instead an arduino mega2560 I used an arduino UNO, but the behaviour was the same as in the mega ones.
- I tried to send the data in the API mode (AP2), and received it by coordinator in AT mode, but coordinator didn't get anything.
- And, finally, I checked if it could be because of the serial. How I did this? Ok, I switched the jumpers to USB mode, and tried again to send data by terminal (x-ctu). It worked! Coordinator get the message. But when I switched back the jumpers to XBEE mode, the router didn't send anything once more.
I'm using the examples in the xbee library for API modes, and for AT modes I only printed the next message: Serial.print("HELLO");
So, it wouldn't be because of the serial. But I don't know what more to try. Also I updated the ZB modules firmwate, but they don't work yet.
Regards
Hello
I have a problem almost identical to yours and I'm looking for a tested code just for simple communication no more no less
I will tell you if I got results
Regards
"Xbee Library"
In 'sendByte' function, when the it calculates the checksum it has to be:
"checksum = 0xff - (checksum & 0xff);"
But communication still fails!