Add Monkey web server

This commit is contained in:
Oleg Kalachev
2018-09-04 01:30:30 +03:00
parent b87d3c612b
commit 1d21665c16
5 changed files with 89 additions and 1 deletions

View File

@@ -3,6 +3,7 @@
<arg name="fcu_ip" default="127.0.0.1"/>
<arg name="gcs_bridge" default="tcp"/>
<arg name="viz" default="true"/>
<arg name="web_server" default="true"/>
<arg name="web_video_server" default="true"/>
<arg name="rosbridge" default="true"/>
<arg name="main_camera" default="true"/>
@@ -21,6 +22,9 @@
</include>
<!-- web server, serving /home/pi/catkin_ws/src/clever/clever/static -->
<node name="web_server" pkg="clever" type="monkey" output="screen" if="$(arg web_server)"/>
<!-- web video server -->
<node name="web_video_server" pkg="web_video_server" type="web_video_server" if="$(arg web_video_server)" required="false" respawn="true" respawn_delay="5"/>

3
clever/src/monkey Executable file
View File

@@ -0,0 +1,3 @@
#!/usr/bin/env bash
exec /home/pi/monkey/build/monkey --port 80

12
clever/static/index.html Normal file
View File

@@ -0,0 +1,12 @@
<h1>CLEVER Drone Kit Tools</h1>
<ul>
<!-- <li><a href="">View user reference</a> (<a href="http://clever.copterexpress.com">http://clever.copterexpress.com</a> snapshot)</li> -->
<!-- <li><a href="">Go to web terminal</a> (<code>Butterfly</code>)</li> -->
<li><a href="" id="wvs">View image topics</a> (<code>web_video_server</code>)</li>
<!-- <li><a href="viz.html">View 3D visualization</a> (<code>ros3djs</code>)</li> -->
</ul>
<script type="text/javascript">
document.querySelector("#wvs").href = location.origin + ':8080';
</script>

57
deploy/monkey Normal file
View File

@@ -0,0 +1,57 @@
# Default Host - Configuration
# ============================
# Here the variable principals of the program are defined in respect
# to the configuration of the different types of directives.
[HOST]
# ServerName:
# -----------
# Allow you to set a host and domain name (e.g monkey.linuxchile.cl). If
# you are working in a local network just set your IP address or if you
# are working like localhost set your loopback address (127.0.0.1).
ServerName 0.0.0.0
# DocumentRoot:
# -------------
# This variable corresponds to the location of the main server directory
# of the web pages, where the files of your site are located.
#
# Example:
# DocumentRoot /home/krypton/htdocs
DocumentRoot /home/pi/catkin_ws/src/clever/clever/static
# Redirect:
# ---------
# Under specific conditions, you may want the server performs a HTTP
# redirect when this Virtual Host is reach. If that is the case, append
# to the Redirect key the value of the address where to redirect the
# HTTP client.
#
# Redirect http://monkey-project.com
[LOGGER]
# AccessLog:
# ----------
# Registration file of correct request.
AccessLog /home/pi/monkey/build/log/access.log
# ErrorLog:
# ---------
# Registration file of incorrect request.
ErrorLog /home/pi/monkey/build/log/error.log
[ERROR_PAGES]
404 404.html
[HANDLERS]
# FastCGI
# =======
# Match /.*\.php fastcgi
# CGI
# ===
# Match /cgi-bin/.*\.cgi cgi

View File

@@ -28,7 +28,19 @@ apt-get install --no-install-recommends -y \
libjpeg8-dev=8d1-2 \
tcpdump \
libpoco-dev=1.7.6+dfsg1-5+deb9u1
# install Monkey web-server
cd /home/pi
git clone git@github.com:monkey/monkey.git
cd monkey
git checkout v1.6.9
./configure --malloc-libc --local
make
sudo setcap 'cap_net_bind_service=+ep' ./build/monkey # allow using 80 port
rm build/conf/sites/default
ln -s /home/pi/catkin_ws/src/clever/deploy/monkey ./build/conf/sites/default
cd /home/pi
echo -e "\033[0;31m\033[1m$(date) | #2 Adding mjpg-streamer at /home/pi\033[0m\033[0m"
# https://github.com/jacksonliam/mjpg-streamer