This project attempts to be a pure PHP server solution for the open source display at https://github.com/caedm/wall-ink.
- Clone/download source code
- Create MySQL database, schema, and tables
- Install and configure Apache with PHP
- Install dependencies by running composer install
- Create wall ink server configuration
- Configure wall ink hardware
- Visit admin page to configure layout and source
You will need to either clone this repository or download a ZIP of it.
Extract or clone to the directory you will use as your web server root.
In my examples, I will be using /opt/wink
.
bob$ sudo -i
root$ yum install -y epel-release
root$ yum install -y git wget zip unzip
root$ mkdir -p /opt/wink
root$ chown bob:bob /opt/wink
root$ exit
bob$ cd /opt/wink
bob$ git clone https://github.com/bajensen/wall-ink-php.git .
- MySQL >= 5.6
- If you already have a MySQL installation, you must be able to create users and databases.
- Open your favorite MySQL management console and create a new user/password combination.
- Create a new database (schema)
- Grant access for your new database to your new user
- Execute the SQL found in
docs/schema.sql
to create the proper database tables
Install MySQL, enable its service, and secure it. Source for these instructions is https://www.linode.com/docs/databases/mysql/how-to-install-mysql-on-centos-7/
bob$ wget http://repo.mysql.com/mysql-community-release-el7-5.noarch.rpm
bob$ sudo rpm -ivh mysql-community-release-el7-5.noarch.rpm
bob$ sudo -i
root$ yum install -y mysql-server
root$ systemctl enable --now mysql.service
root$ mysql_secure_installation
Create user and database.
bob$ mysql -u root -p
MySQL> CREATE USER 'wink'@'%' IDENTIFIED BY 'super secret password';
MySQL> CREATE DATABASE wink;
MySQL> GRANT ALL PRIVILEGES ON wink.* TO 'wink'@'%';
MySQL> FLUSH PRIVILEGES;
MySQL> QUIT;
Populate the the database with the proper tables.
bob$ cd /opt/wink
bob$ mysql -u root -p wink < docs/schema.sql
This step depends on what operating system and distribution you are using. Please find instructions online for your environment, but make sure to satisfy the requirements given below.
- PHP >= 5.6 (7.1 or higher recommended)
- PHP Extension: JSON
- PHP Extension: PDO
- PHP Extension: PDO for MySQL
- PHP Extension: ImageMagick (Imagick)
- Apache >= 2.4
- Proper TCP port for HTTP open (usually 80 unless you use a custom port)
Source for these instructions is https://webtatic.com/packages/php72/
bob$ sudo -i
root$ yum install -y epel-release
root$ rpm -Uvh https://mirror.webtatic.com/yum/el7/webtatic-release.rpm
root$ yum install -y httpd mod_php72w php72w-cli php72w-pdo php72w-pecl-imagick php72w-mysql
root$ cp docs/apache-development.conf /etc/httpd/conf.d/wink.conf
root$ systemctl enable --now httpd
Allow acceess through OS firewall
root$ firewall-cmd --add-service=http --permanent
root$ firewall-cmd --reload
Now open a browser and navigate to your server's hostname. If everything is installed and configured correctly, you should get a page that says
Autoload file not found. Run composer install.
Follow the instructions at https://getcomposer.org/download/ to install composer
Now install the PHP dependencies by running this command:
bob$ php composer.phar install
Navigate to your server's hostname in a browser again. You should now see an error like this:
Slim Application Error
The application could not run because of the following error:
Details
Type: PDOException
Message: invalid data source name
File: /opt/wink/src/Wink/DB/PDO.php
Line: 12
This means we are ready for the next step.
Copy the sample development configuration file config/config.development.example.php
to config/config.development.php
and update the settings to their proper values.
Try refreshing your browser. It should now show a header and blank device table.
Congrats! We are almost there!!!
bob$ cd /opt/wink
bob$ cp config/config.development.example.php config/config.development.php
bob$ vi config/config.development.php
Follow the instructions at https://github.com/caedm/wall-ink/wiki/Admin-mode to configure the hardware settings.
Wireless SSID0: MiWiFi
Password0: MiWiFiPass
Wireless SSID1: MiWiFi2
Password1: MiWiFiPass
Base URL: http://wink.example.com/display
Image Key: hunter2
Debug Mode: Off
Once the display connects, it will create a record for the display in the database.
In your browser, navigate to your server's address and you should get the admin page. Click the device and pick the settings you want to operate with!
Everything should be up and ready to go!!!!!
For more information on developing custom layouts and sources, see DEVEL.md
.