- My goal is:
Reading gsm data from gps module (UART) into ESP32 DEVKIT C with WROOM-32 Module - My actions are:
My connections:
- GND on GPS to GND on ESP32
- VCC on GPS to 3v3 on ESP32
- RX on GPS to Pin 16 (GPIO16) UART2 TX2 port on ESP32
- TX on GPS to Pin 17 (GPIO17) UART2 RX2 port on ESP32
(Went out doors and got both LEDS (on GPS and ESP32) ON
My code:
load('api_uart.js');
let uartNo = 2; // UART1
// Configure UART
UART.setConfig(uartNo, {
baudRate: 9600,
tx_gpio: -1,
rx_gpio: 17,
});
// Set UART event handler
UART.setDispatcher(uartNo, function(uartNo, data) {
// Process or print the received data
print('GPS DATA: ', data);
}, null);
// Enable UART receiver
UART.setRxEnabled(uartNo, true);
Built the code and flashed it onto the microcontroller
Result: GPSDATA: null
3. The result I see is:
Result: GPSDATA: Some GSM Data atleast
4. My expectation & question is:
What is wrong with my process… What is the right way yo do this?
Diagram: