1/26/2024 0 Comments Sqlitemanager raspbian![]() You can make your home automation with Raspberry Pi 4. Raspberry Pi 4 is powerful hardware with low power. – Make your home automation with PHP CLI mode If you don’t know about Raspberry Pi 4 or IoT device. – Improve security for your Raspberry Pi with SSL If you like this post probably you might like my next ones, so please support me by subscribing my blog.Raspberry Pi 4 Workshop for you IoT with PHP CLI mode you can create your own Server and IoT at home easy to control your IoT device with the simple script from PHP. Like home automation? Learn more about Node-RED, Raspberry Pi, ESP8266 and Arduino with my course: Build a Home Automation System for $100.ĭo you have any questions? Leave a comment down below! In the next blog post, we will publish sensor readings with the ESP8266 that will be stored in the database and displayed in your Python web server. We’ve just scratched the surface of what you can do with SQLite. The real advantage of using phpLiteAdmin is: instead of sending SQL commands through a terminal window, you can add, remove, update all data through a nice user interface. Then, you could define the data columns for each row: Select the Create new table option and give it a name, for example outputs: You can see the settings of each column and you can change them if necessary. ![]() On the left menu, you can see your database and table (if you’ve used the database created in the previous tutorial). Open your This is how it should look like:Įnter your password to login and this is the web page that loads: Run the following commands: $ cd $ sudo chmod 777 $ sudo chmod 777 $ sudo chown root:root $ sudo chown root:root database/*Īfter running the preceding commands, confirm that root is the owner and those are the permissions for the database folder: $ ls -lĭrwxrwxrwx 2 root root 4096 Jan 30 15:11 database Testing phpLiteAdmin In order to make phpLiteAdmin work properly you need to change some permissions and files ownership. You can use the file created in the previous tutorial or simply create a new one: $ sqlite3 sensordata.db ![]() Type a unique password and the path to your SQLite database: To set a password and the path to your SQLite database in your phpLiteAdmin configuration, this is what you need to do: $ sudo cp $ sudo nano Ĭhange your file to look similar to mine (see below). While on the /var/www/html directory, create a new folder called database: $ sudo mkdir $ cd $įollow the next command to download and prepare phpLiteAdmin: $ sudo $ sudo $ sudo rm phpLiteAdmin_v1-9-7-1.zip Now, you can remove the index.php file: $ sudo rm index.php Installing phpLiteAdmin Go to your Raspberry Pi IP address (use the command ifconfig to print your Pi IP address in your terminal window) and this is what you should see: Restart Apache2 service for the changes to take effect: $ sudo service apache2 restart Testing your installationĬreate a new PHP file with the name index.php: $ sudo nano index.phpĬopy the next line to your index.php file: Ĭtrl+X, type Y and press Enter to save your changes. Before: index.html index.phpĬtrl+X, type Y and press Enter to save your changes. Move to your /var/Make the next change to the file. To install PHP and its modules, type in this command: $ sudo apt-get install php5 libapache2-mod-php5 php5-sqlite -y You also need to install PHP which is an open source web scripting language that is used to build dynamic web applications. Enter the next command: $ sudo apt-get install apache2 -y You need to install Apache2 in your Raspberry, Apache is used to serve your web pages. You also need to have SQLite installed in your Raspberry Pi. After the installation is completed, the SQLite libraries are supplied with an SQLite shell. ![]() You can read my Getting Started with the Raspberry Pi Guide to install Raspbian and complete the basic setup. You can install SQLite on a Raspberry Pi using this command: piraspberry: sudo apt-get install sqlite3 You’ll have to type Y and press Enter to confirm the installation. Basic Raspberry Pi setupīefore you continue reading this project, make sure you have Raspbian Operating System installed in your Raspberry Pi. In this blog post I’ll introduce you to phpLiteAdmin which is a web-based user interface written in PHP that makes it easy to interact with SQLite databases.ĭon’t have a Raspberry Pi board? read Best Raspberry Pi Starter Kits.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |