GithubHelp home page GithubHelp logo

siara-cc / sqlite_micro_logger_arduino Goto Github PK

View Code? Open in Web Editor NEW
164.0 15.0 29.0 4.33 MB

Fast and Lean Sqlite database logger for Arduino UNO and above

License: Apache License 2.0

C 100.00%
sqlite arduino-library arduino-uno arduino-nano esp8266-arduino esp32-arduino teensy36 stm32f103 arduino-mega database-logging

sqlite_micro_logger_arduino's People

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

sqlite_micro_logger_arduino's Issues

Does this library support LittleFS?

Using this library on ESP32 I am able to write to both, however with LittleFS, the file size of the database seems to grow much larger than SPIFFS.

Each row contains 38 byte of data. And I am inserting rows until row id 62.

On SPIFFS the file size is 6506 bytes, on LittleFS the file size is 19456 bytes. Ideally I'd like to use LittleFS on account of the fact that SPIFFS is EOL, but those file sizes are prohibitive when using a partition on the ESP flash.

How to use it with ESP8266

Hi Arun,

Thank you for creating excellent Database for micro controllers. I am working on small standalone IOT network and I was looking for local data storage solution for my project. I have 1 master esp8266 device collecting sensor data from multiple slave esp8266 devices and I would like to store these data to spiffs on master device.The data received by master from each slave is always a 6 byte array.There are always 3 arrays received from each slave device within 60 milliseconds. The array received is in following order & format:

array 1 - Sensor Types
Format - {36:06:16:26:36:46} where 36 is slave device ID and 06 means sensor type is voltage,16
means sensor type is temperature, 26 means sensor type is humidity and so on.

array 2 - sensor values
Format - {36:33:70:55:925:60} where 36 is slave device ID and 33 is voltage(3.3V),70 is teperature in
F, 55 is humidity inpercentage etc.

array 3 - device status
Format - {36:36:07:05:01:60} where 36 is slave device ID and 36 is last byte of device IP,07 is wifi
channel number, 05 is sleep time for slave device etc.

My code is at following links:

Master - https://github.com/happytm/BatteryNode/blob/master/ProbeReceiver.ino
Slave - https://github.com/happytm/BatteryNode/blob/master/ProbeSender.ino

My goal is to store all these data in spiffs by device ID and time it is received by master device.

I tried to figure out how to implement this but was not successful.

Also I wanted to overwrite spiffs data file when it is almost full (3 MB).

Please help me.

Thanks

Example throws `DBLOG_RES_READ_ERR` for sdfat

Running Uno-and-above-sdfat on the MKR WiFi 1010 with an sd-card breakout hooked up to pin 7 as CS, always returns DBLOG_RES_READ_ERR or better -7 (plus my clock adjustments)

When i recover the DB it seems that the write was successful, but it's not good, if it throws errors and a recover is required after each write.

(Tried SdFat version 2.0.6 and 1.1.4 (Here the timestamp-parsing behaved weird as well ๐Ÿคช) in case the recent changes f'd it up ... but no difference)

dblog_write_init overwrites all data

Does this library support re-opening the database without destroying existing data?? When i use dblog_write_init all the data in existing databse are removed, am i doing something wrong?

FATFS SUPPORT?

Trying to use this with Texas instruments TIVA C and FatFs
Is there an example with FatFs?

VACUUM-like database cleaning possible?

First of all, thank you for providing this library! It's almost exactly what I'm looking for, but one thing I couldn't find out is how to deal with deleting log rows that are older than a certain amount of days and at the same time freeing the space taken up by these entries, much like the DELETE and VACUUM statements in sqlite3.
Or is there any other way I could deal with the fact that I just want x days worth of data in the database without creating new database files every x days?

ARM SAMD M0 & SdFat require reduced clock

Error

When using the sdfat sample the code reports failure until you decrease the clock speed of the SD card.
This is an issue discussed here as well.

Testing

My board: Arduino MKR Wifi 1010
Example: Uno_and_above_SdFat

Fix

changing l.435 in Uno_and_above_SdFat.ino
from
if (!SD.begin(SD_CS_PIN)) {
to
if (!SD.begin(SD_CS_PIN, SD_SCK_MHZ(12))) {
fixed it for me.

Further details

The SdFat-QuickStart even uses only 4 MHz .

esp32 sqlite insert varible in table

rc = db_exec(db1, "INSERT INTO test1 VALUES (1,1);");
by this insert 1(hardcoded) in column in table but,
int i=4;
how to insert variable i in table

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.