

- #How to install sqlite on flash drive update
- #How to install sqlite on flash drive upgrade
- #How to install sqlite on flash drive software
Make sure both these files (“ DB_Ini.py” and “ Table_Schema.sql“) are in same directory on Raspberry Pi. As per your requirements, you can change the “ DB_NAME” variable in this script. Once you have your SQL file ready, create a Python Script with following code. INSERT INTO StdSensorTypes (SensorCode, SensorType) VALUES ("s3", "Door-Windows Sensor") Ĭreate Python Script to Initialise SQLite DB – INSERT INTO StdSensorTypes (SensorCode, SensorType) VALUES ("s2", "Light Sensor: LDR") INSERT INTO StdSensorTypes (SensorCode, SensorType) VALUES ("s1", "Pressure Sensor: BMP180") INSERT INTO StdSensorTypes (SensorCode, SensorType) VALUES ("s0", "Temperature and Humidity Sensor: DHT22")

Save this file as “ Table_Schema.sql” on your Raspberry Pi. This method can be very useful if you need to change your DB Schema frequently (for ex during initial development phase) or want to create the same DB on multiple systems (for ex during code distribution or testing).Ĭreate SQL File with Table Definition and Base Data –įollowing is an example of SQL file. You can use Python Script to initialise your SQLite DB. SQLite shell can also be terminated using “.exit” command – sqlite> You can terminate the sqlite3 program by typing your system End-Of-File character (usually a Control-D). You can list the Table data using following query – SELECT * FROM Įxample: sqlite> drop table if exists sensors Sqlite> insert into sensors (sensor_ID, sensor_Name) values (2,"Temperature") ) Įxample: sqlite> insert into sensors (sensor_ID, sensor_Name) values (1,"Light Sensor") You can insert Data into your table using following command – INSERT INTO (. ) Įxample: sqlite> create table sensors (sensor_ID integer, sensor_Name text) You can create DB Table using following command – CREATE TABLE (. You can create SQLite DB from Raspbian CLI interface using following command – sqlite3 With this, you have SQLite installed on your Raspberry Pi and its ready for use. Install SQLite3 using following command – sudo apt-get install sqlite3
#How to install sqlite on flash drive upgrade
Upgrade Raspberry Pi Packages – sudo apt-get upgrade 2.
#How to install sqlite on flash drive update
Update Raspberry Pi packages – sudo apt-get update Update and Upgrade Raspberry Pi packages: So let’s explore how to install and use SQLite on Raspberry Pi – 1. On top of this, it is free for use for any purpose. SQLite suits well for IoT Devices as it is self-contained, serverless, and requires no configuration. It doesn’t require a separate server process and allows accessing the database using a nonstandard variant of the SQL query language.

SQLite is an embedded SQL database engine that provides a lightweight disk-based database. Hack Single Bay WD My Cloud NAS Drive to Create NFS Share for VMware vCenter Datastore.Raspberry Pi Cluster for Docker Containers.Setup Docker on Raspberry Pi and Run hello-world Container.Basics of Containers, Docker, and Container Orchestration.Device Shadows – Part 3 (RESTful API Based Prototype using Python).Device Shadows – Part 2 (MQTT Based Prototype using Python and Raspberry Pi).Device Shadows – Part 1 (MQTT Topics and REST APIs).MQTT with AWS IoT Platform using Python and Paho.MQTT Based Shutdown Button for WD My Cloud.Storing MQTT Data from Sensors into SQL Database.Post a Tweet on Twitter from Raspberry Pi using Python Script.Send Email from Raspberry Pi using Python Script and Gmail SMTP.Python Flask Web Application on Raspberry Pi with NGINX and uWSGI.
#How to install sqlite on flash drive software
Open Source Tools for IoT Software Applications.Wireless Networking Technologies for IoT.
