Server Deployment Instructions
You may use any cloud platform like DigitalOcean, AWS EC2, GCP, Azure or even a home server to deploy this bundle.
- Package Installation:
- Create a catkin workspacemkdir -p ~/catkin_ws/srccd ~/catkin_ws/src/
- Clone the repo into
catkin_ws/src
git clone https://github.com/whomihirpatel/4G-Networked_Robots.gitcd 4G-Networked_Robotsgit submodule update --init - Build the workspace and activate itcd ~/catkin_ws/catkin_makesource ~/catkin_ws/devel/setup.zsh
- Web Hosting:
- Installation instructions for NGINX web server can be hound here
- nginx_scripts folder configuration files which can be used as a tempelate.
- Detailed Instructions on front-end hosting, database listing and routing VPN traffic are given in the nginx_scripts folder.
- VPN Hosting:
- Installation instructions for VPN Server can be hound here and here
- Make sure to generate a unique client certificate for each robot and assign a static tun0 IP for each client.
- update the
server.conf
to allow inter-client communication and allow static IP assignment by adding following lines:ifconfig-pool-persist ipp.txtclient-to-clientpush "route 192.168.4.0 255.255.255.0"
- Front-end
- A front-end minimal website is developed. It can be used to connect robots to server, visualize data, check log and see server_database.
- Further instructions on front-end is given in website_front_end folder.
- Some html snippets are taken from codepen
Connecting Robots to the server
If you are using robots connected to wifi and can allow incoming web-socket traffic to your robot, you may skip to next step
If you are using robots conencted to cellular network or have incoming traffic blocked on your wifi, you may to connect to the server via VPN tunnel and route the traffic on the server.
- Generate a unique CA certificate for your robot. Detailed instructions here
- edit the ipp.txt file in openvpn directory and add name of your CA authority (i.e. name you used in unique CA certificate), followed by desired/available static ip.sample,10.8.0.4,fddd:1194:1194:1194::1001
- Route the VPN traffic from server port to VPN device port using commandsudo iptables -t nat -A PREROUTING -p tcp --dport 10101 -j DNAT --to-destination 10.8.0.4:9090
- Though it is advised to block external ports using
sudo ufw enable
and use NGINX to reverse-proxy all traffic through port 80.- In that case front-end will communicate with individual robots via port 80 insted of any other server port.
- Make a nginx
.conf
file which reverse-proxy the external traffic to localhost. A samplerobot_name.conf
is provided in nginx_scripts folder.
Now both, your server and robots are ready!
Author: Mihir Patel