Skip to content
serverless@beta ping pong bot for Slack commands
Python JavaScript Shell
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
pibot
src
test/slackEvents
.babelrc
.gitignore
README.md
bodymappings.md
config.json
package.json
serverless.env.yml
serverless.yml

README.md

Quick Reference

  • username: pi
  • password: On the general channel topic on Slack
  • Slack: pongbot.slack.com

Pi Info

  • Raspberry Pi 3 running Raspian Linux
  • Camera Module NOIR v2
  • Node Version Manager with Node.js installed
  • Python 2.7
  • OpenCV 2.4.9

SSH

ssh pi@ipaddress

To get a file over SCP if you're remoting in: scp pi@ipaddres:/path/to/image.jpg /local/path/image.jpg

Existing Code

cd ~/pongbot/pibot

The serverless code and the code to run on the pi is available at this GitHub repo: git clone https://github.com/serinth/pongbot

Get a image/video from the camera

Raspbian has a built in quick access to get to the camera module. To capture an image just run: raspistill -o image.jpg

If the image is flipped around we can do: raspistill -vf -hf -o image.jpg

Using OpenCV code in /pongbot/pibot/ python test_image.py

To get a video stream: python test_video.py

Serverless Code

The top level of this structure is using serverless framework. Install using npm install -g serverless@beta. The bot will be attached as a custom command integration on the Slack channel.

Deploy Entire Solution

npm install npm run build serverless deploy

Deploy Function

serverless deploy function --function (your function name)

Develop Locally

Create all vision programs using the same python version and OpenCV version as the Pi. The only thing that you will need to change is the camera initialization function from your webcam to the PiCamera python class. See the track.py for examples.

AWS IoT

A certificate will be installed on the Pi in ~/certs to talk to IoT.

You can’t perform that action at this time.