SlideShare ist ein Scribd-Unternehmen logo
1 von 27
Opensource H/W + Node JS
IoT 따라잡기
Day 3
Make
Raspberry Pi Audio
Raspberry Pi Robot
Youtube API
Youtube API 사용하기
https
3/get
https://developers.google.com/youtube/v3/getting-started
1. 구글 계정 등록 하기
2. API 요청을 위한 Google Application 등록
https://console.developers.google.com/project
3. Youtube Data API 설정
https://developers.google.com/youtube/v3/
https://github.com/google/google-api-nodejs-
client/tree/master/examples
Youtube API 사용하기
https
3/get
https://developers.google.com/youtube/v3/getting-started
1. 구글 계정 등록 하기
2. API 요청을 위한 Google Application 등록
https://console.developers.google.com/project
3. Youtube Data API 설정
https://developers.google.com/youtube/v3/
https://github.com/google/google-api-nodejs-
client/tree/master/examples
Youtube API 사용하기
https
3/get
https://github.com/fvdm/nodejs-youtube/wiki
Google API 모듈 설치
$ npm install googleapis
NodeJS 선언
var google = require ('googleapis');
google.options ({ auth: 'API KEY' });
var youtube = google.youtube ('v3');
Youtube API 사용하기
youtube.search.list ( {
part: 'snippet',
type: 'video',
q: query,
maxResults: 50,
order: 'date',
safeSearch: 'moderate',
videoEmbeddable: true
}, function (err, res) {
if (err) {
return callback (err);
}
res.items.forEach (function (result) {
}
});
Youtube API 사용하기
{ id: 'THA_5cqAfCQ',
urlShort: 'http://youtu.be/THA_5cqAfCQ',
urlLong: 'http://www.youtube.com/watch?v=THA_5cqAfCQ',
published: '2012-12-03T15:58:45.000Z',
title: 'Cheetahs on the Edge — Director's Cut',
description: 'Cheetahs are the fastest runners on the planet. Combining the
resources of National Geographic and the Cincinnati Zoo, and drawing on the
skills of a Hollywo.',
images: {
default: { url: 'https://i.ytimg.com/vi/THA_5cqAfCQ/default.jpg' },
medium: { url: 'https://i.ytimg.com/vi/THA_5cqAfCQ/mqdefault.jpg' },
high: { url: 'https://i.ytimg.com/vi/THA_5cqAfCQ/hqdefault.jpg' } },
channelTitle: 'NationalGeographic',
channelId: 'UCpVm7bg6pXKo1Pr6k5kxG9A',
live: 'none',
duration: 428,
definition: 'hd' }
Raspberry Pi Audio 실습
라즈베리파이 오디오 (Close Ver)
1. 스마트 폰으로 인터넷 음악을 검색 함
2. 라즈베리파이 서버에서 유투브를 통해 해당 결과 검색
3. 검색 결과에서 듣고 싶은 음악을 선택
4. 선택한 영상을 유튜브에서 다운로드 함
5. 다운로드가 완료되면 라즈베리파이 오디오에서 재생시작
6. 재생 정보를 LCD 에 디스플레이 함
필요 부속
Package Install
유튜브 검색을 위한 패키지
v2 – youtube-feeds
V3 – youtube-api
$ npm install youtube-feeds
유투브 영상 다운로드를 위한 패키지
$ npm install ytdl
미디어 플레이어 설치
$ npm install omxcontrol
Source Code
var down = exec("ytdl http://www.youtube.com/watch?v="
+ data.name + ' > '+ data.name +
'.mp4 -q highest', function(err, stdout,
stderr) {
if (err){
console.log('Error : ' + err);
} else {
console.log('download complete, start!');
//omx.quit();
$s.send('play', true );
omx.start(data.name + '.mp4');
}
});
Source Code
youtube.feeds.videos({q: data.name}, function(err, data){
if(err instanceof Error){
console.log(err);
} else {
console.log(data.items.length);
var arr = [];
for(var i = 0 ; i < data.items.length ; i++){
var item = data.items[i];
arr.push({
id : item.id,
desc : item.description,
title : item.title,
date : item.updated,
count : item.viewCount
});
}
}
});
Speaker - Module
3.5 mm (Sound)
USB (Power)
문제점
1. 라즈베리파이 서버에 접속할 수 있는 근접 거리
(Raspberry Pi WiFi 영역) 에서만 서버에 접속할 수 있음
2. IoT 는 외부/물리적으로 떨어진 공간에서 해당 장치를 제
어해야 하는데, 현 시스템은 불가능
해결책
1. 공인 IP를 라즈베리파이에 적용
-> 공인 IP 의 가격이 비싸서 적용하기 힘듦
라즈베리파이 오디오 (Open Ver)
1. 스마트 폰으로 인터넷 음악을 검색 함
2. 라즈베리파이 서버에서 유투브를 통해 해당 결과 검색
3. 검색 결과에서 듣고 싶은 음악을 선택
4. 선택한 영상을 유튜브에서 다운로드 함
5. 다운로드가 완료되면 라즈베리파이 오디오에서 재생시작
6. 재생 정보를 LCD 에 디스플레이 함
Package Install
IoT 개발 지원 module 설치
$ npm install circulus
Source Code
// raspberry pi
var ccus = require(‘circulus’);
// general doc
ccus.tts([메세지], [언어]);
ccus.receive([method 명], callback);
ccus.send([method 명], callback);
ccus.set(key, value);
ccus.get(key);
Source Code
// sensor doc
var ccus = require(‘circulus’);
var cs = ccus.sensor;
cs.getDistance
cs.getLight
cs.getSound
cs.getGyro
cs.getTemp
cs.getHumidity
cs.getEnviorn
Expand your dimension
Circulus (http://www.circul.us) Since 2013
Park Jonggun, Lee Yunjai, Ki Yeonah, Lee Jonghee

Weitere ähnliche Inhalte

Was ist angesagt?

Docker 기반 개발환경 구축 - XE Open seminar #2
Docker 기반 개발환경 구축 - XE Open seminar #2Docker 기반 개발환경 구축 - XE Open seminar #2
Docker 기반 개발환경 구축 - XE Open seminar #2XpressEngine
 
랩탑으로 tensorflow 도전하기 - tensorflow 설치
랩탑으로 tensorflow 도전하기 - tensorflow 설치랩탑으로 tensorflow 도전하기 - tensorflow 설치
랩탑으로 tensorflow 도전하기 - tensorflow 설치Lee Seungeun
 
Udamp3 django apache-my_sql_python3_ubuntu14.04-v11
Udamp3 django apache-my_sql_python3_ubuntu14.04-v11Udamp3 django apache-my_sql_python3_ubuntu14.04-v11
Udamp3 django apache-my_sql_python3_ubuntu14.04-v11Dongil Yeom
 
도커 학습과 Boot2Docker
도커 학습과 Boot2Docker도커 학습과 Boot2Docker
도커 학습과 Boot2Dockerpyrasis
 
Ipython server(Jupyter Server) 만들기
Ipython server(Jupyter Server) 만들기Ipython server(Jupyter Server) 만들기
Ipython server(Jupyter Server) 만들기Hyun-sik Yoo
 
Docker 사용가이드 public v0.1
Docker 사용가이드 public v0.1Docker 사용가이드 public v0.1
Docker 사용가이드 public v0.1Steve Shim
 
About raspberrypi
About raspberrypiAbout raspberrypi
About raspberrypiYeonah Ki
 
Python Korea 2014년 6월 세미나 - Windows 환경에서 Python 개발환경 세팅하기
Python Korea 2014년 6월 세미나 - Windows 환경에서 Python 개발환경 세팅하기Python Korea 2014년 6월 세미나 - Windows 환경에서 Python 개발환경 세팅하기
Python Korea 2014년 6월 세미나 - Windows 환경에서 Python 개발환경 세팅하기Joongi Kim
 
NodeJs로 디바이스 통신하기
NodeJs로 디바이스 통신하기NodeJs로 디바이스 통신하기
NodeJs로 디바이스 통신하기TaeYoung Kim
 
[H3 2012] 내컴에선 잘되던데? - vagrant로 서버와 동일한 개발환경 꾸미기
[H3 2012] 내컴에선 잘되던데? - vagrant로 서버와 동일한 개발환경 꾸미기[H3 2012] 내컴에선 잘되던데? - vagrant로 서버와 동일한 개발환경 꾸미기
[H3 2012] 내컴에선 잘되던데? - vagrant로 서버와 동일한 개발환경 꾸미기KTH, 케이티하이텔
 
caanoo Ernice
caanoo Ernicecaanoo Ernice
caanoo Ernicejumiss
 
[Nomad connection]docker seminar 15.10.08
[Nomad connection]docker seminar 15.10.08[Nomad connection]docker seminar 15.10.08
[Nomad connection]docker seminar 15.10.08Nomad Connection, Inc.
 
04강 라즈베리-개발환경구축-실습
04강 라즈베리-개발환경구축-실습04강 라즈베리-개발환경구축-실습
04강 라즈베리-개발환경구축-실습봉조 김
 
파이썬 플라스크로 배우는 웹프로그래밍 #1 (ABCD Foundation)
파이썬 플라스크로 배우는 웹프로그래밍 #1 (ABCD Foundation)파이썬 플라스크로 배우는 웹프로그래밍 #1 (ABCD Foundation)
파이썬 플라스크로 배우는 웹프로그래밍 #1 (ABCD Foundation)성일 한
 
3.ubuntu custom
3.ubuntu custom3.ubuntu custom
3.ubuntu customsprdd
 
강분도 - 나만의 우분투 배포판 만들기 (2011Y06M25D)
강분도 - 나만의 우분투 배포판 만들기 (2011Y06M25D)강분도 - 나만의 우분투 배포판 만들기 (2011Y06M25D)
강분도 - 나만의 우분투 배포판 만들기 (2011Y06M25D)Ubuntu Korea Community
 
Raspberry pi 개발환경 구축
Raspberry pi 개발환경 구축Raspberry pi 개발환경 구축
Raspberry pi 개발환경 구축MoamBae
 
가상 환경에서의 CentOS 6.8 설치
가상 환경에서의 CentOS 6.8 설치가상 환경에서의 CentOS 6.8 설치
가상 환경에서의 CentOS 6.8 설치Byunghwa Yoon
 
초심자를 위한 도커 소개 및 입문
초심자를 위한 도커 소개 및 입문초심자를 위한 도커 소개 및 입문
초심자를 위한 도커 소개 및 입문Daniel Seo
 

Was ist angesagt? (20)

Docker 기반 개발환경 구축 - XE Open seminar #2
Docker 기반 개발환경 구축 - XE Open seminar #2Docker 기반 개발환경 구축 - XE Open seminar #2
Docker 기반 개발환경 구축 - XE Open seminar #2
 
랩탑으로 tensorflow 도전하기 - tensorflow 설치
랩탑으로 tensorflow 도전하기 - tensorflow 설치랩탑으로 tensorflow 도전하기 - tensorflow 설치
랩탑으로 tensorflow 도전하기 - tensorflow 설치
 
Udamp3 django apache-my_sql_python3_ubuntu14.04-v11
Udamp3 django apache-my_sql_python3_ubuntu14.04-v11Udamp3 django apache-my_sql_python3_ubuntu14.04-v11
Udamp3 django apache-my_sql_python3_ubuntu14.04-v11
 
도커 학습과 Boot2Docker
도커 학습과 Boot2Docker도커 학습과 Boot2Docker
도커 학습과 Boot2Docker
 
Ipython server(Jupyter Server) 만들기
Ipython server(Jupyter Server) 만들기Ipython server(Jupyter Server) 만들기
Ipython server(Jupyter Server) 만들기
 
Introduce Cobuntu 9.04
Introduce Cobuntu 9.04Introduce Cobuntu 9.04
Introduce Cobuntu 9.04
 
Docker 사용가이드 public v0.1
Docker 사용가이드 public v0.1Docker 사용가이드 public v0.1
Docker 사용가이드 public v0.1
 
About raspberrypi
About raspberrypiAbout raspberrypi
About raspberrypi
 
Python Korea 2014년 6월 세미나 - Windows 환경에서 Python 개발환경 세팅하기
Python Korea 2014년 6월 세미나 - Windows 환경에서 Python 개발환경 세팅하기Python Korea 2014년 6월 세미나 - Windows 환경에서 Python 개발환경 세팅하기
Python Korea 2014년 6월 세미나 - Windows 환경에서 Python 개발환경 세팅하기
 
NodeJs로 디바이스 통신하기
NodeJs로 디바이스 통신하기NodeJs로 디바이스 통신하기
NodeJs로 디바이스 통신하기
 
[H3 2012] 내컴에선 잘되던데? - vagrant로 서버와 동일한 개발환경 꾸미기
[H3 2012] 내컴에선 잘되던데? - vagrant로 서버와 동일한 개발환경 꾸미기[H3 2012] 내컴에선 잘되던데? - vagrant로 서버와 동일한 개발환경 꾸미기
[H3 2012] 내컴에선 잘되던데? - vagrant로 서버와 동일한 개발환경 꾸미기
 
caanoo Ernice
caanoo Ernicecaanoo Ernice
caanoo Ernice
 
[Nomad connection]docker seminar 15.10.08
[Nomad connection]docker seminar 15.10.08[Nomad connection]docker seminar 15.10.08
[Nomad connection]docker seminar 15.10.08
 
04강 라즈베리-개발환경구축-실습
04강 라즈베리-개발환경구축-실습04강 라즈베리-개발환경구축-실습
04강 라즈베리-개발환경구축-실습
 
파이썬 플라스크로 배우는 웹프로그래밍 #1 (ABCD Foundation)
파이썬 플라스크로 배우는 웹프로그래밍 #1 (ABCD Foundation)파이썬 플라스크로 배우는 웹프로그래밍 #1 (ABCD Foundation)
파이썬 플라스크로 배우는 웹프로그래밍 #1 (ABCD Foundation)
 
3.ubuntu custom
3.ubuntu custom3.ubuntu custom
3.ubuntu custom
 
강분도 - 나만의 우분투 배포판 만들기 (2011Y06M25D)
강분도 - 나만의 우분투 배포판 만들기 (2011Y06M25D)강분도 - 나만의 우분투 배포판 만들기 (2011Y06M25D)
강분도 - 나만의 우분투 배포판 만들기 (2011Y06M25D)
 
Raspberry pi 개발환경 구축
Raspberry pi 개발환경 구축Raspberry pi 개발환경 구축
Raspberry pi 개발환경 구축
 
가상 환경에서의 CentOS 6.8 설치
가상 환경에서의 CentOS 6.8 설치가상 환경에서의 CentOS 6.8 설치
가상 환경에서의 CentOS 6.8 설치
 
초심자를 위한 도커 소개 및 입문
초심자를 위한 도커 소개 및 입문초심자를 위한 도커 소개 및 입문
초심자를 위한 도커 소개 및 입문
 

Andere mochten auch

노드js 기초
노드js 기초 노드js 기초
노드js 기초 경륜 이
 
Beejei node.js & web service
Beejei   node.js & web serviceBeejei   node.js & web service
Beejei node.js & web serviceBumjin Kim
 
Nodejs Production 적용기
Nodejs Production 적용기Nodejs Production 적용기
Nodejs Production 적용기JeongHun Byeon
 
[120316] node.js 프로그래밍 5장
[120316] node.js 프로그래밍 5장[120316] node.js 프로그래밍 5장
[120316] node.js 프로그래밍 5장sung ki choi
 
Node.js
Node.jsNode.js
Node.jsymtech
 
Node.js 현재와 미래
Node.js 현재와 미래Node.js 현재와 미래
Node.js 현재와 미래JeongHun Byeon
 
Node.js를 사용한 Big Data 사례연구
Node.js를 사용한 Big Data 사례연구Node.js를 사용한 Big Data 사례연구
Node.js를 사용한 Big Data 사례연구ByungJoon Lee
 
[Hello world]nodejs helloworld chaesuwon
[Hello world]nodejs helloworld chaesuwon[Hello world]nodejs helloworld chaesuwon
[Hello world]nodejs helloworld chaesuwonNAVER D2
 
[Hello world]git internal
[Hello world]git internal[Hello world]git internal
[Hello world]git internalNAVER D2
 
[Hello world]n forge
[Hello world]n forge[Hello world]n forge
[Hello world]n forgeNAVER D2
 
[Hello world]play framework소개
[Hello world]play framework소개[Hello world]play framework소개
[Hello world]play framework소개NAVER D2
 
Node.js 자바스크립트로 서버사이드 개발하기
Node.js 자바스크립트로 서버사이드 개발하기Node.js 자바스크립트로 서버사이드 개발하기
Node.js 자바스크립트로 서버사이드 개발하기JeongHun Byeon
 
Node.js + Websocket 삽질기
Node.js + Websocket 삽질기Node.js + Websocket 삽질기
Node.js + Websocket 삽질기Paprikhan
 

Andere mochten auch (13)

노드js 기초
노드js 기초 노드js 기초
노드js 기초
 
Beejei node.js & web service
Beejei   node.js & web serviceBeejei   node.js & web service
Beejei node.js & web service
 
Nodejs Production 적용기
Nodejs Production 적용기Nodejs Production 적용기
Nodejs Production 적용기
 
[120316] node.js 프로그래밍 5장
[120316] node.js 프로그래밍 5장[120316] node.js 프로그래밍 5장
[120316] node.js 프로그래밍 5장
 
Node.js
Node.jsNode.js
Node.js
 
Node.js 현재와 미래
Node.js 현재와 미래Node.js 현재와 미래
Node.js 현재와 미래
 
Node.js를 사용한 Big Data 사례연구
Node.js를 사용한 Big Data 사례연구Node.js를 사용한 Big Data 사례연구
Node.js를 사용한 Big Data 사례연구
 
[Hello world]nodejs helloworld chaesuwon
[Hello world]nodejs helloworld chaesuwon[Hello world]nodejs helloworld chaesuwon
[Hello world]nodejs helloworld chaesuwon
 
[Hello world]git internal
[Hello world]git internal[Hello world]git internal
[Hello world]git internal
 
[Hello world]n forge
[Hello world]n forge[Hello world]n forge
[Hello world]n forge
 
[Hello world]play framework소개
[Hello world]play framework소개[Hello world]play framework소개
[Hello world]play framework소개
 
Node.js 자바스크립트로 서버사이드 개발하기
Node.js 자바스크립트로 서버사이드 개발하기Node.js 자바스크립트로 서버사이드 개발하기
Node.js 자바스크립트로 서버사이드 개발하기
 
Node.js + Websocket 삽질기
Node.js + Websocket 삽질기Node.js + Websocket 삽질기
Node.js + Websocket 삽질기
 

Ähnlich wie IoT with Raspberry Pi + Node JS - Chapter 3

Python on Android
Python on AndroidPython on Android
Python on Android용 최
 
Vue.js 기초 실습.pptx
Vue.js 기초 실습.pptxVue.js 기초 실습.pptx
Vue.js 기초 실습.pptxwonyong hwang
 
오픈소스로 만드는 DB 모니터링 시스템 (w/graphite+grafana)
오픈소스로 만드는 DB 모니터링 시스템 (w/graphite+grafana)오픈소스로 만드는 DB 모니터링 시스템 (w/graphite+grafana)
오픈소스로 만드는 DB 모니터링 시스템 (w/graphite+grafana)I Goo Lee
 
공간정보아카데미 - Day1 오픈소스개발 일반
공간정보아카데미 - Day1 오픈소스개발 일반공간정보아카데미 - Day1 오픈소스개발 일반
공간정보아카데미 - Day1 오픈소스개발 일반BJ Jang
 
Android Google Cloud Message 설정
Android Google Cloud Message 설정Android Google Cloud Message 설정
Android Google Cloud Message 설정정호 이
 
챗봇 시작해보기
챗봇 시작해보기챗봇 시작해보기
챗봇 시작해보기성일 한
 
REST API Development with Spring
REST API Development with SpringREST API Development with Spring
REST API Development with SpringKeesun Baik
 
리스펙토링 세미나 - 나만의 카카오 챗봇 만들기
리스펙토링 세미나 - 나만의 카카오 챗봇 만들기리스펙토링 세미나 - 나만의 카카오 챗봇 만들기
리스펙토링 세미나 - 나만의 카카오 챗봇 만들기Wooyoung Ko
 
조은 - AMP PWA 101 [WSConf.Seoul.2017. Vol.2]
조은 - AMP PWA 101 [WSConf.Seoul.2017. Vol.2]조은 - AMP PWA 101 [WSConf.Seoul.2017. Vol.2]
조은 - AMP PWA 101 [WSConf.Seoul.2017. Vol.2]WSConf.
 
망고100 보드로 놀아보자 17
망고100 보드로 놀아보자 17망고100 보드로 놀아보자 17
망고100 보드로 놀아보자 17종인 전
 
요즘 유행하는 AI 나도 해보자 (feat. CoreML)
요즘 유행하는 AI 나도 해보자 (feat. CoreML)요즘 유행하는 AI 나도 해보자 (feat. CoreML)
요즘 유행하는 AI 나도 해보자 (feat. CoreML)Chiwon Song
 
Internship backend
Internship backendInternship backend
Internship backendYein Sim
 
Win10 iot core_pi2
Win10 iot core_pi2Win10 iot core_pi2
Win10 iot core_pi2WeAreDev
 
Cms All 091103
Cms All 091103Cms All 091103
Cms All 091103wiim
 
2023 GDG Sondo DevFest - Flutter/ Flavor, PlatformChannel, Environment variab...
2023 GDG Sondo DevFest - Flutter/ Flavor, PlatformChannel, Environment variab...2023 GDG Sondo DevFest - Flutter/ Flavor, PlatformChannel, Environment variab...
2023 GDG Sondo DevFest - Flutter/ Flavor, PlatformChannel, Environment variab...MaRoKim4
 
Google app engine
Google app engineGoogle app engine
Google app enginescor7910
 
Windows에서 go+eclipse 개발환경 구축
Windows에서 go+eclipse 개발환경 구축Windows에서 go+eclipse 개발환경 구축
Windows에서 go+eclipse 개발환경 구축Jaehoon Kim
 

Ähnlich wie IoT with Raspberry Pi + Node JS - Chapter 3 (20)

Python on Android
Python on AndroidPython on Android
Python on Android
 
Vue.js 기초 실습.pptx
Vue.js 기초 실습.pptxVue.js 기초 실습.pptx
Vue.js 기초 실습.pptx
 
오픈소스로 만드는 DB 모니터링 시스템 (w/graphite+grafana)
오픈소스로 만드는 DB 모니터링 시스템 (w/graphite+grafana)오픈소스로 만드는 DB 모니터링 시스템 (w/graphite+grafana)
오픈소스로 만드는 DB 모니터링 시스템 (w/graphite+grafana)
 
공간정보아카데미 - Day1 오픈소스개발 일반
공간정보아카데미 - Day1 오픈소스개발 일반공간정보아카데미 - Day1 오픈소스개발 일반
공간정보아카데미 - Day1 오픈소스개발 일반
 
Html5 video
Html5 videoHtml5 video
Html5 video
 
Android Google Cloud Message 설정
Android Google Cloud Message 설정Android Google Cloud Message 설정
Android Google Cloud Message 설정
 
챗봇 시작해보기
챗봇 시작해보기챗봇 시작해보기
챗봇 시작해보기
 
REST API Development with Spring
REST API Development with SpringREST API Development with Spring
REST API Development with Spring
 
리스펙토링 세미나 - 나만의 카카오 챗봇 만들기
리스펙토링 세미나 - 나만의 카카오 챗봇 만들기리스펙토링 세미나 - 나만의 카카오 챗봇 만들기
리스펙토링 세미나 - 나만의 카카오 챗봇 만들기
 
조은 - AMP PWA 101 [WSConf.Seoul.2017. Vol.2]
조은 - AMP PWA 101 [WSConf.Seoul.2017. Vol.2]조은 - AMP PWA 101 [WSConf.Seoul.2017. Vol.2]
조은 - AMP PWA 101 [WSConf.Seoul.2017. Vol.2]
 
망고100 보드로 놀아보자 17
망고100 보드로 놀아보자 17망고100 보드로 놀아보자 17
망고100 보드로 놀아보자 17
 
Nest js 101
Nest js 101Nest js 101
Nest js 101
 
요즘 유행하는 AI 나도 해보자 (feat. CoreML)
요즘 유행하는 AI 나도 해보자 (feat. CoreML)요즘 유행하는 AI 나도 해보자 (feat. CoreML)
요즘 유행하는 AI 나도 해보자 (feat. CoreML)
 
Internship backend
Internship backendInternship backend
Internship backend
 
Citizen 개발기
Citizen 개발기Citizen 개발기
Citizen 개발기
 
Win10 iot core_pi2
Win10 iot core_pi2Win10 iot core_pi2
Win10 iot core_pi2
 
Cms All 091103
Cms All 091103Cms All 091103
Cms All 091103
 
2023 GDG Sondo DevFest - Flutter/ Flavor, PlatformChannel, Environment variab...
2023 GDG Sondo DevFest - Flutter/ Flavor, PlatformChannel, Environment variab...2023 GDG Sondo DevFest - Flutter/ Flavor, PlatformChannel, Environment variab...
2023 GDG Sondo DevFest - Flutter/ Flavor, PlatformChannel, Environment variab...
 
Google app engine
Google app engineGoogle app engine
Google app engine
 
Windows에서 go+eclipse 개발환경 구축
Windows에서 go+eclipse 개발환경 구축Windows에서 go+eclipse 개발환경 구축
Windows에서 go+eclipse 개발환경 구축
 

Mehr von Park Jonggun

라즈베리파이 IoT 시작하기
라즈베리파이 IoT 시작하기라즈베리파이 IoT 시작하기
라즈베리파이 IoT 시작하기Park Jonggun
 
Start IoT with jQueryMobile - 기초6
Start IoT with jQueryMobile - 기초6Start IoT with jQueryMobile - 기초6
Start IoT with jQueryMobile - 기초6Park Jonggun
 
Start IoT with jQueryMobile - 기초5
Start IoT with jQueryMobile - 기초5Start IoT with jQueryMobile - 기초5
Start IoT with jQueryMobile - 기초5Park Jonggun
 
Start IoT with jQueryMobile - 기초4
Start IoT with jQueryMobile - 기초4Start IoT with jQueryMobile - 기초4
Start IoT with jQueryMobile - 기초4Park Jonggun
 
Start IoT with jQueryMobile - 기초3
Start IoT with jQueryMobile - 기초3Start IoT with jQueryMobile - 기초3
Start IoT with jQueryMobile - 기초3Park Jonggun
 
Start IoT with jQueryMobile - 기초2
Start IoT with jQueryMobile - 기초2Start IoT with jQueryMobile - 기초2
Start IoT with jQueryMobile - 기초2Park Jonggun
 
Start IoT with jQueryMobile - 기초1
Start IoT with jQueryMobile - 기초1Start IoT with jQueryMobile - 기초1
Start IoT with jQueryMobile - 기초1Park Jonggun
 
Start IoT with JavaScript - 7.프로토타입
Start IoT with JavaScript - 7.프로토타입Start IoT with JavaScript - 7.프로토타입
Start IoT with JavaScript - 7.프로토타입Park Jonggun
 
Start IoT with JavaScript - 6.함수
Start IoT with JavaScript - 6.함수Start IoT with JavaScript - 6.함수
Start IoT with JavaScript - 6.함수Park Jonggun
 
Start IoT with JavaScript - 5.객체2
Start IoT with JavaScript - 5.객체2Start IoT with JavaScript - 5.객체2
Start IoT with JavaScript - 5.객체2Park Jonggun
 
Start IoT with JavaScript - 4.객체1
Start IoT with JavaScript - 4.객체1Start IoT with JavaScript - 4.객체1
Start IoT with JavaScript - 4.객체1Park Jonggun
 
Start IoT with JavaScript - 3.제어
Start IoT with JavaScript - 3.제어Start IoT with JavaScript - 3.제어
Start IoT with JavaScript - 3.제어Park Jonggun
 
Start IoT with JavaScript - 2.연산자
Start IoT with JavaScript - 2.연산자Start IoT with JavaScript - 2.연산자
Start IoT with JavaScript - 2.연산자Park Jonggun
 
Start IoT with JavaScript - 1.기초
Start IoT with JavaScript - 1.기초Start IoT with JavaScript - 1.기초
Start IoT with JavaScript - 1.기초Park Jonggun
 
[SCSA] Thinker 에서 Maker 로
[SCSA] Thinker 에서 Maker 로[SCSA] Thinker 에서 Maker 로
[SCSA] Thinker 에서 Maker 로Park Jonggun
 
[IoT] MAKE with Open H/W + Node.JS - 4th
[IoT] MAKE with Open H/W + Node.JS - 4th[IoT] MAKE with Open H/W + Node.JS - 4th
[IoT] MAKE with Open H/W + Node.JS - 4thPark Jonggun
 
IoT with Raspberry Pi + Node JS - Chapter 2
IoT with Raspberry Pi + Node JS - Chapter 2IoT with Raspberry Pi + Node JS - Chapter 2
IoT with Raspberry Pi + Node JS - Chapter 2Park Jonggun
 
누구나코딩을 V0.04
누구나코딩을 V0.04누구나코딩을 V0.04
누구나코딩을 V0.04Park Jonggun
 
Circulus Introduction
Circulus IntroductionCirculus Introduction
Circulus IntroductionPark Jonggun
 

Mehr von Park Jonggun (19)

라즈베리파이 IoT 시작하기
라즈베리파이 IoT 시작하기라즈베리파이 IoT 시작하기
라즈베리파이 IoT 시작하기
 
Start IoT with jQueryMobile - 기초6
Start IoT with jQueryMobile - 기초6Start IoT with jQueryMobile - 기초6
Start IoT with jQueryMobile - 기초6
 
Start IoT with jQueryMobile - 기초5
Start IoT with jQueryMobile - 기초5Start IoT with jQueryMobile - 기초5
Start IoT with jQueryMobile - 기초5
 
Start IoT with jQueryMobile - 기초4
Start IoT with jQueryMobile - 기초4Start IoT with jQueryMobile - 기초4
Start IoT with jQueryMobile - 기초4
 
Start IoT with jQueryMobile - 기초3
Start IoT with jQueryMobile - 기초3Start IoT with jQueryMobile - 기초3
Start IoT with jQueryMobile - 기초3
 
Start IoT with jQueryMobile - 기초2
Start IoT with jQueryMobile - 기초2Start IoT with jQueryMobile - 기초2
Start IoT with jQueryMobile - 기초2
 
Start IoT with jQueryMobile - 기초1
Start IoT with jQueryMobile - 기초1Start IoT with jQueryMobile - 기초1
Start IoT with jQueryMobile - 기초1
 
Start IoT with JavaScript - 7.프로토타입
Start IoT with JavaScript - 7.프로토타입Start IoT with JavaScript - 7.프로토타입
Start IoT with JavaScript - 7.프로토타입
 
Start IoT with JavaScript - 6.함수
Start IoT with JavaScript - 6.함수Start IoT with JavaScript - 6.함수
Start IoT with JavaScript - 6.함수
 
Start IoT with JavaScript - 5.객체2
Start IoT with JavaScript - 5.객체2Start IoT with JavaScript - 5.객체2
Start IoT with JavaScript - 5.객체2
 
Start IoT with JavaScript - 4.객체1
Start IoT with JavaScript - 4.객체1Start IoT with JavaScript - 4.객체1
Start IoT with JavaScript - 4.객체1
 
Start IoT with JavaScript - 3.제어
Start IoT with JavaScript - 3.제어Start IoT with JavaScript - 3.제어
Start IoT with JavaScript - 3.제어
 
Start IoT with JavaScript - 2.연산자
Start IoT with JavaScript - 2.연산자Start IoT with JavaScript - 2.연산자
Start IoT with JavaScript - 2.연산자
 
Start IoT with JavaScript - 1.기초
Start IoT with JavaScript - 1.기초Start IoT with JavaScript - 1.기초
Start IoT with JavaScript - 1.기초
 
[SCSA] Thinker 에서 Maker 로
[SCSA] Thinker 에서 Maker 로[SCSA] Thinker 에서 Maker 로
[SCSA] Thinker 에서 Maker 로
 
[IoT] MAKE with Open H/W + Node.JS - 4th
[IoT] MAKE with Open H/W + Node.JS - 4th[IoT] MAKE with Open H/W + Node.JS - 4th
[IoT] MAKE with Open H/W + Node.JS - 4th
 
IoT with Raspberry Pi + Node JS - Chapter 2
IoT with Raspberry Pi + Node JS - Chapter 2IoT with Raspberry Pi + Node JS - Chapter 2
IoT with Raspberry Pi + Node JS - Chapter 2
 
누구나코딩을 V0.04
누구나코딩을 V0.04누구나코딩을 V0.04
누구나코딩을 V0.04
 
Circulus Introduction
Circulus IntroductionCirculus Introduction
Circulus Introduction
 

IoT with Raspberry Pi + Node JS - Chapter 3

  • 1. Opensource H/W + Node JS IoT 따라잡기 Day 3
  • 3.
  • 4.
  • 5.
  • 6.
  • 10. Youtube API 사용하기 https 3/get https://developers.google.com/youtube/v3/getting-started 1. 구글 계정 등록 하기 2. API 요청을 위한 Google Application 등록 https://console.developers.google.com/project 3. Youtube Data API 설정 https://developers.google.com/youtube/v3/ https://github.com/google/google-api-nodejs- client/tree/master/examples
  • 11. Youtube API 사용하기 https 3/get https://developers.google.com/youtube/v3/getting-started 1. 구글 계정 등록 하기 2. API 요청을 위한 Google Application 등록 https://console.developers.google.com/project 3. Youtube Data API 설정 https://developers.google.com/youtube/v3/ https://github.com/google/google-api-nodejs- client/tree/master/examples
  • 12. Youtube API 사용하기 https 3/get https://github.com/fvdm/nodejs-youtube/wiki Google API 모듈 설치 $ npm install googleapis NodeJS 선언 var google = require ('googleapis'); google.options ({ auth: 'API KEY' }); var youtube = google.youtube ('v3');
  • 13. Youtube API 사용하기 youtube.search.list ( { part: 'snippet', type: 'video', q: query, maxResults: 50, order: 'date', safeSearch: 'moderate', videoEmbeddable: true }, function (err, res) { if (err) { return callback (err); } res.items.forEach (function (result) { } });
  • 14. Youtube API 사용하기 { id: 'THA_5cqAfCQ', urlShort: 'http://youtu.be/THA_5cqAfCQ', urlLong: 'http://www.youtube.com/watch?v=THA_5cqAfCQ', published: '2012-12-03T15:58:45.000Z', title: 'Cheetahs on the Edge — Director's Cut', description: 'Cheetahs are the fastest runners on the planet. Combining the resources of National Geographic and the Cincinnati Zoo, and drawing on the skills of a Hollywo.', images: { default: { url: 'https://i.ytimg.com/vi/THA_5cqAfCQ/default.jpg' }, medium: { url: 'https://i.ytimg.com/vi/THA_5cqAfCQ/mqdefault.jpg' }, high: { url: 'https://i.ytimg.com/vi/THA_5cqAfCQ/hqdefault.jpg' } }, channelTitle: 'NationalGeographic', channelId: 'UCpVm7bg6pXKo1Pr6k5kxG9A', live: 'none', duration: 428, definition: 'hd' }
  • 16. 라즈베리파이 오디오 (Close Ver) 1. 스마트 폰으로 인터넷 음악을 검색 함 2. 라즈베리파이 서버에서 유투브를 통해 해당 결과 검색 3. 검색 결과에서 듣고 싶은 음악을 선택 4. 선택한 영상을 유튜브에서 다운로드 함 5. 다운로드가 완료되면 라즈베리파이 오디오에서 재생시작 6. 재생 정보를 LCD 에 디스플레이 함
  • 18. Package Install 유튜브 검색을 위한 패키지 v2 – youtube-feeds V3 – youtube-api $ npm install youtube-feeds 유투브 영상 다운로드를 위한 패키지 $ npm install ytdl 미디어 플레이어 설치 $ npm install omxcontrol
  • 19. Source Code var down = exec("ytdl http://www.youtube.com/watch?v=" + data.name + ' > '+ data.name + '.mp4 -q highest', function(err, stdout, stderr) { if (err){ console.log('Error : ' + err); } else { console.log('download complete, start!'); //omx.quit(); $s.send('play', true ); omx.start(data.name + '.mp4'); } });
  • 20. Source Code youtube.feeds.videos({q: data.name}, function(err, data){ if(err instanceof Error){ console.log(err); } else { console.log(data.items.length); var arr = []; for(var i = 0 ; i < data.items.length ; i++){ var item = data.items[i]; arr.push({ id : item.id, desc : item.description, title : item.title, date : item.updated, count : item.viewCount }); } } });
  • 21. Speaker - Module 3.5 mm (Sound) USB (Power)
  • 22. 문제점 1. 라즈베리파이 서버에 접속할 수 있는 근접 거리 (Raspberry Pi WiFi 영역) 에서만 서버에 접속할 수 있음 2. IoT 는 외부/물리적으로 떨어진 공간에서 해당 장치를 제 어해야 하는데, 현 시스템은 불가능 해결책 1. 공인 IP를 라즈베리파이에 적용 -> 공인 IP 의 가격이 비싸서 적용하기 힘듦
  • 23. 라즈베리파이 오디오 (Open Ver) 1. 스마트 폰으로 인터넷 음악을 검색 함 2. 라즈베리파이 서버에서 유투브를 통해 해당 결과 검색 3. 검색 결과에서 듣고 싶은 음악을 선택 4. 선택한 영상을 유튜브에서 다운로드 함 5. 다운로드가 완료되면 라즈베리파이 오디오에서 재생시작 6. 재생 정보를 LCD 에 디스플레이 함
  • 24. Package Install IoT 개발 지원 module 설치 $ npm install circulus
  • 25. Source Code // raspberry pi var ccus = require(‘circulus’); // general doc ccus.tts([메세지], [언어]); ccus.receive([method 명], callback); ccus.send([method 명], callback); ccus.set(key, value); ccus.get(key);
  • 26. Source Code // sensor doc var ccus = require(‘circulus’); var cs = ccus.sensor; cs.getDistance cs.getLight cs.getSound cs.getGyro cs.getTemp cs.getHumidity cs.getEnviorn
  • 27. Expand your dimension Circulus (http://www.circul.us) Since 2013 Park Jonggun, Lee Yunjai, Ki Yeonah, Lee Jonghee