라즈베리파이로 MP3 스트리밍 서버를 만들어 볼 생각입니다.
모든 소스를 처음부터 만들면 힘들기 때문에,,ㅎㅎ(지식의 한계도??ㅋ)
이래저래 검색해보니 좋은 패키지가 있더군요.
Cherry Music 이라는 파이썬으로 만들어진 뮤직 스트리밍 서버를 이용하였습니다.
CherryMusic
A music streaming server written in python:
Stream your own music collection to all your devices!
- ✓ free & open-source (GPL)
- ✓ easy setup, download and go
- ✓ blazingly fast search
- ✓ share playlists with your friends
오픈소스 이구요, 설치 및 세팅이 비교적 쉽습니다.
다만, 오픈소스이다 보니
세련된 인터페이스는 아니고,,, 소소하게 이용할만한 합니다.
HTML5
You can listen to your music on all HTML5 compliant devices, that includes your pretty smart phone (Android or iPhone) as well as just about any modern browser.
HTML5가 호환되면 사용할 수 있다고 나와있는데, 갤럭시노트4에서
웹으로 접속해보니 잘되드라구요~
약간의 디자인 밀림이 있긴 하지만, 모바일에 맞도록 UI는 수정하면 충분할 거 같습니다.
The CherryMusic server runs on Linux, Windows and OS X, as long as Python and SQLite are available. To use the web client, any device with a modern browser will do.
다양한 운영체제에서 지원됩니다.
공식홈페이지는 아래와 같습니다.
http://www.fomori.org/cherrymusic/index.html
이제 라즈베리파이에서 설치해보겠습니다.
음악 스트리밍서버 구축하기 시작
라즈비안에서 터미널을 열고,
1. 최신버전으로 업데이트 합니다.
pi@raspberrypi:~ $ sudo apt-get update
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 | pi@raspberrypi:~ $ sudo apt-get update Hit http://archive.raspberrypi.org jessie InRelease Get:1 http://mirrordirector.raspbian.org jessie InRelease [14.9 kB] Get:2 http://mirrordirector.raspbian.org jessie/main armhf Packages [8,981 kB] Hit http://archive.raspberrypi.org jessie/main armhf Packages Hit http://archive.raspberrypi.org jessie/ui armhf Packages Get:3 http://mirrordirector.raspbian.org jessie/contrib armhf Packages [37.5 kB] Get:4 http://mirrordirector.raspbian.org jessie/non-free armhf Packages [70.3 kB] Get:5 http://mirrordirector.raspbian.org jessie/rpi armhf Packages [1,356 B] Ign http://archive.raspberrypi.org jessie/main Translation-en_US Ign http://archive.raspberrypi.org jessie/main Translation-en Ign http://archive.raspberrypi.org jessie/ui Translation-en_US Ign http://archive.raspberrypi.org jessie/ui Translation-en Ign http://mirrordirector.raspbian.org jessie/contrib Translation-en_US Ign http://mirrordirector.raspbian.org jessie/contrib Translation-en Ign http://mirrordirector.raspbian.org jessie/main Translation-en_US Ign http://mirrordirector.raspbian.org jessie/main Translation-en Ign http://mirrordirector.raspbian.org jessie/non-free Translation-en_US Ign http://mirrordirector.raspbian.org jessie/non-free Translation-en Ign http://mirrordirector.raspbian.org jessie/rpi Translation-en_US Ign http://mirrordirector.raspbian.org jessie/rpi Translation-en Fetched 9,105 kB in 23s (383 kB/s) Reading package lists... Done | cs |
2. 최신버전에 맞춰 업그레이드 진행
pi@raspberrypi:~ $ sudo apt-get upgrade
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 | pi@raspberrypi:~ $ sudo apt-get upgrade Reading package lists... Done Building dependency tree Reading state information... Done Calculating upgrade... Done The following packages have been kept back: chromium-browser libgl1-mesa-dri pprompt rpi-chromium-mods sonic-pi xserver-xorg-input-all The following packages will be upgraded: libevent-2.0-5 libjasper1 libpam-modules libpam-modules-bin libpam-runtime libpam0g lxpanel lxpanel-data pix-plym-splash pixel-wallpaper raspberrypi-sys-mods rc-gui realvnc-vnc-viewer vim-common vim-tiny 15 upgraded, 0 newly installed, 0 to remove and 6 not upgraded. Need to get 32.4 MB of archives. After this operation, 1,532 kB disk space will be freed. Do you want to continue? [Y/n] y | cs |
3. Git Hub 이용을 위한 Git-core 설치하기
pi@raspberrypi:~ $ sudo apt-get install -y git-core
4. 라즈베리파이에 Cherry Music 설치하기
pi@raspberrypi:~ $ git clone git://github.com/devsnd/cherrymusic.gitl -y git-core
5. 설치가 완료되면 이제 체리뮤직서버를 구동합니다.
pi@raspberrypi:~ $ $ cd cherrymusic
pi@raspberrypi:~/cherrymusic $ python cherrymusic --setup --port 8080
1 2 3 4 5 6 7 | pi@raspberrypi:~/cherrymusic $ python cherrymusic --setup --port 8080 Starting setup server on port 8080 ... Open your browser and put the server IP:8080 in the address bar. If you run the server locally, use: localhost:8080. | cs |
8080포트로 서버가 시작되었습니다~~!!!
쉽죠~~~?ㅎㅎㅎ
이제 해당IP로 접속해봅니다.
빈 웹페이지를 열고~
GoGo -------> http://본인 IP : 8080
환경설정을 먼저 하라고 화면이 뜹니다.
간단히 디렉토리를 설정하고
저는 요렇게 넣었습니다. --> /home/pi/Music
당연히 저 폴더에 MP3파일을 넣어놓아야 겠죠??ㅎㅎ
데비안과 체리뮤직 설치에 대한 자세한 설명이 나온 글입니다.
재접속 하고 계정을 생성합니다.
계정이 생성되면 이제 로그인을 해서 사용해봅니다.
재생이 잘 되나요~~??
라즈베리파이에 열어놓은 터미널에는 사용자 접속정보가 실시간으로 올라오게 됩니다.
[170224-14:08] 1X.XX.XXX.XXX - - [24/Feb/2017:14:08:19] "POST /api/heartbeat HTTP/1.1" 200 14 "http://1X.XX.XXX.XX:8080/#" "Mozilla/5.0 (compatible; MSIE 9.0; Windows NT 6.1; APCPMS=^N201310210234087378561FB0A79A0FD8D33F_18^; Trident/7.0)"
[170224-14:08] 1X.XX.XXX.XX - - [24/Feb/2017:14:08:32] "POST /api/heartbeat HTTP/1.1" 200 14 "http://1X.XX.XXX.XX:8080/" "Mozilla/5.0 (X11; Linux armv7l) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/51.0.2704.91 Safari/537.36"
MP3파일을 쉽게 관려하려면
FTP서버를 구축하거나 SAMBA서버를 구축해서 사용하시면 훨씬
편해집니다.
산딸기 마을에 좋은 정보가 많이 있습니다. !!
http://www.rasplay.org/?p=4361
스트리밍 서버를 구축하고 모바일로 접속해보았습니다.
웹페이지에서 구동되는게 나름 쓸만해보이는데~~ 고정아이피도 아니고,
방화벽 때문에 오픈이 되어있지 않아서,,,
막 돌아다니면써 쓰지는 못하겠네요 ㅎ
모두들 많이 사용해보시기 바랍니다~~~
'프로그램개발 > RaspberryPi3' 카테고리의 다른 글
라즈베리파이3(RaspBerry Pi) 리콜박스로 게임기 만들기 (0) | 2017.03.14 |
---|---|
라즈베리파이3(Raspberry Pi) Apache웹서버 & WordPress 설치하기 (1) | 2017.02.03 |
라즈베리파이3(Raspberry Pi) 해상도 변경 (0) | 2017.01.30 |
라즈베리파이3(Raspberry Pi) 한글설치하기 (0) | 2017.01.23 |
라즈베리파이3(Raspberry PI) WiFi 설정 (2) | 2017.01.20 |