{"id":21810886,"url":"https://github.com/vshymanskyy/preferences","last_synced_at":"2026-03-17T18:37:21.786Z","repository":{"id":123132062,"uuid":"498717170","full_name":"vshymanskyy/Preferences","owner":"vshymanskyy","description":"Preferences library for Arduino, ESP8266, RP2040, Particle, Realtek Ameba","archived":false,"fork":false,"pushed_at":"2025-10-23T17:44:44.000Z","size":46,"stargazers_count":96,"open_issues_count":1,"forks_count":17,"subscribers_count":4,"default_branch":"main","last_synced_at":"2025-10-23T19:35:07.053Z","etag":null,"topics":["arduino","config","configuration","embedded","settings","storage"],"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/vshymanskyy.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}},"created_at":"2022-06-01T11:57:15.000Z","updated_at":"2025-10-23T17:44:48.000Z","dependencies_parsed_at":"2024-11-27T13:38:39.108Z","dependency_job_id":"71c8379b-47f0-4ab4-81e7-d1a4613d36a7","html_url":"https://github.com/vshymanskyy/Preferences","commit_stats":null,"previous_names":[],"tags_count":3,"template":false,"template_full_name":null,"purl":"pkg:github/vshymanskyy/Preferences","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vshymanskyy%2FPreferences","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vshymanskyy%2FPreferences/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vshymanskyy%2FPreferences/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vshymanskyy%2FPreferences/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/vshymanskyy","download_url":"https://codeload.github.com/vshymanskyy/Preferences/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vshymanskyy%2FPreferences/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":30628426,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-03-17T17:32:55.572Z","status":"ssl_error","status_checked_at":"2026-03-17T17:32:38.732Z","response_time":56,"last_error":"SSL_read: 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":["arduino","config","configuration","embedded","settings","storage"],"created_at":"2024-11-27T13:38:31.647Z","updated_at":"2026-03-17T18:37:21.776Z","avatar_url":"https://github.com/vshymanskyy.png","language":"C","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Preferences\n\n[![Arduino Library Manager](https://img.shields.io/static/v1?label=Arduino\u0026message=v2.2.2\u0026logo=arduino\u0026logoColor=white\u0026color=blue)](https://www.ardu-badge.com/Preferences)\n[![PlatformIO Registry](https://badges.registry.platformio.org/packages/vshymanskyy/library/Preferences.svg)](https://registry.platformio.org/packages/libraries/vshymanskyy/Preferences) \n\nProvides **ESP32**-compatible **Preferences** API for a wider variety of platforms:\n- **ESP8266** using LittleFS\n- **RP2040** boards with [Pico core](https://github.com/earlephilhower/arduino-pico)\n- **Realtek** boards with [Ameba Arduino SDK](https://github.com/ambiot/ambd_arduino)\n- Arduino **Nano 33 IoT, MKR1010, MKR VIDOR** using WiFiNINA storage\n- Particle: **Muon, Photon 2, Argon, Boron, Xenon, Tracker, BSOM, MSOM, P2**\n\nAvailable from: [`Arduino Library Manager`](https://www.arduino.cc/reference/en/libraries/preferences), [`PlatformIO`](https://registry.platformio.org/libraries/vshymanskyy/Preferences), [`Particle Build`](https://build.particle.io/libs/Preferences)\n\n[![Stand With Ukraine](https://raw.githubusercontent.com/vshymanskyy/StandWithUkraine/main/banner-direct-single.svg)](https://stand-with-ukraine.pp.ua)\n\n## How does it work?\n\n```cpp\n#include \u003cPreferences.h\u003e\nPreferences prefs;\n\nvoid setup() {\n  Serial.begin(115200);\n  prefs.begin(\"my-app\");\n\n  int counter = prefs.getInt(\"counter\", 1); // default to 1\n  Serial.print(\"Reboot count: \");\n  Serial.println(counter);\n  counter++;\n  prefs.putInt(\"counter\", counter);\n}\n\nvoid loop() {}\n```\n\nPreferences are stored in the internal flash filesystem in a bunch of `/nvs/{namespace}/{property}` files.  \nFilesystem should handle flash wearing, bad sectors and atomic `rename` file operation.\n- `LittleFS` handles all that, so this is the default FS driver for ESP8266. `SPIFFS` use is possible, but it is discouraged.\n- Particle Gen3 devices also operate on a built-in `LittleFS` filesystem.\n- Arduino Nano and MKR devices use the storage of the U-blox NINA module.\n\n## API\n\nCheck out ESP32 [Preferences library](https://espressif-docs.readthedocs-hosted.com/projects/arduino-esp32/en/latest/api/preferences.html) API.\nDifferences:\n- `partition_label` argument is not supported in `begin()`\n- `getType()` and `freeEntries()` methods are not supported (returning dummy values)\n- `putBytes()` and `putString()` allow writing empty values (length = 0)\n- `put*()` and `get*()` operations **don't fail** if the existing value has a different type\n\n\u003e [!IMPORTANT]\n\u003e Keys are ASCII strings. The maximum key length is **15 characters**\n\n## Known issues\n\n- `clear()` is not working on Arduino Nano 33 IoT, MKR1010, MKR VIDOR. This cannot be implemented, as WiFiNINA storage doesn't provide any API to remove or enumerate directories ([along with other bugs](https://github.com/arduino-libraries/WiFiNINA/issues/created_by/vshymanskyy)). If you need to clear a namespace on these devices, you'll have to erase each key individually using `remove()`.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fvshymanskyy%2Fpreferences","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fvshymanskyy%2Fpreferences","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fvshymanskyy%2Fpreferences/lists"}