Skip to content

IoT Nerf Tank Project that utilizes Python, MQTT, and AWS to pass information from backend service with front-end controls.

License

Notifications You must be signed in to change notification settings

kevinthedang/IoT-nerf-tank

Repository files navigation

IoT Nerf Tank

Destruction on Treads and Money well spent

License

tank

Table of Contents

Description

For this project, we were inspired to combine a tank chassis with a nerf turret to create a tank that will be connected to a web server. The server will send json messages to certain topics on AWS where the tank (Raspberry Pi) will receive the messages through a proxy and execute the parsed commands.

Libraries / Modules

To Run / Test

  • Get the SDK onto the pi and have certificates ready from aws to run commands to the pi from the client

    • create folder in the ~ directory called certs and place all of your certification files in there.
    • You will need to run a certain command in the ClientToJoxConnectionProxy directory.
      • python3 internetJox.py --topic <your topic-name> --ca_file ~/certs/AmazonRootCA1.pem --cert ~/certs/certificate.pem.crt --key ~/certs/private.pem.key --endpoint <your aws endpoint here>
        • You can also you the topic that the server uses: from_client.
    • You will also need to run another command in a seperate terminal called RobotJoxControl.py can be found in the RobotJoxControl directory
      • Run the file as ./RobotJoxControl.py.
    • Now the Tank should be able to listen to outside commands:
      • Jox <--- AWSProxy <--- ExternalClient(s)...
    • internetJox.py is not required for any other type of control or connection you would like to make with the tank! It is only a sample of a connection from a separate (or same) network client.
  • Pull client and server code directories

    • You will need to add your certifications into the server directory as a folder named certifs
    • You will also need a json file named endpoint.json to hold your endpoint for the server to connect to:
      • i.e. { "endpoint": "<your_endpoint_here>" }
    • NodeJs must be install to run the client and sever
      • go into the client directory and run npm i then npm start
      • go into the server directory and run npm i then npm start
      • not the server should be up at localhost:5173 most likely (or whatever vite tells you its hosted at)
    • Now you can click on the buttons and the Pi should receive the messages!
    • Jox <--- AWSProxy <--- ExpressClient <---> UserClient

Commands

  • There are not too many commands for the Tank to run, but knowing them can help customize how they can run (either from the proxy or from default calls)
    • Treads:
      • "leftTread:drive:<value between -1 to 1>"
      • "rightTread:drive:<value between -1 to 1>"
    • Turret:
      • To fire the turret, call commands in order:
        • "flywheel:fire"
        • "ammoRammer:fire"
      • Turret Elevation:
        • "gunElevator:<"up" or "down">::<degrees>"
          • The current degrees cannot exceed 90
      • Turret Left / Right:
        • "turretRing:<"turnRight" or "turnLeft">:<degrees>"
          • The current degrees cannot exceed 90
      • Targeting Laser:
        • "targetingLaser:<"on" or "off">"
      • Some commands can be set to 0 degrees (home angle):
        • "<"gunElevator" or "turretRing">:setHome"

Parts

Credit

About

IoT Nerf Tank Project that utilizes Python, MQTT, and AWS to pass information from backend service with front-end controls.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published