I have two wt32-eth01 V1.2 boards and they are acting the same. Here are my issues:
I can xmit out of Serial2 fine but I cannot receive serial2 packets.
I have an o'scope on Serial2 RXD pin and I see the waveform and I also see the Serial2 LED light up indicating that my packet is at that RXD pin.
I selected a very simple example to Serial2.available() and print to the Serial monitor but I never get any bytes.
I tried different baud rates for the Serial.print statements but I never get data from RXD.
I thought I had it fixed. I used a loopback wire on the serial2 and I finally received some bytes. I went on a walk and came back and now I cannot get it to work. I still see both Rx and Tx LEDs blinking but my simple code is not receiving any loopback bytes.
I am using an external power supply.
Do I need a resistor somewhere? My o'scope shows that the Rx signal goes from 3.3V all the way to 0V. It appears there is a strong signal.
I found some schematics for the wt32-eth01. It appears that the designer named IO35_RXD2 coming off of the ESP32_WT32-S1 chip. I'm not sure why. The document named IO35 as an input only. I tried connecting my lookback from TXD (IO17) to this IO35 input pin but I still do not get any bytes at the serial input.
I use Arduino 2 IDE. I type “Serial2.” And it gives me several method options. I’m not near my computer so I can’t give you he exact method. You can also look in the header file.
void setup() {
// put your setup code here, to run once:
Serial2.begin(9600);
Serial2.setPins(35,17);
Serial2.setHwFlowCtrlMode(2,64);
}
void loop() {
// put your main code here, to run repeatedly:
if(Serial2.available()){
char a = (char)Serial2.read();
Serial2.print(a);
}
void setup() {
// put your setup code here, to run once:
Serial2.begin(9600,SERIAL_8N1,35,17);
//Serial2.setPins(35,17);
//Serial2.setHwFlowCtrlMode();
Serial2.setHwFlowCtrlMode(HW_FLOWCTRL_DISABLE);
}
void loop() {
// put your main code here, to run repeatedly:
if(Serial2.available()){
char a = (char)Serial2.read();
Serial2.print(a);
}
}
It tells me that RX pin is GPIO35, but I check again in the the datasheet from official distributor ( wirelestag) the RX pin is GPIO5. After I change, it works.
Here is my works code :
#include <HardwareSerial.h>
void setup() {
// put your setup code here, to run once:
Serial2.setPins(5, 17);
Serial2.begin(921600, SERIAL_8N1, 5,17);
Serial2.setHwFlowCtrlMode(HW_FLOWCTRL_DISABLE);
}
void loop() {
// put your main code here, to run repeatedly:
if(Serial2.available()>0){
char a = (char)Serial2.read();
Serial2.print(a);
}
}