No description, website, or topics provided.
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Type Name Latest commit message Commit time
Failed to load latest commit information.

Lets Talk Robot

Raspberry Setup

OS Setup

Download the latest OS image and burn it to an SD card

Connection to the robot

Set up your Raspberry Pi's host and password then ssh into it.

Setup RSA Key pair

Setup the RSA key pair on the client machine: ssh-keygen -t rsa

The generated keys should be located at /home/<user>/.ssh/ and /home/<user>/.ssh/id_rsa

Copy the key into the new machine: ssh-copy-id pi@lets-talk.local


  1. Clone this repo
  2. Install with: yarn install
  3. copy the .env.template as .env and set your environment vars

NOTE: Installation will only work on ARM processors


  1. Start with: npm start

Drivetrain script -> /usr/sbin/

cd /home/<user>/robot && npm start

remember to give it permissions to run: sudo chmod +x /usr/sbin/

copy the .env.template to .env and set the environment variables


Watch at:

Stop it with: netstat -tulnap sudo fuser -k 9090/tcp

The best resolution I can get is 320x240 with a 1 sec delay

ffserver -> config /etc/ffserver.conf

HTTPPort 9090
MaxHTTPConnections 1000
MaxClients 10
MaxBandwidth 1000

<Feed feed1.ffm>
        File /tmp/feed1.ffm
        FileMaxSize 10M

<Stream test.mjpg>
        Format mpjpeg
        Feed feed1.ffm
        VideoFrameRate 4
        VideoBitRate 80
        VideoSize 600x480
        Strict -1
        ACL allow
        ACL allow localhost
        ACL allow

Web cam script -> /usr/sbin/

ffserver -f /etc/ffserver.conf & ffmpeg -v verbose -r 5 -s 600x480 -f video4linux2 -i /dev/video0 http://localhost:9090/feed1.ffm

remember to give it permissions to run: sudo chmod +x /usr/sbin/

Ngrok the video stream

Create an introspective tunnel out into the internet: ./ngrok http -region us -subdomain=lets-talk 9090


  1. turn on robot power
  2. ssh in to the robot
  3. start robot drivetrain: /usr/sbin/
  4. start Video Stream: /usr/sbin/
  5. point your browser to: lets-talk.local:8080 ||



2-wheel differential drivetrain powered by two(2) - 5v DC motors, which is routed into a POLOLU DRV8833 Dual H-bridge IC. The DRV8833 addresses these motors as AIN and BIN (leftside, birdeye view, with the bot pointed away from your viewpoint).

BOUT1 - blue wire // red wire // leftside BOUT2 - green wire // black wire // leftside AOUT2 - orange wire // red wire // rightside AOUT1 - yellow wire // black wire // rightside

	// POLOLU DRV8833 Dual H-bridge Configuration
	AIN = new five.Motor({
		pins: {
			pwm: 24, // white wire // AIN2
			dir: 2 // red wire // AIN1

	BIN = new five.Motor({
		pins: {
			pwm: 26, // brown wire // BIN2
			dir: 7 // black wire // BIN1

NOTE: that the raspberry pi 2 only has 2 PWM channels.

Motors initialized forward and stopped

PWM Control of Motor Speed

PWM 0 Forward PWM fast decay
1 PWM Forward PWM slow decay
0 PWM Reverse PWM fast decay
PWM 1 Reverse PWM slow decay


raspi-io johnny-five motor api node npm ddp raspi-soft-pwm


Model A+/B+/Raspberry Pi 2/Raspberry Pi Zero Pin Mapping DRV8833 Pin Diagram DRV8833 Datasheet