Skip to content

Multiplayer sumo bot game for College of DuPage Engineering & Technology Club

Notifications You must be signed in to change notification settings

trakyari/multiplayerSumoBot

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 

Repository files navigation


Logo

ETC Sumobot Outreach

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

Table of Contents

  1. About The Project
  2. Getting Started
  3. Usage
  4. Roadmap
  5. Contributing
  6. License
  7. Contact
  8. Acknowledgements

About The Project

Robot

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.

Built With

Getting Started

Website Setup

To get a local copy of our app running follow these simple steps.

Prerequisites

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

Installation

  1. Clone the repo into your cloud server

    git clone https://github.com/trakyari/multiplayerSumoBot.git
  2. cd multiplayerSumoBot/BattleBotOutreach
  3. Install NPM packages

    npm install
  4. Start the server using a process manager (we'll use PM2)

    sudo -u nodejs pm2 start server.js

Usage (locally)

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.

  1. modify each bot html file (if running locally!)
  var gateway = `ws://LANrobotIP/ws`; // points to ESP
  1. cd multiplayerSumoBot/BattleBotOutreach
  2. Install NPM packages
    npm install
  3. Start app
    node server.js

Hardware Setup

Reverse SSH Tunnel

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.

  1. Make sure each Bot has the proper SSID and password
    const char* ssid = "your ssid";
    const char* password = "your password";
  2. Be sure to make each port on each bot unique
    AsyncWebSocket server(Unique_port_for_BotX);
  3. Create SSH config file (if it doesn't exist already)
    touch ~/.ssh/config
    vim ~/.ssh/config
  4. 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
  5. Start the reverse SSH tunnel by calling the config shortcut
    ssh example

Circuit/Electrical

Robot
Diagram courtesy of

Nikita Lukhanin

Usage

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

Roadmap

  • 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).

Contributing

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.

  1. Fork the Project
  2. Create your Feature Branch (git checkout -b feature/AmazingFeature)
  3. Commit your Changes (git commit -m 'Add some AmazingFeature')
  4. Push to the Branch (git push origin feature/AmazingFeature)
  5. Open a Pull Request

License

Distributed under the MIT License. See LICENSE for more information.

Contact

Blerim Abdullai - email bl3rimabdullai@gmail.com

Arijus Trakymas - email

Project Link: https://github.com/trakyari/multiplayerSumoBot

Acknowledgements

About

Multiplayer sumo bot game for College of DuPage Engineering & Technology Club

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 3

  •  
  •  
  •