It's a small challenge and fun to setup a chatbot on a small device with restrained resource.
Here's the instruction to setup a chatbot on Respberry pi with 4GB SD Card.
1. Download respbian lite
We need respbian lite because normal Respbian took more than 4GB space. If you have 8GB or larger SD Card, normal Respbian works fine for you.
You can download them from https://www.raspberrypi.org/downloads/raspbian/
2. Flash image to sdcard
I did it in Mac with diskutil. You can check the install guide from https://www.raspberrypi.org/documentation/installation/installing-images/README.md for other platforms.
$ diskutil list
/dev/disk0 (internal, physical):
/dev/disk1 (internal, virtual):
/dev/disk2 (internal, virtual):
#: TYPE NAME SIZE IDENTIFIER
0: FDisk_partition_scheme *3.9 GB disk2
1: Windows_FAT_32 boot 58.7 MB disk2s1
2: Linux 3.8 GB disk2s2
$ diskutil unmountDisk disk2
$ sudo dd bs=1m if=2016-03-18-raspbian-jessie-lite.img of=/dev/rdisk2
3. Login to respbian
Respbian lite does not provide desktop environment, so we'll do everything with command line.
Insert SDCard, bootup and login into respbian with
Refer from http://elinux.org/RPi_Distributions#Raspbian
4. Install node and redis
Refer from https://nodejs.org/en/download/package-manager/
curl -sL https://deb.nodesource.com/setup_5.x> script$ chmod 755 script$ sudo -E ./script$ sudo apt-get install -y nodejs build-essential redis-server$ node -vv5.10.1
5. Install webbybot
Webbybot is the rewrite of hubot from coffeescript to ES6, its will be more maintainable in the future.
In respbian lite, the git is not pre-installed, so we need install git-core from apt-get as well.
sudo apt-get install git-coregit clone https://github.com/gasolin/webby-template pibotcd pibotnpm install./bin/webbywebby> webby testwebby> pong
6. Deploy on messengers
Check Workable adapters section to install your bot onto telegram, facebook messenger, or skype
Let's take skype for example. First you need sign up an skype account, then put the username/password on to .env file.
Then install hubot-skyweb adapter and switch the core to webbybot
npm install hubot-skywebvi node_module/hubot-skyweb/src/skyweb.coffee
replace require 'hubot' to 'webbybot'.
./bin/webby -a skyweb
You are good to go! You can add new skills on your pibot by following https://github.com/gasolin/webbybot/#add-plugins
which is same as hubot, and create your own plugin to control the respberry pi https://github.com/gasolin/webbybot#write-your-own-plugin.