The RNT guide using SD Cards is very useful –
https://randomnerdtutorials.com/esp32-microsd-card-arduino/
However, I am unclear how to read/write the contents of a text file in order to send the data line-by-line via MQTT.
Any help is appreciated!
1 Answers
Hi.
The code knows it reached the end of a line when it encounter the expression “\n”.
So, you need to cut the string in the “\n”.
Take a look at the example provided in this discussion: https://stackoverflow.com/questions/70365647/reading-line-by-line-in-arduino-ide
I hope this helps.
Regards,
Sara