1、安装sox系统mp3音频播放模块(项目需要)

sudo apt-get install lame

sudo apt-get install sox

sudo apt-get install libsox-fmt-mp3

2、安装百度语音合成SDK(项目需要)

sudo pip install baidu-aip

3、安装 Nginx 和 PHP7

树莓派最新的系统(我用的版本:2018-04-18-raspbian-stretch.img)已经抛弃了对php5的支持,所以只能安装php7。

sudo apt-get update

sudo apt-get install nginx php7.0-fpm php7.0-cli php7.0-curl php7.0-gd php7.0-mcrypt php7.0-cgi

sudo service nginx start

sudo service php7.0-fpm restart

如果安装成功,可通过 http://树莓派IP 访问到 Nginx 的默认页,Nginx 的根目录在 /var/www/html。

4、Nginx默认是没有开启php的支持,需要进行配置

sudo nano /etc/nginx/sites-available/default

默认内容如下:

location /{#First attempt to serve request as file, then

#as directory, then fall back to displaying a 404.

try_files $uri $uri/ =404;

}

修改为以下内容:

location /{

index index.html index.htm index.php default.html default.htm default.php;

}

location~\.php$ {

fastcgi_pass unix:/run/php/php7.0-fpm.sock;#fastcgi_pass 127.0.0.1:9000;

fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;

include fastcgi_params;

}

Ctrl + O 保存再 Ctrl + X 退出。

5、重启服务即可

sudo service nginx restart

以上步骤在树莓派3B Raspbian Stretch 系统版本上测试通过。

6、Pi Dashboard控制面板安装(监控树莓派的运行状况)

sudo apt-get install git

cd /var/www/html

sudo git clone https://github.com/spoonysonny/pi-dashboard.git

即可通过 http://树莓派IP/pi-dashboard 访问部署好了的 Pi Dashboard。

同样如果页面无法显示,可以尝试在树莓派终端给源码添加运行权限,例如你上传之后的路径是 /var/www/html/pi-dashboard,则运行。

cd /var/www/html

sudo chown -R www-data pi-dashboard

7、安装Beautiful Soup 4

sudo pip install beautifulsoup4

Logo

魔乐社区(Modelers.cn) 是一个中立、公益的人工智能社区,提供人工智能工具、模型、数据的托管、展示与应用协同服务,为人工智能开发及爱好者搭建开放的学习交流平台。社区通过理事会方式运作,由全产业链共同建设、共同运营、共同享有,推动国产AI生态繁荣发展。

更多推荐