-
Notifications
You must be signed in to change notification settings - Fork 257
Dustcloud Raspberry Pi Installation
JackGruber edited this page Jun 1, 2018
·
20 revisions
Tested on RASPBIAN STRETCH WITH DESKTOP https://www.raspberrypi.org/downloads/raspbian/
Dustloud works with php7. Php5 is no longer available in Rasbpbian Stretch. If you still want to use php5, you can use the following instructions. Otherwise skip this step.
PHP 5 Version
First of all you need to add the repo for php5 jessie, stretch doesn't support php5 anymore.
- echo 'deb http://mirrordirector.raspbian.org/raspbian/ jessie main contrib non-free rpi' >> /etc/apt/sources.list
- apt-get update && apt-get upgrade -y
- apt-get install apache2 php php5-mysqlnd mysql-server python3 python3-pip git
Raspbian stretch:
- sudo apt-get install apache2 php php-mysqli mysql-server python3 python3-pip git php-mbstring php-phar php-json
Both versions:
- sed -i -e 's/Listen 80/Listen 81/g' /etc/apache2/ports.conf
- sed -i -e 's/:80>/:81>/g' /etc/apache2/sites-enabled/000-default.conf
- pip3 install pymysql python-miio pillow bottle
- git clone --depth=1 https://github.com/dgiese/dustcloud.git
- cd dustcloud/dustcloud
- mysql -e "CREATE USER 'dustcloud'@'localhost' IDENTIFIED by 'dustcloudpw';"
- mysql -e "GRANT USAGE ON *.* TO 'dustcloud'@'localhost';"
- mysql -e "CREATE DATABASE IF NOT EXISTS dustcloud;"
- mysql -e "GRANT ALL PRIVILEGES ON dustcloud.* TO 'dustcloud'@'localhost';"
- cat dustcloud.sql | mysql dustcloud
- mkdir /var/www/html/dustcloud
- cp www/* /var/www/html/dustcloud/
- mv /var/www/html/dustcloud/conf.sample.php /var/www/html/dustcloud/conf.php
- sed -i -e 's/user123/dustcloud/g' /var/www/html/dustcloud/conf.php
- sed -i -e "s/'password' => '',/'password' => 'dustcloudpw',/g" /var/www/html/dustcloud/conf.php
- cd /var/www/html/dustcloud/
- curl https://raw.githubusercontent.com/composer/getcomposer.org/master/web/installer | php --
- php composer.phar install
- sed -i -e 's/pymysql.connect("localhost","dustcloud","","dustcloud")/pymysql.connect("localhost","dustcloud","dustcloudpw","dustcloud")/g' server.py
- sed -i -e 's/my_cloudserver_ip = "10.0.0.1"/my_cloudserver_ip = "123.123.123.123"/g' server.py
-
chmod +x server.sh
-
mkdir /dustcloud
-
cp server.* /dustcloud/
-
cp build_map.py /dustcloud/
-
a2enmod rewrite
- setcap CAP_NET_BIND_SERVICE=+eip /usr/bin/python3.5
Method 2: do a iptables port redirection for port 80 to 5080 (need to run server.py with -sport 5080)
- iptables -t nat -A PREROUTING -i eth0 -p tcp --dport 80 -j REDIRECT --to-port 5080
Navigation
- Home
- Vacuum Robots
- Lumi Aqara Camera (experimental)
- Lumi Aqara Gateway (new Version, without Homekit)
- Documentation
- Dustcloud