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.
- Front-End
- Back-end
- AWS-Tank Proxy:
- awscrt
- command_line_utils.py
- awsiot-python-sdk
mqtt_connection_builder.py
(should be in theawsiot
directory)- If there is a error on call, the proxy could also depend on
mqtt5_client_builder.py
- If there is a error on call, the proxy could also depend on
- awsiot-python-sdk
- Tank Controller
-
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 calledcerts
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 can also you the topic that the server uses:
- You will also need to run another command in a seperate terminal called
RobotJoxControl.py
can be found in theRobotJoxControl
directory- Run the file as
./RobotJoxControl.py
.
- Run the file as
- 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.
- create folder in the
-
Pull client and server code directories
- You will need to add your certifications into the
server
directory as a folder namedcertifs
- 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>" }
- i.e.
- NodeJs must be install to run the client and sever
- go into the
client
directory and runnpm i
thennpm start
- go into the
server
directory and runnpm i
thennpm start
- not the server should be up at
localhost:5173
most likely (or whatever vite tells you its hosted at)
- go into the
- Now you can click on the buttons and the Pi should receive the messages!
- Jox <--- AWSProxy <--- ExpressClient <---> UserClient
- You will need to add your certifications into the
- 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>
"
- "leftTread:drive:
- 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
- "gunElevator:
- Turret Left / Right:
- "turretRing:
<"turnRight" or "turnLeft">
:<degrees>
"- The current degrees cannot exceed 90
- "turretRing:
- Targeting Laser:
- "targetingLaser:
<"on" or "off">
"
- "targetingLaser:
- Some commands can be set to 0 degrees (home angle):
- "
<"gunElevator" or "turretRing">
:setHome"
- "
- To fire the turret, call commands in order:
- Treads:
- Refer to:
Parts_List.xlsx
in theextras
folder for all the turret parts bought- Bluetooth Nerf Turret - Hardware
- SZDoit Black T300 Tank Chassis (Alternative and cheaper options for chassis are fine too)
- Raspberry Pi
- Also Refer to
3D printing parts
for other parts to for mounting - Adafruit DC and Stepper Motor HAT for Raspberry Pi
- Documentation for use