Skip to content

Commit eaeadb8

Browse files
committed
Update readme
1 parent 55db4c3 commit eaeadb8

File tree

7 files changed

+640
-15
lines changed

7 files changed

+640
-15
lines changed

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,8 @@ Makefile
99
*.def
1010
*.exe
1111
*.db
12+
*.jpg
13+
*.jpeg
1214
a.out
1315
ulog_sqlite
1416
test_ulog_sqlite

README.md

Lines changed: 30 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,30 +1,49 @@
1-
# Sqlite µLogger
1+
# Sqlite µLogger for Arduino
22

3-
Lean and Mean Sqlite Data(base) Logger
3+
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.
44

5-
## This library hosts both a C library and an Arduino library.
5+
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.
6+
7+
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.
8+
9+
![](banner.png?raw=true)
610

711
# Features
812

9-
- Memory requirement: `page_size` + some stack
10-
- "Finalize" is optional
13+
- Low Memory requirement: `page_size` + some stack
1114
- Can log using Arduino UNO (2kb RAM) with 512kb page size
12-
- Can do binary search on RowID or Timestamp without any index
15+
- Can do quick binary search on RowID or Timestamp without any index in logarithmic time
1316
- Recovery possible in case of power failure
1417
- Rolling logs are possible (not implemented yet)
1518
- Can use any media using any IO library/API or even network filesystem
16-
- DMA writes possible
19+
- DMA writes possible (not shown)
20+
- Virtually any board and any media can be used as IO is done through callback functions.
21+
22+
# Getting started
23+
24+
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.
25+
26+
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.
27+
28+
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.
29+
30+
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.
1731

1832
# Ensuring integrity
1933

20-
During finalize:
21-
- If Sqlite format 3 and checksum matches, then all ok
22-
- If header checksum does not match, re-build header from leaf pages
23-
- If leaf page checksum does not match, discard it (optional?)
34+
If there is power failure during logging, the data can be recovered using `Recover database` option in the menu.
2435

2536
# Limitations
2637

38+
Following are limitations of this library:
39+
2740
- Only one table per Sqlite database
2841
- Length of table script limited to (`page size` - 100) bytes
42+
- `Select`, `Insert` are not supported. Instead C API similar to that of Sqlite API is available.
2943
- Index creation and lookup not possible (as of now)
3044

45+
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.
46+
47+
# Support
48+
49+
If you find any issues, please create an issue here or contact the author (Arundale Ramanathan) at arun@siara.cc.

banner.png

572 KB
Loading

examples/ESP32_Console/ESP32_Console.ino

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -344,7 +344,7 @@ void display_row(struct dblog_read_context *ctx) {
344344
}
345345

346346
void input_db_name() {
347-
displayPrompt("DB name: "));
347+
displayPrompt("DB name: ");
348348
input_string(filename, sizeof(filename));
349349
}
350350

0 commit comments

Comments
 (0)