SmartESP VEGA smart home server
The server SmartESP VEGA can be used in the following variants:
- Local - local own server
- Enterprise - cloud public server
- Personal - cloud private server
If you choose the option Local, you will need to purchase or build a separate computer on which you can also install the SmartESP VEGA server yourself. You will find more information about this in the documentation: Connecting to a local server. The option Local is available free of charge! However, to receive project notifications and to update the controllers remotely, you will need to register in the Personal area.
Example for local installation of the SmartESP VEGA server
Let's assume that you already have a home server with a Linux family operating system, e.g. you can use Ubuntu 20.04 LTS.
- Prepare the directories:
- Create a new directory, which will be the main directory for the project:
$ mkdir /var/smartesp
- Create a directory for the database:
$ mkdir /var/smartesp/db
- Set up configuration files:
- Navigate to the working directory of the project:
$ cd /var/smartesp
- Create and edit the file
config.ini
with the following contents (You can use the command:nano config.ini
):; Code page
CHARSET = "UTF-8"
; Database
DB_HOST_NAME = "db"
DB_NAME = "smartesp_db"
DB_USER_NAME = "smartesp_user"
DB_USER_PASS = "smartesp_pass"
; Secret key to restrict calling of the special cron-scripts
MASTER_KEY = "master_key"
; User registration secret key (allow all if empty)
REGISTER_KEY = ""
; Log retention period with full report, days
SAVE_LOG_PERIOD = 2
; Retention period for the summarized report archive, days
SAVE_ARCHIVE_PERIOD = 1000 - Create and edit the file
docker-compose.yml
with the following contents (you can use the command:nano docker-compose.yml
):version: '3'
services:
db:
image: mysql:5.7
environment:
MYSQL_ROOT_PASSWORD: mysql_passkey
MYSQL_DATABASE: smartesp_db
MYSQL_USER: smartesp_user
MYSQL_PASSWORD: smartesp_pass
volumes:
- /var/smartesp/db:/var/lib/mysql
restart: always
web:
depends_on:
- db
image: smartesp/smartesp-vega:stable
volumes:
- /var/smartesp/config.ini:/var/www/html/config.ini
ports: - 80:80
restart: always - Install and start the container:
- Make sure you have installed Docker Engine and Docker Compose
- Download the server image: docker:/smartesp/smartesp-vega:
$ docker pull smartesp/smartesp-vega:stable
- Run your docker container and related services in the background:
$ docker-compose up -d
- Configure Task Scheduler. open the current user's cron table with the command:
$ crontab -e
and add the following tasks:3 0 * * * * * /usr/bin/wget -O /dev/null -T 10 -t 1 http://192.168.XXX.XXX/cron/service/master_key/
is the IP address of your server on the local network.
* * * * * * * /usr/bin/wget -O /dev/null -T 59 -t 1 http://192.168.XXX.XXX/cron/auto/master_key/ 192.168.XXX.XXX
In case you need to stop and update or restart the container, you can do it as follows:$ docker-compose down
$ docker pull smartesp/smartesp-vega:stable
$ docker-compose up -d
After starting the container, it takes some time to create the database, so when you open the site, an error may appear Connection refused