Server SmartESP VEGA

SmartESP VEGA server, have two variants: cloud — Enterprise and own — Local. The Enterprise option doesn't require any complex actions on your part; it's already set up on our server and ready to use. If you opt for the Local server, in this case, you'll need a home computer on which the special SmartESP VEGA server is installed using Docker container technology. Let's assume you already have a local server with a Linux-family OS installed, like Ubuntu 20.04 LTS, for example.

The SmartESP VEGA server is available for free! However, to receive notifications from projects and remotely update the controller firmware, registration is required.

  1. Preparation of Directories:
    • Create a new directory at the path /var/smartesp, which will become the main directory for the project: 
      $ mkdir /var/smartesp
    • Create the db directory inside /var/smartesp for the database:
      $ mkdir /var/smartesp/db
  2. Setting up configuration files:
    • Go to the project's working directory:
      $ cd /var/smartesp
    • Create and edit the config.ini file with the following content (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
      ; Retention period for the summarized report archive, days
    • Create and edit the docker-compose.yml file with the following content (you can use the command: nano docker-compose.yml):
    • version: '3'
          image: mysql:5.7
            MYSQL_ROOT_PASSWORD: mysql_passkey
            MYSQL_DATABASE: smartesp_db
            MYSQL_USER: smartesp_user
            MYSQL_PASSWORD: smartesp_pass
            - /var/smartesp/db:/var/lib/mysql
          restart: always
            - db
          image: smartesp/smartesp-vega:stable
            - /var/smartesp/config.ini:/var/www/html/config.ini
          ports:       - 80:80
          restart: always
  3. Installation and container launch:
    • Ensure you have Docker Engine and Docker Compose installed.
    • Download the Docker image of the SmartESP VEGA server:
      $ docker pull smartesp/smartesp-vega:stable
    • Start your Docker container and its associated services in the background:
      $ docker-compose up -d
  4. Task scheduler setup. Open the cron table of the current user 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/
    * * * * *  /usr/bin/wget -O /dev/null -T 59 -t 1 http://192.168.XXX.XXX/cron/auto/master_key/
    192.168.XXX.XXX — is the IP address of your server on the local network.

If you need to stop, update, or restart the container, you can do so as follows:
$ docker-compose down
$ docker pull smartesp/smartesp-vega:stable
$ docker-compose up -d

Attention! After starting the container, some time is required to create the database, so when opening the site, a Connection refused error may occur.