All Projects → siara-cc → sqlite_micro_logger_arduino

siara-cc / sqlite_micro_logger_arduino

Licence: Apache-2.0 license
Fast and Lean Sqlite database logger for Microcontrollers

Programming Languages

c
50402 projects - #5 most used programming language

Projects that are alternatives of or similar to sqlite micro logger arduino

Arduino
🚀 Proyectos de todo tipo para arduino utilizando sus sensores y actuadores. 🤖
Stars: ✭ 27 (-78.91%)
Mutual labels:  arduino-library, arduino-nano, arduino-uno, arduino-mega
PsxNewLib
Playstation controller interface library for Arduino
Stars: ✭ 81 (-36.72%)
Mutual labels:  arduino-library, arduino-nano, arduino-uno, arduino-mega
ATM90E32
Updated version of the ATM90E32 Arduino library
Stars: ✭ 22 (-82.81%)
Mutual labels:  arduino-library, esp8266-arduino, esp32-arduino
LibreCO2
Simple CO2 meter using Arduino UNO-Mega board and popular CO2 sensors (SenseAir S8, Sensirion SCD30, Winsen MH-Z14 or 19 and Cubic CM1106). Operation modes: Normal, Calibration 400ppm, Alarm adjust and Altitud compensation adjust
Stars: ✭ 31 (-75.78%)
Mutual labels:  arduino-nano, arduino-uno, arduino-mega
ESP32Partitions
No description or website provided.
Stars: ✭ 30 (-76.56%)
Mutual labels:  esp8266-arduino, esp32-arduino
ESP32Time
An Arduino library for setting and retrieving internal RTC time on ESP32 boards
Stars: ✭ 120 (-6.25%)
Mutual labels:  arduino-library, esp32-arduino
RxLogs
An Android & Kotlin Reactive Advanced Logging Framework.
Stars: ✭ 12 (-90.62%)
Mutual labels:  logger, logging-library
scd30
arduino esp8266 ESP8266 SCD30 SCD-30 ESP32
Stars: ✭ 38 (-70.31%)
Mutual labels:  arduino-library, arduino-mega
ESPAsyncE131
Asynchronous E1.31 (sACN) library for Arduino ESP8266 and ESP32
Stars: ✭ 97 (-24.22%)
Mutual labels:  esp8266-arduino, esp32-arduino
l
Cross-platform html/io [L]ogger with simple API.
Stars: ✭ 26 (-79.69%)
Mutual labels:  logger, logging-library
clue
a extremely high performance log library for android. 高性能的Android日志库
Stars: ✭ 27 (-78.91%)
Mutual labels:  logger, logging-library
JJSwiftLog
Swift log library for all platform
Stars: ✭ 51 (-60.16%)
Mutual labels:  logger, logging-library
esp arduino sqlite3 lib
Sqlite3 library for ESP8266 Arduino core
Stars: ✭ 78 (-39.06%)
Mutual labels:  arduino-library, esp8266-arduino
EmbUI
Embedded WebUI Interface
Stars: ✭ 46 (-64.06%)
Mutual labels:  esp8266-arduino, esp32-arduino
EM7180 SENtral Calibration
Get the best AHRS accuracy out of the Tlera USFS with good sensor calibration
Stars: ✭ 22 (-82.81%)
Mutual labels:  teensy36, esp32-arduino
Syslog
An Arduino library for logging to Syslog server in IETF format (RFC 5424) and BSD format (RFC 3164)
Stars: ✭ 105 (-17.97%)
Mutual labels:  arduino-library, arduino-uno
noodlog
🍜 Parametrized JSON logging library in Golang which lets you obfuscate sensitive data and marshal any kind of content.
Stars: ✭ 42 (-67.19%)
Mutual labels:  logger, logging-library
Somfy Remote
Somfy remote control emulator connected to MQTT
Stars: ✭ 19 (-85.16%)
Mutual labels:  esp8266-arduino, esp32-arduino
LogDNA-Android-Client
Android client for LogDNA
Stars: ✭ 22 (-82.81%)
Mutual labels:  logger, logging-library
esp-homekit-arduino-sdk
Arduino wrapper for ESP-IDF HomeKit library
Stars: ✭ 34 (-73.44%)
Mutual labels:  arduino-library, esp32-arduino

Sqlite µLogger for Arduino

Sqlite µLogger is a Fast and Lean database logger that can log data into Sqlite databases even with SRAM as low as 2kb as in an Arduino Uno. The source code can be ported to use with any Microcontroller having at least 2kb RAM.

The library can also be used to retrieve logged data. Apart from retrieving row by row, it can also locate a record using Row ID. If timestamp is logged, any record can be looked up using binary search on timestamp in O(log n) time, which is not possible when logging to text files or using any other logger (even desktop loggers).

This repo is an Arduino library that can work with Arduino Uno board or any Arduino board that has minimum 2kb RAM and a SD Shield attached.

It has been tested with Arduino Uno with SparkFun MicroSD Shield, WeMos ESP8266 D1 Mini with WeMos MicroSD Shield and ESP32 SD_MMC breakout board.

Features

  • Low Memory requirement: page_size + some stack
  • Can log using Arduino UNO (2kb RAM) with 512 bytes page size
  • Can do quick binary search on RowID or Timestamp without any index in logarithmic time
  • Recovery possible in case of power failure
  • Rolling logs are possible (not implemented yet)
  • Can use any media using any IO library/API or even network filesystem
  • DMA writes possible (not shown)
  • Virtually any board and any media can be used as IO is done through callback functions.

Getting started

The example Uno_and_above shows how data read from Analog pins can be stored along with Timestamp into Sqlite database and retrieved by RowId.

Records can also be located using Timestamp in logarithmic time by doing a Binary Search on the data logged. This is not possible using conventional loggers.

For example, locating any record in a 70 MB db having 1 million records on Arduino UNO with SparkFun microSD Shield took only 1.6 seconds.

The examples ESP8266_Console and ESP32_Console can be used to log and retrieve from ESP8266 and ESP32 boards respectively on Micro SD and SPIFFS filesystems.

API

For finding out how the logger works and a complete description of API visit Sqlite Micro Logger C Library.

Ensuring integrity

If there is power failure during logging, the data can be recovered using Recover database option in the menu.

Examples

Arduino Uno

This screenshot shows how analog data can be logged and retrieved using Arduino Uno and Sparkfun Micro SD Shield:

This screenshot shows how binary search can be performed on the timestamp field:

ESP8266

This screenshot shows how analog data can be logged and retrieved using ESP8266 (WeMos D1 Mini and Micro SD Shield):

This screenshot shows how binary search can be performed on the timestamp field using ESP8266:

ESP32

This screenshot shows how analog data can be logged and retrieved using ESP32 breakout board having a Micro SD Slot on the SD_MMC port:

This screenshot shows how binary search can be performed on the timestamp field using ESP32:

Limitations

Following are limitations of this library:

  • Only one table per Sqlite database
  • Length of table script limited to (page size - 100) bytes
  • Select, Insert are not supported. Instead C API similar to that of Sqlite API is available.
  • Index creation and lookup not possible (as of now)

However, the database created can be copied to a desktop PC and further operations such as index creation and summarization can be carried out from there as though its a regular Sqlite database. But after doing so, it may not be possible to use it with this library any longer.

Future plans

  • Index creation when finalizing a database
  • Allow modification of records
  • Rolling logs
  • Show how this library can be used in a multi-core, multi-threaded environment

Support

If you find any issues, please create an issue here or contact the author (Arundale Ramanathan) at [email protected].

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].