Sumobot game that features remote controlled robots battling in an arena. These robots can be controlled from anywhere in the world via user input and a livestream.
Explore the docs »
Report Bug
·
Request Feature
Sumobot project created by the College of DuPage Engineering & Technology Club during the 2020/2021 school year. Features ESP8266 powered robots that can be controlled over the internet via the users arrow keys and a low latency livestream. This project was used in conjunction with an educational presentation for numerous outreach events. These events reached the local homeschool community, Chicago Public Schools, as well as COD's anual STEMCON. To see the robots in action please visit the usage page.
To get a local copy of our app running follow these simple steps.
Disclaimer: The current implentation relies on a cloud server for the livestream and reverse proxy of websockets. Running this locally is possible, however the livestream will not work as it requires a valid TURN server for the webRTC implementation.
- Robots assembled and connected to WiFi. Robot IP's must be set in the cloud server web server (NGINX/Apache) on a reverse proxy to redirect WSS to WS. We needed to do this because the current implementation of ESPAsyncWebserver cannont accept secure connections. Example config for NGINX:
location /proxyBotExample {
proxy_pass http://example.domain:desiredPort/ws;
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "upgrade";
}
- Each robot page must also be configured (
bot1.html
example):
var gateway = `wss://example.domain/proxyBotExample`; // points to ESP proxy
- A TURN server setup and running (how to setup a TURN server)
-
Clone the repo into your cloud server
git clone https://github.com/trakyari/multiplayerSumoBot.git
-
cd multiplayerSumoBot/BattleBotOutreach
-
Install NPM packages
npm install
-
Start the server using a process manager (we'll use PM2)
sudo -u nodejs pm2 start server.js
Warning: Running it locally will prevent the livestream from working without a valid TURN server setup and configured in the server.js
This is an example of how to list things you need to use the software and how to install them.
- modify each bot html file (if running locally!)
var gateway = `ws://LANrobotIP/ws`; // points to ESP
-
cd multiplayerSumoBot/BattleBotOutreach
- Install NPM packages
npm install
- Start app
node server.js
We used a reverse ssh tunnel in order to redirect traffic from specified bot ports to their respective sumobot. This also enables the project to be taken anywhere as long as the host computer and ESPs are all on the same LAN.
- Make sure each Bot has the proper SSID and password
const char* ssid = "your ssid"; const char* password = "your password";
- Be sure to make each port on each bot unique
AsyncWebSocket server(Unique_port_for_BotX);
- Create SSH config file (if it doesn't exist already)
touch ~/.ssh/config
vim ~/.ssh/config
- Setup up a ssh config file like this one for the Reverse SSH Tunnel
Host example HostName example.domain User root Port 22 RemoteForward ServerPortBot1 esp_ip_bot1:ESPBot1Port RemoteForward ServerPortBot2 esp_ip_bot2:ESPBot2Port RemoteForward ServerPortBot3 esp_ip_bot3:ESPBot3Port RemoteForward ServerPortBot4 esp_ip_bot4:ESPBot4Port RemoteForward ServerPortBot5 esp_ip_bot5:ESPBot5Port
- Start the reverse SSH tunnel by calling the config shortcut
ssh example
We are currently working to create videos showcasing the events this project was used in, for now our stemcon livestream can be viewed here.
For more examples, please refer to the Documentation
- Queue system in order to manage multiple players trying to join the same bot
- Autonomous reseting using line following sensors
- Further optmize live stream to minimize compounding delays
See the open issues for a list of proposed features (and known issues).
Contributions are what make the open source community such an amazing place to be learn, inspire, and create. Any contributions you make are greatly appreciated.
- Fork the Project
- Create your Feature Branch (
git checkout -b feature/AmazingFeature
) - Commit your Changes (
git commit -m 'Add some AmazingFeature'
) - Push to the Branch (
git push origin feature/AmazingFeature
) - Open a Pull Request
Distributed under the MIT License. See LICENSE
for more information.
Blerim Abdullai - email bl3rimabdullai@gmail.com
Arijus Trakymas - email
Project Link: https://github.com/trakyari/multiplayerSumoBot