GithubHelp home page GithubHelp logo

kaoushikmurugan / connect-4-on-embedded-systems Goto Github PK

View Code? Open in Web Editor NEW
1.0 1.0 0.0 145 KB

Final Project for an Embedded Systems Course

TypeScript 26.89% C 68.06% C++ 2.73% Batchfile 2.32%

connect-4-on-embedded-systems's Introduction

Final Project for an Embedded Systems Course

For Lab 6

Project by Ian Chuang and Kaoushik Murugan

A multiplayer Connect 4 game that plays on two TI CC3200 Boards

Connect4Client is the code that is run on the CC3200 Boards

It is an embeeded C project for the CC3200 board. All board-specfic C includes can be found in the SDK for the CC3200 board (correct this later). Our input device is an IR sensor + IR remote.

Connect4Server is the code that is run on an AWS EC2 Server

It is a node.js project using Amazon's IoT SDK to communicate with the boards over MQTT

Device-1-certs is the location where we store our certificates associated to the first CC3200 board

Device-2-certs is the location where we store our certificates associated to the second CC3200 board

You do not have to store them in those directories, however it may help with organization. All code that requires the certificates and keys are based on user specified relative paths (see intructions on how to run Connect4Server)

Instructions

How to run Connect4Server

This is the server on which the game logic is run. It subscribes to iot device shadow changes to recieve input information either device and send the updated game state to both devices

1. Download the Connect4Server directory to the device where you'll host the server 2. Inside the Connect4Server directory, run:

npm install

3. Copy over (to a location of your choice) the necessary certificates and keys to connect to the server You'll need the following certificates for each device that you want to connect:

  • Client Certificate
  • RootCA (RootCA1 - RSA 2048)
  • Private Key

4. Create .shadowinfo.json for the devices you're using The template is provided in Connect4Server/Device.shadowinfo.template.json

  • The paths to the certificates and keys should be relative to the .shadowinfo.json's file location.
  • thing_name is the name of the aws iot thing you want to connect to
  • shadow_name is the name of the aws iot thing's device shadow. If you created an unnamed (classic) device shadow, then it's name will be Classic Shadow
  • endpoint can be found on your within your things's ARN and/or your device shadow's URL. It is of the format <random charecters>.iot.<region>.amazonaws.com

Rename the files to Device1.shadowinfo.json and Device2.shadowinfo.json

5. Run the following command to start the server

npm run dev

Ensure that you're using node v16.18.0 by running

node -v

Setting up Connect4Client

AWS Setup

When creating the policies for the device(s), use template provided in PolicyPremissions.json. Replace:

  • with the region you are using (e.g. us-east-1)
  • <aws_account_id> with your aws account id
  • <thing_name> with the name of your thing

The permissions allows communication with the device shadow via HTTP (physical device to shadow) as well as MQTT (shadow to server)

Software Requirements

  • CCS to run/test/debug embeded C code for the CC3200 board (* not required if you aren't changing the code)
  • UniFlash to flash the program to the CC3200 board
  • node.js v16.18.0
  • Amazon AWS
    • EC2 server to run the server and connect to other AWS services (* other services may work)
    • IoT Core to connect the CC3200 to other AWS services
    • AWS CLI configured with an IAM role that has admin permissions to test code locally before sending it to the EC2 server (* may not be required, we haven't tested it on a system that wasn't using aws cli without admin perms)
    • AWS IOT Device SDK v2 to connect to IoT devices on a node.js project

connect-4-on-embedded-systems's People

Contributors

kaoushikmurugan avatar ian-chuang avatar

Stargazers

 avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.