Trouble with SoftwareSerial. Alternative recommendations?
Posted: Fri Mar 08, 2019 12:10 am
Hi all.
I'm using an ESP32-WROVER-KIT in Arduino IDE
I'm trying to get an XBee wireless receiver working with my WROVER using the arduino breakout board and just wiring the digital pins 2, and 3 to GPIOs 2 and 4 on the ESP32 and using the SoftwareSerial library that has been floating around (the one the supposedly doesn't work above 54K baud or whatever) and running it at 38400 baud.
I've been trying this, and while the LED indicators on the XBee breakout board show successful transmission from the transmitter XBee, the ESP32 doesn't seem to be receiving them. I try feeding the received values into the main serial port (the USB) and am getting no results.
I'm wondering if there's a simpler way using HardwareSerial instead but i don't know which IO pins on the development board correspond with the other two UARTs (i'd rather keep the RXD,TXD0 and TXD, RXD0 bridged)
Any suggestions?
Here are the snippets of the code involving the softwareserial
Thank you!
I'm using an ESP32-WROVER-KIT in Arduino IDE
I'm trying to get an XBee wireless receiver working with my WROVER using the arduino breakout board and just wiring the digital pins 2, and 3 to GPIOs 2 and 4 on the ESP32 and using the SoftwareSerial library that has been floating around (the one the supposedly doesn't work above 54K baud or whatever) and running it at 38400 baud.
I've been trying this, and while the LED indicators on the XBee breakout board show successful transmission from the transmitter XBee, the ESP32 doesn't seem to be receiving them. I try feeding the received values into the main serial port (the USB) and am getting no results.
I'm wondering if there's a simpler way using HardwareSerial instead but i don't know which IO pins on the development board correspond with the other two UARTs (i'd rather keep the RXD,TXD0 and TXD, RXD0 bridged)
Any suggestions?
Here are the snippets of the code involving the softwareserial
Code: Select all
SoftwareSerial XBee(2,4, false, 256); //Rx, Tx
...
void setup(){
XBee.begin(38400);
...
}
void checkSerial(){
int intBuffer[3];
byte dataCommand = 0;
while(XBee.available() > 0)
{
Serial.write(XBee.read()); //for testing
}
if(XBee.available() == 3){
intBuffer[0] = XBee.read(); //when the above serial.write is removed
intBuffer[1] = XBee.read();
intBuffer[2] = XBee.read();
blah blah blah
...
}
blah
...
}
Thank you!