{"id":24352635,"url":"https://github.com/mxv3a/cyclic-data-log","last_synced_at":"2026-04-23T06:33:27.445Z","repository":{"id":268727401,"uuid":"905228486","full_name":"MXV3A/Cyclic-Data-Log","owner":"MXV3A","description":"Log custom data in flash memory on ESP32, STM32, and BW16","archived":false,"fork":false,"pushed_at":"2025-03-03T13:10:33.000Z","size":47,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-08-19T05:44:54.372Z","etag":null,"topics":["bw16","eeprom","esp32","logger","stm32"],"latest_commit_sha":null,"homepage":"","language":"C++","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/MXV3A.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2024-12-18T12:11:26.000Z","updated_at":"2025-03-03T13:10:37.000Z","dependencies_parsed_at":null,"dependency_job_id":"d6850905-f557-458e-a692-96eb5f478e81","html_url":"https://github.com/MXV3A/Cyclic-Data-Log","commit_stats":null,"previous_names":["mxv3a/esp32-data-log","mxv3a/cyclic-data-log"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/MXV3A/Cyclic-Data-Log","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MXV3A%2FCyclic-Data-Log","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MXV3A%2FCyclic-Data-Log/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MXV3A%2FCyclic-Data-Log/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MXV3A%2FCyclic-Data-Log/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/MXV3A","download_url":"https://codeload.github.com/MXV3A/Cyclic-Data-Log/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MXV3A%2FCyclic-Data-Log/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":32169657,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-23T02:19:40.750Z","status":"ssl_error","status_checked_at":"2026-04-23T02:17:55.737Z","response_time":53,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["bw16","eeprom","esp32","logger","stm32"],"created_at":"2025-01-18T15:55:59.691Z","updated_at":"2026-04-23T06:33:27.422Z","avatar_url":"https://github.com/MXV3A.png","language":"C++","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Cyclic-Data-Log\nLog custom data in persistent memory.  \nUsed to log sensor data for diagnosing problems in case of a crash, or for saving settings while keeping past settings as fallback.  \nThis Library is written for and tested on ESP32 (Espressif), STM32 (STMicroelectronics), and BW16 (AmebaD).\n\n## Installation\nDownload or Clone this repository and pull the folder into the Arduino libraries folder or use the 'Add .ZIP Libraries' function in the ArduinoIDE.  \n\n## Using the Log\n\n### 1 - Describe the data to be logged\n```c\nstruct Entry{\n    int timestamp;\n    int sensor1;\n    int sensor2;\n};\n```\n\n### 2 - Create a Log\n```c\nDataLog\u003cEntry\u003e log;\n``` \n\n### 3 - Add an Entry\n```c\nEntry newentry = {time(NULL), analogRead(GPIO_NUM_4), 25};\nlog.addEntry(\u0026newentry); \n```\nThe log adds the entry to the persistent memory and remembers all entries even after a reset. If the log is full the oldest entry will be overwritten.\n\n### 4 - Read an Entry \n```c\nEntry readentry;\nlog.readEntry(-1, \u0026readentry);\n```\nWith 0 being the oldest entry, -1 the newest entry.\n\n### 5 - Full Program\n```c\n#include \u003cDataLog.h\u003e\n\nstruct Entry{\n    int timestamp;\n    int sensor1;\n    int sensor2;\n};\n\nvoid setup(){\n    Serial.begin(115200);\n    pinMode(GPIO_NUM_4, INPUT);\n\n    DataLog\u003cEntry\u003e log;\n\n    Entry readentry;\n    if(log.readEntry(-1, \u0026readentry) != -1){\n        Serial.println(\"Logged Sensor Value: \"+String(readentry.sensor1));\n    }\n\n    Entry newentry = {time(NULL), analogRead(GPIO_NUM_4), 25};\n    log.addEntry(\u0026newentry);\n\n    delay(10000);\n    ESP.restart();\n}\n\nvoid loop(){}\n```\n(For other microcontrollers see examples)\n\n##  If EEPROM is also used by another Library\n\nGo into \u003cb\u003eDataLog.h\u003c/b\u003e and edit the following Macros\n```c\n//Change to Full Size of EEPROM in use\n//If EEPROM range is used but not covered by this number it will be erased\n#define EEPROM_MAX_SIZE 4096\n\n//Change to start and end of where the data log should be.\n//Memory outside this area is not touched by the library\n#define LOG_START_ADDRESS 0\n#define LOG_END_ADDRESS EEPROM_MAX_SIZE\n```\n### Example\nFor EEPROM memory with this intended layout:  \n\n![EEPROM Layout](doc/EEPROM_Layout2.png)  \n  \nChange Macros to these numbers:  \n```c\n#define EEPROM_MAX_SIZE 1024\n#define LOG_START_ADDRESS 256\n#define LOG_END_ADDRESS 768\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmxv3a%2Fcyclic-data-log","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmxv3a%2Fcyclic-data-log","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmxv3a%2Fcyclic-data-log/lists"}