Hi peeps,
I’m brand new here, having joined to see how to solve how to configure my ESP32 to receive data from an external device outputting either SPI or UART data (either – I don’t mind).
I have not been able to locate an example of this anywhere.
Any tips?
Hi.
I think this is one of the simplest examples showing how to read data via serial on the ESP32: https://www.programmingboss.com/2021/04/esp32-arduino-serial-communication-with-code.html
The data is being sent from an Arduino, but it can be any other device.
I hope this helps.
Regards,
Sara
Thanks Sara,
That simple! I’m so used to lower level embedded programming, that I have been hung up on “how do I configure interrupts to read the incoming stream byte-by-byte whilst building a string”, etc.etc., forgetting that the Arduino environment handles that at an abstract level for us!
I’ll give this a whirl when I get home this evening :).
Much appreciated.
No luck – but it is a hardware thing I think.
The ESP32 I bought was the DUINOTECH ESP32 from a supplier called JAYCAR who stock ARDUINO-ready modules.
On careful inspection (hours of research) I discovered it has only ONE serial port…. which is shared between GPIO1/3 AND the USB serial monitor. I scoped it and all serial signals appear in both places all the time.
So it seems this ESP module cannot provide a serial port while it is busy being debugged from ARDUINO.
I’m really disappointed – a big hold up now, while I try to source a proper module!