Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

How do I.. SD card using example please (GIT8266O-835) #1259

Open
erosenst opened this issue Oct 31, 2023 · 0 comments
Open

How do I.. SD card using example please (GIT8266O-835) #1259

erosenst opened this issue Oct 31, 2023 · 0 comments

Comments

@erosenst
Copy link

  • Development Kit: Wemos D1
  • IDF version (git rev-parse --short HEAD
    ~/esp$ git rev-parse --short HEAD ESP8266_RTOS_SDK/
    fatal: not a git repository (or any of the parent directories): .git
    ~/esp$ git rev-parse --short xtensa-lx106-elf
    fatal: not a git repository (or any of the parent directories): .git
    (done with git clone, about ~2weeks ago)
  • Development Env: nano, make
  • Operating System: Ubuntu 18.04
  • Power Supply: USB

Problem Description

Hello, bought week ago esp8266 board and like to do datalogger from it with external SD card. Hardware:

  • Wemos D1
  • Deek-Robot ID:8122 (SPI (buffered?) micro SD slot, + I2C RTC)
  • generic 433Mhz board to get(/set) sensor data
  • SSD1306 I2C ~1" oled display (128x32)

I got 433Mhz listening work with timer1. (It need some fix in timer sources to correct some registry problem, was somewhere in github issues). Timer1 seems to run lot faster in FreeRTOS than arduino even 255_div. Basically good for accurate timing. (maybe you fix timer registry problem here too, someone may like it already done in SDK..?)

Now I need to write data to SD card. I use chip select line IO:2 because builtin led to see when card active. Similiar code work in arduino. SD-card filesystem may be FAT, but better if crash tolerant like LittleFS, but files may present lot and 32GB (or more) card may use.
MD5 sum from data files is good too, same data may appear many time, so no need save all..
RTC example with internal rtc / external I2C RTC with NTP update..?

Problem: can't find any example how to use SD-card in esp8266 with FreeRTOS. Can you provide simple mount/umount example with write/del file, mkdir/rmdir and check file present/not, fsync?

//Detailed problem description goes here.
Google lot, but nothing usable and some relative pages seems to porn sites..

Expected Behavior

examples/ dir should contain ready to use external SD-card example..

Actual Behavior

No findable examples with google / SDK. However sdfat.h seems present..

Steps to repropduce

git clone and look examples dir..

// It helps if you attach a picture of your setup/wiring here.

SPI:
D13 (15) MOSI
D12 (12) MISO
D1 (14) SCK
and D9 (2) to SS
I2C: D5 SCL, D4 SDA

Code to reproduce this issue

ls examples/ | grep sd

@github-actions github-actions bot changed the title How do I.. SD card using example please How do I.. SD card using example please (GIT8266O-835) Oct 31, 2023
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant