November 08, 2024, 08:20:25 AM

ESP32-PoE-ISO UART1 issue

Started by ninousf, September 16, 2020, 06:01:14 PM

Previous topic - Next topic

ninousf

hello
by looking at the GPIO map, i saw that UART1 is available in UEXT connector:
 * GPIO4-U1TXD
 * GPIO36-U1RXD

Unforutnatly, i did not succeed to use it.

Is there an hardware issue because if i look at the ESP32-WROOM-32D datasheet, the UART1 is not on the same GPIOs:
 * GPIO10-U1TXD
 * GPIO9-U1RXD

thanks
 

LubOlimex

#1
Redefine the UART to the UEXT pins GPIO4 and GPI36.

If you are using Arduino for ESP32 and you have properly installed and selected ESP32-PoE-ISO from the board selector - there are already macros RX1 and TX1. Just use RX1 and TX1 in the code. Here are the definitions:

https://github.com/espressif/arduino-esp32/blob/1.0.4/variants/esp32-poe-iso/pins_arduino.h

Remember, as an espressif employee once said:

"The first rule of ESP32 is use any pin you want! (Sort of)"

Source:

https://www.esp32.com/viewtopic.php?t=11233#p45646
Technical support and documentation manager at Olimex

_AndreaS_

I have the same issue. I'm trying to use the second serial as follow:

voisd setup()
{
  Serial.begin(115200);
  Serial1.begin(9600, SERIAL_8N1, RX1, TX1, false);
}
void loop()
{
  Serial1.write("mycommand\n");
  delay(5); // wait the remote board to answer

  while (Serial1.available())
  {
    Serial.print(Serial1.read());
  }

  delay(100);
}

I see with my oscilloscope both tx and rx signals at the GPIO pin of ESP32-POE module, but nothing is printed on the debug `Serial`.

I put a pull-up resistor on GPI36 (even if it's driven by the transceiver).
Is there something else I should do in order to receive?

LubOlimex

Are you using the Olimex JSON package? Have you selected ESP32-POE from the board selector?

If you use our Olimex JSON pakcage, for ESP32-POE serial #2 pins are set as follow RX - GPIO35 and TX - GPIO33, you can find them at EXT2 connector. In your code use RX2 and TX2 macro (I see you use RX1 and TX1... this is serial 1 available at the UEXT - GPIO4 and GPI36).

Refer to the definitions here: https://github.com/espressif/arduino-esp32/blob/1.0.4/variants/esp32-poe/pins_arduino.h
Technical support and documentation manager at Olimex