Install Sqlite3:

opkg update
opkg install sqlite3-cli
sqlite3 /mnt/sda1/sensor.db
sqlite> CREATE TABLE sensor_data(
    id INTEGER PRIMARY KEY,
    temperature VARCHAR(64),
    sqlitetimestamp DATETIME DEFAULT CURRENT_TIMESTAMP
);
sqlite> INSERT INTO sensor_data (temperature) VALUES (30);
sqlite> INSERT INTO sensor_data (temperature) VALUES (40);
sqlite> select * from sensor_data;
sqlite>.quit

sqlitetimestamp DATETIME DEFAULT CURRENT_TIMESTAMP, will auto CURRENT_TIMESTAMP.

Comments powered by CComment