Raspberry Notes 2

Install / Upgrade Node-RED

bash <(curl -sL https://raw.githubusercontent.com/node-red/raspbian-deb-package/master/resources/update-nodejs-and-nodered)

Install Node-RED-Dashboard

cd ~/.node-red

sudo npm install node-red-dashboard

sudo apt-get install libavahi-compat-libdnssd-dev

npm install node-red-contrib-homekit-bridged

npm install node-red-node-mysql

sudo reboot

Install HAP-NodeJS

sudo npm config set registry http://registry.npmjs.org/

sudo npm install -g node-gyp

git clone https://github.com/KhaosT/HAP-NodeJS.git

cd HAP-NodeJS

npm rebuild

npm install

To run the service: 

node Core.js

Install nginx

sudo apt-get install nginx

Add php support: 

sudo apt-get install php-fpm

cd /etc/nginx

sudo nano sites-enabled/default

find the line with "index index.html index.htm;"

index index.php index.html index.htm;

uncomment the following lines:

location ~ \.php$ {

    include snippets/fastcgi-php.conf;

    fastcgi_pass unix:/var/run/php5-fpm.sock;

}

the modified lines should be like these:

# pass the PHP scripts to FastCGI server listening on 127.0.0.1:9000

#

location ~ \.php$ {

    include snippets/fastcgi-php.conf;

    # With php5-cgi alone:

    # fastcgi_pass 127.0.0.1:9000;

    # With php5-fpm:

    fastcgi_pass unix:/var/run/php5-fpm.sock;

}

sudo /etc/init.d/nginx reload

Install mysql

sudo apt-get install mysql-server

sudo mysql_secure_installation

> Use default settings

to login

mysql -u root -p

resetting a lost MySQL root password

http://www.cnblogs.com/xiaojikuaipao/p/mysql_password.html

sudo /etc/init.d/mysql stop

sudo mysqld_safe --skip-grant-tables &

mysql -u root

use mysql;

update user set password=PASSWORD("mynewpassword") where User='root';

flush privileges;

sudo /etc/init.d/mysql stop

sudo /etc/init.d/mysql start

add/delete a user

https://www.cnblogs.com/wanghetao/p/3806888.html

To login remotely, set Host to "%" (original value is "localhost")

if interactions with mysql in python is required, 

sudo apt-get install python-mysqldb

if PHPMyAdmin is required,

sudo apt-get install phpmyadmin

> Select apache2 even if NGINX is used

> Select yes at the next prompt

sudo ln -s /usr/share/phpmyadmin /var/www/html

Install Mosquitto

wget http://repo.mosquitto.org/debian/mosquitto-repo.gpg.key

sudo apt-key add mosquitto-repo.gpg.key

cd /etc/apt/sources.list.d/

sudo wget http://repo.mosquitto.org/debian/mosquitto-stretch.list

sudo apt-get install mosquitto

sudo apt-get install mosquitto-clients

config

sudo nano /etc/mosquitto/mosquitto.conf

allow_anonymous false

password_file /etc/mosquitto/passwordfile

add a user choi with password lanseyujie [note: -c means create a new password file]

sudo mosquitto_passwd -c /etc/mosquitto/passwordfile choi

sudo mosquitto_passwd /etc/mosquitto/passwordfile choi

Install FTP

sudo apt-get install -y vsftpd

sudo nano /etc/vsftpd.conf

local_enable=YES

write_enable=YES

anonymous_enable=NO

local_umask=022

local_root=/

sudo service vsftpd restart

最后编辑于
©著作权归作者所有,转载或内容合作请联系作者
平台声明:文章内容(如有图片或视频亦包括在内)由作者上传并发布,文章内容仅代表作者本人观点,简书系信息发布平台,仅提供信息存储服务。

推荐阅读更多精彩内容

  • Getting Started Use the Current Stable Version (7.1) Buil...
    Leonzai阅读 1,977评论 0 3
  • 之前,在其他平台上我分享了如何运用树莓派,结合Home Assistant、Homebridge、Kodi搭建Ho...
    cxlwill阅读 11,496评论 3 64
  • 矛盾 虚伪 贪婪 欺骗 幻想 疑惑 简单 善变 好强 无奈 孤独 脆弱 忍让 气忿 复杂 讨厌 嫉妒 阴险 争夺 ...
    喜欢孤独灬阅读 505评论 0 3
  • 一年四季都要防晒,防晒功课做的有问题,会引发各种肌肤疑问。相信这个道理大家都知道,可就是不去涂,你们能天天涂防晒的...
    天籁岛学化妆阅读 1,178评论 0 1
  • 东皋薄暮,逢杏花微雨,珠帘半掩。恋草惜花春分至,更待风和日丽。少不明韵,赋词说愁,笑轻狂滋味。锦书遥寄,为谁泛起涟...
    A蓝雨阅读 465评论 0 1