All the code for my TadHack London projects
JavaScript HTML
Switch branches/tags
Nothing to show
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
appserver
matrixListener
LICENSE
README.md

README.md

Tadhack London 2015 - The Matrix Bot

Matrix Bot This is an experimental project by Anders Brownworth and Scott Barstow to demonstrate the use of Matrix.org's platform with an IoT device.

In the demonstration app, we have enabled a Raspberry Pi to drive a robot using WebRTC and live streaming of video from a Janus Gateway on the device.

Watch The Video

How It Works

When you browse to the app server and connect to the stream, we load the stream from the Janus gateway running on the Pi. The app server also connects to Matrix as it loads, with a specific room to send messages to. We use socket.io to push messages to and from Matrix within the app.

As the user clicks the navigation buttons, we send messages through a Matrix room to the device. The device uses a simple listener app to consume all new messages from the room, ignore the ones it doesn't care about, and processes the navigation messages.

We control two DC motors through GPIO on a Raspberry Pi. We step power up from the Raspberry Pi’s 3.3 volts to 7.5 volts for the motors using a PWM motor controller.

Software Components

All of the software we wrote for this project was done in Node 12.

You'll need a couple of prerequisites to get this going.

npm install -g grunt bower

The Matrix Listener, which subscribes to a room in matrix and listens to all events for the room

cd matrixListener
npm install
HOST=yourmatrixhost MATRIX_USER=user MATRIX_PASSWORD=password npm start

The App Server, which has a simple browser that streams the video and provides basic controls for the device.

cd appServer
npm install
HOST=localhost PORT=3000 npm start

then browse to 
http://localhost:3000/matrix

Special thanks to the folks who wrote the Janus Gateway which allowed us to stream video right off of the device using WebRTC

Hardware Components

The Multi-Chassis Tank

The SparkFun Motor Driver

Special Thanks

We'd like to thank all of the sponsors of TADHack 2015 London for letting us participate in this event, with special thanks to the folks from Matrix.org for the help they provided in getting our app working with their platform.

We'll be posting additional videos here on how we put the hardware together once we have a breath!