Hello! I had recently started to work on a project that requires me to establish a wireless communication between two XBEE Pro S2C modules for the purpose of sending data of the sensors present on the Arduino Nano BLE 33 Sense.
What I have done so far: One of the XBEE (XBEE1) is connected to my laptop using one of the USB-port, and the other (XBEE2) to Arduino. The Arduino is also connected to the same laptop using another one of the USB ports. Using the XBEE and Arduino pinout diagrams, I connected Vcc, Dout, Din and GND of XBEE 2 to 3.3V, D3, D4 and GND pins of the Arduino respectively. Both the XBEES have been configured using XCTU software and are operating in AT mode. The XBEES are able to talk to each other on the XCTU console if I directly plug both of them into the laptop using the USB ports.
Now, I uploaded the following code to Arduino to check the serial connection:
UART Xbee(digitalPinToPinName(4), digitalPinToPinName(3));
void setup() {
Serial.begin(9600);
Xbee.begin(9600);
}
void loop() {
while(Xbee.available())
{
Serial.write(Xbee.read());
}
while(Serial.available())
{
Xbee.write(Serial.read());
}
}
After uploading the sketch, when I type the characters into the XCTU serial console of XBEE1, it is immediately displayed on the Serial monitor of IDE, which is expected. The TX of the adapter for XBEE 1 and the RX of the adapter for XBEE 2 also blinks at the same moment, confirming that the character is being sent by the XBEE 1 and it is being received by XBEE 2 for the Arduino to print (The adapters that I am using are CP2012 XBEE Explorer).
The Problem: When I type into the Serial Monitor for the Arduino to do the reverse job, nothing is displayed on the XCTU serial console. The respective TX and RX lights of the adapter do not blink either, meaning that XBEE2 is not able to transmit only.
What I have done to fix: I tried using a different board, Arduino Uno, and the code (after some modifications, removing UART and adding SoftwareSerial) works flawlessly. Both the XBEES are able to receive and transmit. However as soon as I run the code on Arduino Nano BLE 33 Sense, the problem persists, XBEE 2 receives but doesn't transmit. I have checked the connections to Arduino Nano, and even soldered the pins. I tried using different digital pins instead of D4 and D3, but the problem remains exactly the same.
I also found a similar problem on this forum itself, but I have tried upgrading the XBEE firmware to all the possible options that were listed on the XCTU, and the result was still the same.
I would be extremely thankful to anyone who would be able to point me into the right direction and tell me where I am going wrong. Thanks a lot!