Closed dani9084 closed 8 months ago
Please use 3 backticks at begin and end of the code, each on a single line.
The single backtick is for inline code like this
.
Also which pins do you use for Serial2?
I'm using pin 16 and 17. According to the pinout its RX2 and TX2.
For ESP32 you better give the pins you use to the begin argument or call setPins
before calling Serial2.begin()
Here the function signature for setPins
// Negative Pin Number will keep it unmodified, thus this function can set individual pins
// setPins() can be called after or before begin()
// When pins are changed, it will detach the previous ones
bool setPins(int8_t rxPin, int8_t txPin, int8_t ctsPin = -1, int8_t rtsPin = -1);
Here for begin
// When pins are changed, it will detach the previous ones
// if pin is negative, it won't be set/changed and will be kept as is
// timeout_ms is used in baudrate detection (ESP32, ESP32S2 only)
// invert will invert RX/TX polarity
// rxfifo_full_thrhd if the UART Flow Control Threshold in the UART FIFO (max 127)
void begin(unsigned long baud, uint32_t config=SERIAL_8N1, int8_t rxPin=-1, int8_t txPin=-1, bool invert=false, unsigned long timeout_ms = 20000UL, uint8_t rxfifo_full_thrhd = 112);
So you can pick either one you like best.
Solved it. Apparently it wasn't getting a clear enough signal, even though the LED was blinking on the board. I put the module outside and I'm getting readings from the module. Thank you for the help and sorry for waisting your time.
Hello, I am facing an interesting problem using a neo 6m gps module and 2 ESP32 boards. I am trying to run this example code:
I've tried the code on 2 different ESP32 boards, tried switching TX and RX cables on both, but nothing seems to work. I only get INVALID in the serial port.