UART receiving and processing text lines - not bytes

Edgar1
Posts: 6
Joined: Fri Oct 11, 2019 7:53 am

UART receiving and processing text lines - not bytes

Postby Edgar1 » Wed Dec 11, 2019 8:11 am

I connected an Arduino with an ESP32 with the UARTs.
I looked at the ESP-IDF API and examples and I see how bytes can be send and received.
I am sure I could use this also to send and receive text - with some extra work.
But maybe there is an easier way to do this and this is what I am asking here.

My existing ESP32 project logs lots of data to a SD-Card.
The file on the SD-Card is a typical log file which looks like this:
Millies, Value1, Value2, Value3
00055467, 100, 300, abc
00055510, 98, 305, def

Now I want to send information from the Arduino to the ESP32 which should be logged in the same way.
My idea is to send a text line like this "50, 70"
And that should be added to the existing log lines like this:
Millies, Value1, Value2, Value3, Adruino1, Adruino2
00055467, 100, 300, abc
00055510, 98, 305, def, 50, 70

The data from the Arduino will be a lot less than the ESP32 data so the lines will contain maybe only the ESP values or the ESP values and the Arduino values added to the end. It will never happen that the incoming data has more lines then the internal log data.

Is there and easy way in the ESP-IDF to receive text strings?
If not, does anybody know example code to analyze the incoming bytes to extract the text lines?

Who is online

Users browsing this forum: Google [Bot] and 111 guests