라즈베리 파이에 휴봇 설치하기박규철 ( 루이스 )
Hubot
• Github 채팅룸에서 자동화된 태스크를 수행하는 로봇• Open source, Node.js, CoffeeScript 기반• Heroku 와 같은 플랫폼에 배포가 쉬움
Hubot 설치 순서1. Node.js 구 버전 삭제2. Respberry Pi 용 Node.js 최신버전 및 npm 설치3. Hubot 설치4. Slack 설정5. Hubot 설정6. Hubot 실행
1. Node.js 구버전 삭제• RASPBIAN JESSIE 의 기본 Node 버전은 호환 불가• 구 버전 삭제sudo apt-get remove nodejs
sudo apt-get autoremove
2. Node.js / npm 설치• 서드 - 파티 저장소 추가curl -sLS https://apt.adafruit.com/add | sudo bash
• 저장소 업데이트sudo apt-get update
• Node.js, npm 설치sudo apt-get install node
sudo apt-get install npm
3. Hubot 설치• yo, generator-hubot 설치 및 설정 (adapter 를
slack 으로 )
sudo npm install -g yo generator-hubotmkdir hubot-picd hubot-piyo hubot• hubot slack adapter 설치npm install hubot-slack --save
4. Slack - Hubot app 설치• Hubot Token 값 복사
5. Hubot 설정• Raspbian 부팅 시 Hubot 실행 설정sudo vim /etc/rc.local
• Raspbian 부팅 시 Hubot 실행 설정sudo -H -u pi bash -c 'cd /home/pi/hubot-pi/ && \
export HUBOT_SLACK_TOKEN={Hubot 토큰값 } && \export HUBOT_LOG_LEVEL="debug" && \/home/pi/hubot-pi/bin/hubot -a slack --name hubot &'
5. Hubot 설정 (선택사항 )• Hubot Redis-server 설치 ( 선택사항 )
sudo apt-get install redis-servernpm install hubot-redis-brain --save• Heroku keep-alive 삭제 ( 선택사항 )
npm uninstall hubot-heroku-keepalive —save
6. Hubot 실행• Raspbian 부팅 시 Hubot 실행 설정/home/pi/hubot-pi/bin/hubot -a slack --name
hubot-pi &
참고 자료• Node.js on Raspberry Pi
• http://writing.kynan.net.au/2015/12/13/raspberry-pi-setup-with-noobs-and-raspbian
• Hubot on Raspberry Pi• http://writing.kynan.net.au/2015/07/17/teach-your-raspberry-pi-to
-talk-in-slack• Hubot-slack
• https://github.com/slackhq/hubot-slack• Hubot-script
• https://github.com/github/hubot-scripts