Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

UART 1 Doesn't transmit/receive - WiFi LoRa32 V3 #141

Open
Frosty-STI opened this issue Apr 25, 2024 · 0 comments
Open

UART 1 Doesn't transmit/receive - WiFi LoRa32 V3 #141

Frosty-STI opened this issue Apr 25, 2024 · 0 comments

Comments

@Frosty-STI
Copy link

Hi, I'm following the example Serial2.ino, and I've slightly modified it to allow one of my V3s to be a transmitter, and one to be a receiver. I am neither transmitting nor receiving, however. How am I supposed to access UART1 on pins 2/17??

Sender code:
/*

  • Heltec Automation ESP32 Serial 1 & 2 example.
  • shows the usage of all 3 hardware uarts
  • work with ESP32's IO MUX
  • to test the software and hardware
  • wire Rx1 to Tx1 and Rx2 to Tx2
  • type text in serial monitor
  • text will walk trough all 2 serials
  • result is echoed to serial (usb)
    */

void setup() {
Serial.begin(115200);

// Serial1.begin(unsigned long baud, uint32_t config, int8_t rxPin, int8_t txPin, bool invert)
// Serial2.begin(unsigned long baud, uint32_t config, int8_t rxPin, int8_t txPin, bool invert)
// The txPin & rxPin can set to any output pin

Serial1.begin(115200, SERIAL_8N1, 2, 17);
// Serial2.begin(115200, SERIAL_8N1, 22, 23);
}

void loop() {
//Serial.println("Serial not online");
delay(5000);
if(Serial1.available()) {

Serial1.write(8);
for(int i = 0; i<30;i++){
  Serial.println("DEVICE FOUND");

}

}

// if(Serial2.available()) {
// int ch = Serial2.read();
// Serial2.write(ch);
// }

// if(Serial2.available()) {
// int ch = Serial2.read();
// Serial.write(ch);
// }
}

Receiver code:
/*

  • Heltec Automation ESP32 Serial 1 & 2 example.
  • shows the usage of all 3 hardware uarts
  • work with ESP32's IO MUX
  • to test the software and hardware
  • wire Rx1 to Tx1 and Rx2 to Tx2
  • type text in serial monitor
  • text will walk trough all 2 serials
  • result is echoed to serial (usb)
    */

void setup() {
Serial.begin(115200);

// Serial1.begin(unsigned long baud, uint32_t config, int8_t rxPin, int8_t txPin, bool invert)
// Serial2.begin(unsigned long baud, uint32_t config, int8_t rxPin, int8_t txPin, bool invert)
// The txPin & rxPin can set to any output pin

Serial1.begin(115200, SERIAL_8N1, 2, 17);
// Serial2.begin(115200, SERIAL_8N1, 22, 23);
}

void loop() {
//Serial.println("Serial not online");
delay(5000);
if(Serial1.available()) {
int ch = Serial.read();
for(int i = 0; i<100; i++)
Serial.print(ch);
}

if(Serial2.available()) {
int ch = Serial2.read();
Serial2.write(ch);
}

if(Serial2.available()) {
int ch = Serial2.read();
Serial.write(ch);
}
}

Any help is appreciated, thank you!!!!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant