From 4214666a7fbccc73cc644fbd495439cffa59243b Mon Sep 17 00:00:00 2001 From: Junior Date: Tue, 14 Nov 2023 11:08:22 -0500 Subject: [PATCH] Add instructions for initializing database --- README.md | 24 +++++++++++++++++++++++- 1 file changed, 23 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 6c2b009..aad9803 100644 --- a/README.md +++ b/README.md @@ -2,6 +2,28 @@ This project is a simple web interface for managing "JAJ LED Controllers". JAJ LED Controllers are custom analog LED strip driver boards which use a WiFi connected microcontroller (ESP8266 for now) to drive analog 12v RGB LED strip lights. +## Installation + +The hardware "LEDChooser" device uses a database to store named color patterns. + +### Create Database and Grant Permissions + +While logged into the SQL database as root... + +```sql +create database ledcolors; +create user 'ledcolors'@'localhost' identified by 'mypassword'; +grant all privileges on ledcolors.* to 'ledcolors'@'localhost'; +flush privileges; +``` + +* Note that the "localhost" reference above should be changed to reflect the local environment if a remote database is used. +* The "mypassword" reference is a password chosen for the application and will need to be set in the configuration file. + ## Configuration -The only configuration parameter which likely needs to be customized for the local environment is the __LEDADDRESS__ parameter. This should be the broadcast address for the local network since the system uses broadcast UDP packets to send messages to attached controllers. +The __config.php__ file should be customized for the local environment. The following settings should receive particular focus: + +* __LEDADDRESS__: This should be set to the broadcast address for the local network. +* __DBHOST__: If a remote database is used this must be set appropriately. +* __DBPASS__: This is the password selected in the "Create Database..." section above.