本帖最后由 qinth 于 2013-4-16 03:52 编辑
AEP—Anywhere eat Raspberry Pi, 是我的毕业设计,原设计理念只在于用安卓手机控制树莓派(Android Eat Raspberry Pi)。
现在基本完成了命令行段设计和初步的图形端设计(由于运行速度原因只可以当成监控桌面使用)。在此发布测试,希望大家多多支持,由于服务器本身是树莓派,会存在一定延迟,建议大家采用安装在自己树莓派方式运行。
项目地址:http://www.aepwiki.tk/
备用地址:http://www.aepwiki.cz.cc/
感谢shamiao ukonline2000 还有打望两江的支持!
命令行模式使用方法:
首先在树莓派上安装OpenSSH, Raspbian上已经安装了,只需要用户打开就可以运行.安装命令行为- sudo apt-get install openssh-server ssh
复制代码 打开网站然后登陆:
http://www.aep.cz.cc/
如果你将自己建立服务器在树莓派上(安装过程在后面),那么登陆网址是你的Ip地址加上端口号以及文件夹名字,例如你的树莓派内网Ip地址是 192.168.1.100.那么登陆网页地址就是:
http://192.168.1.100:8080/AEPweb
当你进入网站成功你会看到安全登陆界面:
在这里的用户名和密码为.
在这里使用安全登陆界面是为了防止服务器被攻击……手段略低端,请忽略……
成功登陆以后你会见到使用界面,就和正常使用Ssh登陆方法一样即可。
在这个页面中选项为:
- Host - IP or DDNS Address of your Raspberry Pi
- Port - SSH Port which default setting is 22.
- Username - The Root user name for your Raspberry Pi.In Raspbian default setting is pi.
- Authentication Type - Choose User use password or key file to Login.
- Password - If user choose password login, user need enter password.
- Key file & Key Passphrase -If user choose key file to Login,user need upload.
- Channel Type - User can choose Shell(Command Line) or File to Control Raspberry Pi.
这里基本大家可以了解 我就不写成中文了……
这个软件可以选择命令行模式和文件夹模式,
命令行模式可以和Ssh一样输入命令控制树莓派,请注意Sudo的使用。
文件夹模式可以上传和删除你的树莓派文件夹内的文件。
本身有一段视频是演示用此界面控制U大写的GPIO 控制Led跑马灯效果的,我发在油土鳖上,晚些时候传到国内网上吧。
上面就是一些基本的使用教程,如果你想安装此软件在你的树莓派上和使用动态域名,下面我会简单的介绍一下。
1.1 配置服务器运行环境- sudo apt-get install openjdk-7-jdk
复制代码 此时你的JDK会被安装在此目录下- /usr/lib/jvm/java-7-openjdk-armhf
复制代码 用命令行检查一下你的JDK安装信息你会得到如此反馈- java version “1.7.0_07″
- OpenJDK Runtime Environment (IcedTea7 2.3.2) (7u7-2.3.2a-1+rpi1)
- OpenJDK Zero VM (build 22.0-b10, mixed mode)
复制代码 1.2 安装Apache Tomcat服务器
官方软件库本身自带,但是我更推荐自己下载后安装,因为功能上更适合,跟着步骤做就可以了……
First Download Tomcat 7 from the Homepage. There are command to download tomcat 7.0.37 in /download Directory. - cd downloadwget <a href="http://mirror.ox.ac.uk/sites/rsync.apache.org/tomcat/tomcat-7/v7.0.37/bin/apache-tomcat-7.0.37.tar.gz" target="_blank">http://mirror.ox.ac.uk/sites/rsy ... omcat-7.0.37.tar.gz</a>
复制代码 Move And UnzipMove package to location and unzip it. - sudo mv apache-tomcat-7.0.37/ /usr/local/tomcatsudo tar -zxvf apache-tomcat-7.0.37.tar.gz
复制代码 Set Up Tomcat User And GroupIn this part, user need set up tomcat as web server in Raspberry Pi. - sudo groupadd tomcatsudo useradd -g tomcat -d /usr/local/tomcat tomcatsudo usermod -G www-data tomcat
复制代码 INIT File
This is INIT File for start, stop and restart for Tomcat, it would need use the Java Development Kit path, there user can use nano or vim to edit it.- sudo nano /etc/init.d/tomcat
复制代码when user open finished create init file, in put follow information in it: - #Tomcat auto-start
- #description: Auto-starts tomcat
- #processname: tomcat
- #pidfile: /var/run/tomcat.pid
- #this path should point to your JAVA_HOME Directory
- export JAVA_HOME=/usr/lib/jvm/java-7-openjdk-armhf
- case $1 in
- start)
- sh /usr/local/tomcat/bin/startup.sh
- ;;
- stop)
- sh /usr/local/tomcat/bin/shutdown.sh
- ;;
- restart)
- sh /usr/local/tomcat/bin/shutdown.sh
- sh /usr/local/tomcat/bin/startup.sh
- ;;
- esac
- exit 0
复制代码Adjust Permissions the INIT file use follow line: - chmod 755 /etc/init.d/tomcat
复制代码 Auto-start on bootThere is an optional for user, if you want always use AEP when you Raspberry Pi boot, please write this line: - sudo update-rc.d tomcat defaults
复制代码 Now, you can start your tomcat 7 server.- sudo /etc/init.d/tomcat start
复制代码 Administrator Privileges
When you want to use your tomcat server you should get Administrator privileges from, hence there you should edit tomcat-users.xml.- sudo nano /usr/local/tomcat/conf/tomcat-users.xml
复制代码Now,you should add a manager in this field.Red font is user should add. - <tomcat-users>
- <!--
- NOTE: By default, no user is included in the "manager-gui" role required
- to operate the "/manager/html" web application. If you wish to use this app,y
- ou must define such a user - the username and password are arbitrary.
- -->
- <!--
- NOTE: The sample user and role entries below are wrapped in a comment
- and thus are ignored when reading this file. Do not forget to remove
- <!.. ..> that surrounds them.
- -->
- <!--
- <role rolename="tomcat"/>
- <role rolename="role1"/>
- <user username="tomcat" password="tomcat" roles="tomcat"/>
- <user username="both" password="tomcat" roles="tomcat,role1"/>
- <user username="role1" password="tomcat" roles="role1"/>
- -->
- <role rolename="manager"/>
- <role rolename="manager-gui"/>
- <role rolename="admin"/>
- <user username="tomcat" password="tomcat" roles="admin,manager,manager-gui"/>
- </tomcat-users>
复制代码
<role rolename="manager"/>
<role rolename="manager-gui"/>
<role rolename="admin"/>
<user username="tomcat" password="tomcat" roles="admin,manager,manager-gui"/>
In there the username"tomcat" and password"tomcat" which you should use in the future. Now restart the tomcat web server. - /etc/init.d/tomcat restart
复制代码 Manager Interface TestWhen user finished install, user can test the tomcat had already install. In the Raspberry Pi browser user can enter: In user's computer, user can replace the “localhost” part to user's Raspberry Pi IP address.For example 192.168.1.100 is Raspberry Pi IP address. - http://192.168.1.100:8080/
复制代码In user browser should be show the Tomcat.
成功安装后的界面.
1.3 下载AEPweb并且上传到服务器
然后使用Tomcat的自带界面上传,上传后会自动解压
这时候访问以下地址就可以进入AEPweb界面了- http://localhost:8080/AEPweb
复制代码 例如你的树莓派内网地址是192.168.1.100- http://192.168.1.100:8080/AEPweb
复制代码 2.动态地址和路由器设置
这里已经有非常多的大大详细的的教程了,花生壳之类的都是国内很好的选择,有些路由器自带了转发和动态地址设置,教程中我略微提到了No-Ip等动态解析的使用方法,端口转发也是让你树莓派在世界都能访问的关键。
http://aepwiki.x10.mx/index.php/Support
最后也提到了一些其他软件适应不同的平台操作树莓派,这些软件的界面和链接速度都远远好于AEPweb,但是AEPweb的特点就是能让你无时无刻的食用你的树莓派无论你在任何地方。
现在先写这么多吧,如果以后有改进再继续更新。
Tihua Qin
2013年4月16日
Content is available under GNU Free Documentation License 1.3 or later.
|