SD Card file write

166 views
Skip to first unread message

Max May

unread,
Jan 22, 2021, 12:39:24 AM1/22/21
to Annex WiFi RDS
Hallo,
is there any possibility or example for writing, reading or append a file to a SD Card with Annex32. I want to build a datalogger and I love the Annex Wifi RDS
Thank you in advance for your help.

Max

cicciocb

unread,
Jan 22, 2021, 5:01:12 AM1/22/21
to Annex WiFi RDS
Hi,
yes it is possible to connect an SDCARD to the ESP32 to create a data logger very easily.

You can find all the information in the documentation

Max May

unread,
Jan 22, 2021, 7:14:21 AM1/22/21
to Annex WiFi RDS
Hallo cicciob,
thank you for your answer, but what are the commands that a can use to store data on the card?
Did you have an example to append a line of data to a file or start a new file on the sd card?
For example a temperatur from a DS 18B20 Temperature Sensors every second or something like that.
Thank you in advance.

Max

PeterN

unread,
Jan 22, 2021, 9:13:28 AM1/22/21
to Annex WiFi RDS
Take a look at the chapter "FAT32 File System" in the help file. I think that answers all of your questions.

Good luck

ciccio cb

unread,
Jan 22, 2021, 10:29:27 AM1/22/21
to Annex WiFi RDS
Hi Max,
this is a little data logger example using the serial port (the default ) at the standard speed 115200.

You can eventually set the serial speed with the command
SERIAL.MODE 
or use the 2nd serial port defining freely the TX and the RX pins


CODE: logger.bas

'data logger example
'
' define the log file name
fn$ = "/mylog.txt"  ' defi

onserial serial_received
wait

serial_received:
'waits 50 msec in order to receive more bytes
'as the event is very fast
pause 50
a$ = serial.input$
file.append fn$, a$
return



--
You received this message because you are subscribed to the Google Groups "Annex WiFi RDS" group.
To unsubscribe from this group and stop receiving emails from it, send an email to annex_wifi_rd...@googlegroups.com.
To view this discussion on the web, visit https://groups.google.com/d/msgid/annex_wifi_rds/2efd527e-1f6f-4451-a2ae-cb70efefe7d4n%40googlegroups.com.

Max May

unread,
Jan 22, 2021, 6:30:44 PM1/22/21
to Annex WiFi RDS
Hallo PeterN and cicciocb,
both answers helps me lot, thank you very mutch for that.
I am a newby to the annex Wifi RDS and maybe it sounds like a stupid question, how do I select where I write the file, to the internal FATFS or the external SD CARD?
Sorry for this new question.

Max
To unsubscribe from this group and stop receiving emails from it, send an email to annex_w...@googlegroups.com.

ciccio cb

unread,
Jan 22, 2021, 7:00:11 PM1/22/21
to Annex WiFi RDS
Hi Max
The functions are the same for both internal FATFS or SD CARD.

If an SD CARD is detected when the module boots, the file system is automatically selected to the SD CARD otherwise the internal is selected.
They are mutually exclusive and cannot be used at the same time


To unsubscribe from this group and stop receiving emails from it, send an email to annex_wifi_rd...@googlegroups.com.
To view this discussion on the web, visit https://groups.google.com/d/msgid/annex_wifi_rds/172530b4-b696-4df9-ae48-f44666ae103ao%40googlegroups.com.

Max May

unread,
Jan 23, 2021, 2:52:53 PM1/23/21
to Annex WiFi RDS
Thank you very much for your help

Timothy Truckle

unread,
Jan 25, 2021, 2:03:45 AM1/25/21
to Annex WiFi RDS
Hi, cicciocb, PeterN,

how can i determine if the sd card is activated when booting the esp32? 

Regards

Peter

Am Samstag, 23. Januar 2021 01:00:11 UTC+1 schrieb cicciocb:

ciccio cb

unread,
Jan 25, 2021, 2:19:21 AM1/25/21
to Annex WiFi RDS
Hi,
There is no special function for that but you could check the free space available on the disk. 

Cicciocb
To unsubscribe from this group and stop receiving emails from it, send an email to annex_wifi_rds+unsubscribe@googlegroups.com.
To view this discussion on the web, visit https://groups.google.com/d/msgid/annex_wifi_rds/47356405-cca0-4b9c-be1a-b709aa3008f3o%40googlegroups.com.

Timothy Truckle

unread,
Jan 25, 2021, 3:46:59 AM1/25/21
to Annex WiFi RDS
THX
Hi,
Cicciocb

Timothy Truckle

unread,
Jan 25, 2021, 11:47:12 AM1/25/21
to Annex WiFi RDS
Small update: The SD card works on a Heltec ESP32 Lora. The culprit was a solder joint that was not soldered correctly. The file manager now shows approx. 4000000 bytes. It would be interesting to be able to use the Lora and BT functions :-)
Regards Peter


Am Montag, 25. Januar 2021 08:19:21 UTC+1 schrieb cicciocb:
Hi,
Cicciocb
Reply all
Reply to author
Forward
0 new messages