æå ã«äœããªãå ŽåããŸãã¯å®å šã«ãµã€ã¬ã³ããªãµãŒããŒãå¿ èŠãªå Žåã¯ãããã³ã³ãã¥ãŒã¿ãŒã䜿çšããŠã¿ãŠãã ããã
Raspberry Pi 3ã®ãããªãã®ã§ããïŒ
ãããããã£ãšå®ããããã®ã§ãOrange Piã®ãããªãã®ãå¿ èŠã§ãã 1 GB DDR3 RAMãš8 GB EMMCãã©ãã·ã¥ãæèŒããOrange Pi Pc Plusã¢ãã«ãèŠã€ããŸããã
UPDïŒæšæ¥ã誰ããäœããã®åœ¢ã§èšäºãçå£ã«åãæ¢ããŠããŸããããå®éã«ã¯ããã¡ã³ã®ããã«å®éšãè¡ãããããŸããããã©ããã確èªããŸããã åœç¶ã®ããšãªããããç£æ¥çšãã®äœ¿çšã«é¢ãã話ã¯ãããŸãããããã¯ãæ®éã®é³æ¥œã»ã³ã¿ãŒã§ã¹ã¿ãžã¢ã ã鳎ããããšãããããªãã®ã§ãã
ä»ã«äœãå¿ èŠã§ããïŒ
ç°¡åãªæ¹æ³ã§ãã¹ãŠãæ§æãããã®ã§ããªãã¬ãŒãã£ã³ã°ã·ã¹ãã ããã€ã¯ãã³ã³ãã¥ãŒã¿ãŒã«çŽæ¥ã€ã³ã¹ããŒã«ã§ããªããããã«ãŒã¿ãŒãšãã€ã¯ãSDã¡ã¢ãªãŒã«ãŒããžã®ãã€ã¹ããã¢ã±ãŒãã«ãå¿ èŠã§ãã 8ã®ã¬ãã€ãã®ã¡ã¢ãªã«ãŒããèŠã€ããŸããããããã§ååã§ãã
ãã®ããããŸãããªãã¬ãŒãã£ã³ã°ã·ã¹ãã ã®ã€ã¡ãŒãžãã¡ã¢ãªã«ãŒãã«æžã蟌ãå¿ èŠããããŸãã
ãµãŒããŒã«ã€ããŠã¯ãå®çžŸã®ããDebianã䜿çšããããšã奜ã¿ãŸãïŒã¯ããè¥ãäžä»£ã¯CentOSã奜ãå¯èœæ§ãé«ãã§ãããç°è²ã®ã²ããçããã人ã¯DebianããŸã éåžžã«åªããŠããããšã«åæããŸãïŒã
äžè¬çã«ã www.orangepi.org / downloadresourcesã«ã¯Orange Piã®æ¢è£œã®ã€ã¡ãŒãžããããããããŸãããç§ã¯ãŸã www.armbian.com/downloadã«ã¢ã¯ã»ã¹ãã dl.armbian.com / orangepipcplusããarmbianãã¬ã³ããã¡ã€ã«ãããŠã³ããŒãããŸãïŒç§ã®å ŽåïŒ Debian_stretch_next.7zã®å ŽåïŒã
Orange Pi Pc Plusã䜿çšããŠããŸãããä»ã®ããã³ã³ãã¥ãŒã¿ãŒã䜿çšã§ããŸããé©åãªç»åãæ¢ããŠãã ããã
ããŠã³ããŒãããåŸãã¢ãŒã«ã€ãã解åããã€ã¡ãŒãžãimg圢åŒã§è¡šç€ºããŸãã 誰ãäœãæãã§ãããããç»åãå¡ãã€ã¶ããŸããå人çã«ç§ã¯ãšããã£ãŒïŒhttps://etcher.ioïŒã奜ã¿ãŸãã ã¡ã¢ãªã«ãŒããæ¿å ¥ããè€æ°ã®ã¡ãã£ã¢ãæ¥ç¶ãããŠããå Žåã¯ãããéžæãã[çž«ãä»ã]ãã¿ã³ãã¯ãªãã¯ãããã¹ã¯ããããŸãã¯ã©ãããããã«ãLinuxãããå Žåã¯ãã¹ã¯ãŒããå ¥åããŸãã
ç»åã®ããã«ãŒãã®æºåãã§ãããããã¹ãŠã®æ¥ç¶ãéå§ã§ããŸãã
ãµãŒããŒã®ã»ããã¢ãããéå§ããã³éå§ããã«ã¯äœãå¿ èŠã§ããïŒ
ããã³ã³ãã¥ãŒã¿ãŒèªäœãã€ãŒãµãããã±ãŒãã«ãšé»æºãä»ããã€ã³ã¿ãŒãããã
ããã ãã§ãã
ãããããã¡ãããæ··ä¹±ããŠã¢ãã¿ãŒãšããŒããŒããæ¥ç¶ãããã¹ãŠãçŽæ¥æ§æã§ããŸãããã©ãããããã®ããŒããŒãã®æ¹ã奜ããªã®ã§ãSSHçµç±ã§ãªã¢ãŒãã§ããã³ã³ãã¥ãŒã¿ãŒãæ§æããŸãã
ããã§ã¯ãå§ããŸããããã€ãŒãµãããã±ãŒãã«ãArmbianã€ã¡ãŒãžã®ãããã€ã¯ãSDã«ãŒããæ¿å ¥ããŸãã
ããã³ã³ãã¥ãŒã¿ãŒã«é»æºãäŸçµŠããããã ãã«æ®ããŸãã
ããããOrange Piã®é»æºã䜿çšãããšããã¹ãŠãéåžžã«æ²ãããªããŸãã éåžžã®ããã³ã³ãã¥ãŒã¿ãŒã«ã¯äœããããŸããïŒ ãããMicro-USBã§ãããã©ãããã°Orange Piã«é»åãäŸçµŠã§ããŸããïŒ å¥å£²ã®ãã³ã³ãã¯ã¿çµç±ã®5Vã®ã¿ã
é©åãªã³ãã¯ã¿ãåããé»æºã¢ããã¿ã¯ãæåŸã«æšæºã®USBãåããã±ãŒãã«ä»¥äžã®ã³ã¹ãããããããã䜿çšããããšãã§ããŸãã
USBãåããç¡æã®é»æºããªãå ŽåïŒãšã«ããå¿ èŠã¯ãããŸãããã2ã¢ã³ãã¢ïŒãã³ã³ãã¥ãŒã¿ãŒã®ã¯ã€ã€ãŒãã¢ããã¿ãŒãããŒããç®±ã«è©°ã蟌ã¿ãŸãïŒãã®ãããªç®±ããããŸãããïŒïŒãããŠãé©åãªã¢ããã¿ãŒãèŠã€ããŸãåäŸãé·ãéå£ããŠããå€ãã¿ãã¬ãããããã°ãã±ãŒãã«ãã¯ãã ä»ãããŠãµãŒããŒã®é»æºãå ¥ããããšãã§ããŸãã
ããŠããŸãã¯å€ãiRiverãã£ã¹ã¯mp3ãã¬ãŒã€ãŒããå é»åšãåãåºããŠãã ããïŒããã4.7ãã«ãã1.2ã¢ã³ãã¢ã§ããåäœããŸãïŒã
ç§ãã¡ã¯é£ã¹ç©ãæäŸããŠãããå®éã«ã¯ããã¹ãŠãèãåºããããã®ã«ç§»åããæºåãã§ããŠãããã€ã³ã¿ãŒãããã©ãžãªå±ã®åµèšã«åãçµãã§ããŸãã
ç§ã®ããã«ãæå°éã®åšèŸºæ©åšã§ååã«å¯Ÿå¿ããå Žåã¯ãããã³ã³ãã¥ãŒã¿ãŒãåãåã£ãIPã¢ãã¬ã¹ã確èªããå¿ èŠããããŸãã ãããèŠã€ããæãç°¡åãªæ¹æ³ã¯ãã«ãŒã¿ãŒã«ã¢ã¯ã»ã¹ããŠãã«ãŒã¿ãŒããµãŒããŒã«äžããIPã¢ãã¬ã¹ã確èªããããšã§ãïŒã«ãŒã¿ãŒã¯DHCPãå®è¡ã§ããŸããïŒïŒã
ããã§ãSSHçµç±ã§ãµãŒããŒã«ãã°ã€ã³ã§ããŸãã SSHã¯ã©ã€ã¢ã³ãã䜿çšãã人ã¯èª°ã§ã䜿çšããŸãïŒWindowsã䜿çšããããšã¯ãããŸããããSSHã¯ã©ã€ã¢ã³ããäœãããã®ãããããŸããïŒã
ç§ã®å Žåãã³ã³ãœãŒã«ssh root@192.168.0.88ããããã ãã§ãECDSAããŒãè¿œå ããããšã«åæããŸããrootã®ããã©ã«ããã¹ã¯ãŒãã¯ã1234ãã«èšå®ãããŠããããã°ã€ã³ãããšãããã«ãã€ã³ã³ã³ã³ãœãŒã«ã§ã«ãŒããã¹ã¯ãŒãã®å€æŽãææ¡ãããŸãã
ãã®åŸãéç¹æš©ãŠãŒã¶ãŒã¢ã«ãŠã³ããäœæããããšãææ¡ããäœæããŸãã
OSã®ä»¥åã®ããŒãžã§ã³ãšæ¯èŒããŠãçŸåšã®ããŒãžã§ã³ã¯èšå®ã®ç¹ã§ããããç°¡çŽ åãããŠãããå€ãã®ããšããã§ã«èªåçã«æ§æãããŠããŸãã
Armbianã«ã¯éåžžã«äŸ¿å©ãªèšå®ããŒã«ããããŸã
armbian-config
ã¯ã³ãã³ããã³ã³ãœãŒã«ã«ã³ããŒããäœã圹ç«ã€ãã確èªããŸãã
ã·ã¹ãã èšå®ã¯ãŸã å¿ èŠãããŸããããããšãã°ãæ§ææžã¿ã®ã·ã¹ãã ãMicro SDããããã³ã³ãã¥ãŒã¿ãŒã®å èµ8GB EMMCãã©ãã·ã¥ã¡ã¢ãªã«è»¢éããå Žåãªã©ãåŸã§å¿ èŠã«ãªãå ŽåããããŸãã
[ãããã¯ãŒã¯]ã»ã¯ã·ã§ã³ã¯åœ¹ã«ç«ã¡ãŸããããµãŒããŒã®éçIPã¢ãã¬ã¹ãããã°äŸ¿å©ã§ãã åœç€Ÿã®ã€ã³ã¿ãŒãããã©ãžãªã¹ããŒã·ã§ã³ã¯ãWi-Fiçµç±ã§ããããã¯ãŒã¯ã«æ¥ç¶ã§ããŸãã 誰ããèªåèªèº«ã®ããã«åé¯ã®ã¬ãã«ãèšå®ããŸãããããããªããããªãã ãã®ããã«ã€ã³ã¿ãŒãããã©ãžãªãæ§ç¯ããŠããŠãåæã«10人以äžã®ãªã¹ããŒã®èšç»ããªããªããWi-Fiçµç±ã§ç§ãã¡ã®ãµãŒããŒãæ¥ç¶ããŠã¿ãŸãããïŒ æ¥µç«¯ãªå Žåããã€ã§ãã€ãŒãµãããã±ãŒãã«ãæ¥ç¶ã§ããŸãã
ãã®ãããæ¥ç¶ã®ã¿ã€ãã決å®ããŸããã次ã«ãéçIPã¢ãã¬ã¹ãæ§æããå¿ èŠããããŸãããã®ããã«ã¯ãIPèšå®ã«ç§»åããç®çã®ãããã¯ãŒã¯ã€ã³ã¿ãŒãã§ã€ã¹ãéžæããŸãããã®åŸãéçã¢ãã¬ã¹ãå¿ èŠã§ãããšèšãããããéå§ããŠèšå®ãä¿åããŸãã DHCPãä»ããŠã«ãŒã¿ãŒããåä¿¡ãããããããã¹ã¯ãšã²ãŒããŠã§ã€ãå€æŽããå¿ èŠã¯ãããŸããã
æ°ããIPã¢ãã¬ã¹ãå ¥åããŠEnterããŒãæŒããšãããã€ã¹ã«æ°ããIPã¢ãã¬ã¹ãããã«è¿œå ããããããSSHã»ãã·ã§ã³ãããã«ããªãŒãºããŸãã ãããã£ãŠãã¿ãŒããã«ã§ãŠã£ã³ããŠãéããæ°ããIPã¢ãã¬ã¹ã䜿çšããŠSSHçµç±ã§ããã³ã³ãã¥ãŒã¿ãŒã«ç§»åããŸãã
ãšããã§ãç§ãã¡ãæã£ãŠãããã¹ãŠã®æ©èœã¯ç®¡ççãªæ§è³ªãæã£ãŠããã®ã§ãåsudoã³ãã³ãã®åã«çµ¶ããæžã蟌ãŸãªãããã«ãç§ã¯rootãšããŠããã³ã³ãã¥ãŒã¿ãŒã«ãã°ã€ã³ããã ãã§ãã
armbian-config
å床å®è¡ããããšã§ãä»ã«èšå®ã§ãããã®ã確èªã§ããŸããïŒ [å人]ã»ã¯ã·ã§ã³ã§ã¯ãã¿ã€ã ãŸãŒã³ããã±ãŒã«ãããã³ãã¹ãåãæ§æã§ããŸãã ru_RU.UTF-8 UTF-8ãã±ãŒã«ãè¿œå ããŸãããããã¯äŸ¿å©ã§ãã
èšå®ãé©çšããã«ã¯ãæ§æãŠãŒãã£ãªãã£ãçµäºãããã°ã¢ãŠãããŠå床ãã°ã€ã³ããããrebootã³ãã³ãã§ãµãŒããŒãåèµ·åããå¿ èŠããããŸãã
åèµ·åã³ãã³ãã䜿çšããŠãèšå®ãä¿åããããµãŒããŒããã®èšå®ã§æ£åžžã«èµ·åããããšã確èªããŸããã
åºæ¬çãªãµãŒããŒæ§æãäœæãããã®ã§ãå éšEMMCãã©ãã·ã¥ã¡ã¢ãªã«MicroSD OSãæèŒãããªãã¬ãŒãã£ã³ã°ã·ã¹ãã ãã€ã³ã¹ããŒã«ããŠã¿ãŸãããïŒ ãã¡ãããããã³ã³ãã¥ãŒã¿ãŒã«ãã®ã¡ã¢ãªãæèŒãããŠããå Žåã
ãããè¡ãã«ã¯ã
armbian-config
-System-Installã«ç§»åãã䜿çšå¯èœãªãã©ã€ããéžæããŠEnterãæŒããéå»ããã®æšæ¶ãååŸããåæããŠext4ãã¡ã€ã«ã·ã¹ãã ã¿ã€ããéžæããŸãã
ããã§ãOSãããã³ã³ãã¥ãŒã¿ãŒã®å éšã¹ãã¬ãŒãžã«è»¢éãããã®ãåŸ ã€ããšãã§ããŸãã
ã³ããŒãå®äºããããé»æºãåãããšãéžæããŸãã ããã³ã³ãã¥ãŒã¿ãŒã®LEDãæ¶ç¯ããé»æºãæããMicroSDã«ãŒããåãå€ããé»æºãåæ¥ç¶ããŠã³ã³ãã¥ãŒã¿ãŒã®é»æºãå ¥ãããŸã§ãæ°ç§åŸ ã¡ãŸãã
ã¯ããå éšã¡ã¢ãªããªãããªãã¬ãŒãã£ã³ã°ã·ã¹ãã ãããã«è»¢éããªãã£ãå ŽåãMicroSDãåŒãåºãããšã¯ã»ãšãã©ã®å Žåè¯ãèãã§ã¯ãããŸããã
SSHçµç±ã§ããã³ã³ãã¥ãŒã¿ãŒã«ãã°ã€ã³ãããã¹ãŠãæ©èœããããšã確èªããããã©ãžãªå±èªäœã®èª¿æŽãéå§ã§ããŸãã
ãŸãããµãŒããŒã³ã³ãœãŒã«ã«
apt update
ãå®è¡ããŠããã±ãŒãžæ å ±ãæŽæ°ããŸãã
ã¯ããç§ã¯å¿«é©ãã倧奜ããªã®ã§ã
apt install mc
ã³ãã³ãã§
apt install mc
ãŸãã
ç§ã¯mcã®äžãããã¹ãŠãè¡ãã®ã奜ãã§ãã³ã³ãœãŒã«ã衚瀺ããå¿ èŠãããå Žåã¯ãctrl + oãæŒãã ãã§ãã
ãŸããæªéã®é³æ¥œãã¬ãŒã€ãŒèªäœã
apt install mpd
ãŸãïŒ
apt install mpd
ã
å€æ°ã®äŸåé¢ä¿ãã€ã³ã¹ããŒã«ãããŸãã
èšå®ã«ç§»ããŸãããã /etc/mpd.confãã¡ã€ã«ã¯ããŒã¢ã³ã®æ§æãæ åœãã
nano /etc/mpd.conf
ã§éããŸãã
ç§ã®ãŠãŒã¶ãŒåã«ã¯hzsç¹æš©ããªããæ§æãã¡ã€ã«ã¯æ¬¡ã®ããã«ãªããŸãã
music_directory "/home/hzs/music" playlist_directory "/home/hzs/.mpd/playlists" db_file "/home/hzs/.mpd/tag_cache" log_file "/home/hzs/.mpd.log" pid_file "/home/hzs/.mpd/pid" state_file "/home/hzs/.mpd/state" sticker_file "/var/lib/mpd/sticker.sql" user "hzs" bind_to_address "localhost" restore_paused "yes" metadata_to_use "artist,title" auto_update "yes" audio_output { type "httpd" name "My New Internet Radio Station!!!" encoder "lame" # optional, vorbis or lame port "8000" bind_to_address "0.0.0.0" # optional, IPv4 or IPv6 bitrate "256" # do not define if quality is defined format "44100:16:2" } volume_normalization "yes" filesystem_charset "UTF-8" id3v1_encoding "UTF-8"
ããã§ã¯ãã¹ãŠãæ確ã§ãç¹å¥ãªã³ã¡ã³ãã¯ãããŸããã
åäœãããã«ã¯ãèšå®ã®äžãããã£ã¬ã¯ããªæ§é ãäœæããå¿ èŠããããŸãã ãããã®ãã£ã¬ã¯ããªã®ææè ã¯éç¹æš©ãŠãŒã¶ãŒã§ããå¿ èŠãããããšã«æ³šæããŠãã ãããããã§ã¯ãã¹ãŠãæ©èœããŸããç§ã®å Žåã¯hzsã§ãã
ã«ãŒãããã次ã®ã³ãã³ããå®è¡ããŸãã
chown -cR hzs:hzs /home/hzs/music
chown -cR hzs:hzs /home/hzs/.mpd
é³æ¥œãã¢ããããŒãããæãæ¥ãŸããããµãŒããŒã«SSHãããããæ°ã«å ¥ãã®FTPã¯ã©ã€ã¢ã³ãããµãŒããŒã«æ¥ç¶ã§ããŸãã
IPã¢ãã¬ã¹ãããŒã22ããŠãŒã¶ãŒåããã¹ã¯ãŒãã¯ãéç¹æš©ãŠãŒã¶ãŒãSSHæ¥ç¶ã®çš®é¡ãäœæãããšãã«æå®ãããã®ã§ããããšãããã£ãŠããŸãã configã§æå®ãããé³æ¥œã®ãã£ã¬ã¯ããªã«ããã¹ãçšã®é³æ¥œãããã€ã泚ããŸãã
ããã§ããã¬ãŒã€ãŒã¯ééã£ãæ§æã§èµ·åããããããããŒã¢ã³ãåæ¢ããŠåèµ·åããŸãã
service mpd stop
service mpd start
ããŒã¢ã³ãæãç°¡åã«å¶åŸ¡ããã«ã¯ã
apt install mpc
ã³ãã³ãã䜿çšããŠ
apt install mpc
ã³ã³ãœãŒã«ãŠãŒãã£ãªãã£ã
apt install mpc
ãŸãã
ã€ã³ã¹ããŒã«åŸããã¬ãŒã€ãŒãå°ãæ§æããŸãã
mpc random on
mpc repeat on
次ã«ããã©ãã¯ãšãã¬ã€ãªã¹ããè¿œå ããå¿ èŠããããŸããã³ã³ãœãŒã«ã§ã¯å€å°ã®ã¢ãã§ãããäœãã§ããŸããã
ãã¬ã€ãªã¹ãã«è¿œå ã§ãããå©çšå¯èœãªãã¡ã€ã«ã確èªããŸãã
mpc ls
ãã¡ã€ã«ããã¬ã€ãªã¹ãã«
mpc add
ã«ã¯ã
mpc add
ã³ãã³ãã§ãè¿œå ãããã¡ã€ã«ã®ãã«ããŒã ãæå®ããå¿ èŠããããŸãããã¹ã¯ã«ããéžæã¯æ©èœããŸããã
mpc add "01 Lost in Your Eyes.mp3"
çµæã®ãã¬ã€ãªã¹ãã確èªããŸãã
mpc playlist
ã©ãžãªå±ãç«ã¡äžããæãæ¥ãŸããïŒ
mpc play
ãã®ããã«ãä»»æã®ãªãŒãã£ãªãã¬ãŒã€ãŒã§ãã©ãžãªã¹ããŒã·ã§ã³ã®ãªãŒãã£ãªã¹ããªãŒã ãéããŠè©ŠããŠã¿ãŸãããã ãããè¡ãã«ã¯ãã¹ããªãŒã
http://ip:port
ã®ã¢ãã¬ã¹ãå ¥åããŸã
http://ip:port
http://192.168.0.90:8000
ã§ãã
Audaciousã¯æç¶çã«ãã¬ã€ãããã£ãã·ã¥ã«åé¡ããããŸããããSMPlayerãšVLCã¯åé¡ãæããŸããã§ããã
ååãšããŠããã®æ®µéã§ã¯ãã€ã³ã¿ãŒãããã©ãžãªã¹ããŒã·ã§ã³ã¯ãã§ã«åäœããŠããŸããã€ã³ã¿ãŒãããã©ãžãªã¹ããŒã·ã§ã³ãããŒã«ã«ãããã¯ãŒã¯ã®ã©ãžãªã§ã¯ãªãã€ã³ã¿ãŒãããã©ãžãªã¹ããŒã·ã§ã³ã«ãªãããã«ãé³æ¥œããã¬ã€ãªã¹ãã«è¿œå ããã«ãŒã¿ãŒã®ããŒãã転éããå¿ èŠããããŸãã
è€æ°ã®ãã¡ã€ã³ãããã®ã§ãDNSèšå®ã§æåã«è¡ãããšã¯ãtestradioãšèªå® ã®ã«ãŒã¿ãŒã®éçå€éšIPã¢ãã¬ã¹ã§ãAãã¬ã³ãŒããäœæããããšã§ãã ãããè¡ãå¿ èŠã¯ãããŸããã
次ã«ãã«ãŒã¿ãŒã§ãããŒã転éãæ§æããŸãã
倧èŠæš¡ãªãµãŒããŒã«ã¯æ¢ã«ç¬èªã®ã©ãžãªã¹ããŒã·ã§ã³ããããããå€éšãœãŒã¹ããŒã9000ãšå éšããŒã«ã«ããŒã8000ââãæå®ãããããã©ãžãªã®
http://_ip:9000
ãã
http://_ip:9000
ä»ããŠãããŒããã£ã¹ãã
http://_ip:9000
ã
ããã§ããå®éã®ãã€ã³ã¿ãŒãããã©ãžãªå±ãã§ããŸããã
ããã§åæ¢ããããªãå Žåã¯ãããã«é²ãã§ãã ããã
DJã®é³å£°ã¯æŸæ ããŸããããå¿ èŠã«å¿ããŠå®è£ ã§ããŸãããæ¬åœã«å¿ èŠãªã®ã¯ã䟿å©ãªãã¬ã€ãªã¹ã管çã€ã³ã¿ãŒãã§ã€ã¹ã§ãã
ããããã®ç®¡çã³ã³ãœãŒã«ããããããã€ãã¯ããã§èŠãããšãã§ããŸãããç§ã¯Pitchfork MPD Clientã䜿çšããŸãã
ããã¯æ¬æ ŒçãªWebéå£ã§ããã¯ããã¹ãºã¡ã«éãæã¡ãã©ãžãªã¹ããŒã·ã§ã³ãåããããã³ã³ãã¥ãŒã¿ãŒã§æ¬æ ŒçãªhttpãµãŒããŒãèµ·åããŸãã
apt install apache2
PHPãå¿ èŠã§ãã
apt-get install php
ãŸã å¿ èŠ
apt install php7.0-xml
ãããŠ
apt install php-pear
ããŒã ãã©ã«ããŒã«ãã£ã¬ã¯ããª/ home / hzs / wwwroot / pfãäœæããããã«SSHçµç±ã§ããªããŒããããPitchfork MPDã¯ã©ã€ã¢ã³ããå±éããŸãã
apache2 WebãµãŒããŒæ§æãã¡ã€ã«/etc/apache2/sites-available/000-default.conf
nano /etc/apache2/sites-available/000-default.conf
ãã¹ãŠãåã£ãŠæžããŸãïŒãhzsãããŠãŒã¶ãŒåã«å€æŽããããšãå¿ããªãã§ãã ããïŒïŒ
<VirtualHost *:80> ServerName localhost ServerAdmin webmaster@localhost DocumentRoot /home/hzs/wwwroot <Directory /home/hzs/wwwroot/> Options All AllowOverride All DirectoryIndex index.php index.html index.htm Order Allow,Deny Allow from All Require all granted </Directory> </VirtualHost>
次ã«ãhttpãµãŒããŒãåèµ·åããŸã
service apache2 restart
IP / pfãµãŒããŒã®ã¢ãã¬ã¹ã«ç§»åããŸãïŒç§ã®å ŽåïŒ
http://192.168.0.90/pf
:
http://192.168.0.90/pf
ïŒ
ã³ã³ãããŒã«ããã«ã衚瀺ãããŸãã
ãã¹ãŠãéåžžã«ã·ã³ãã«ã§çŽæçã§ãã
次ã«ãå³åŽã®ãã©ã«ããŒã¢ã€ã³ã³ãš[ãã¡ã€ã«ã·ã¹ãã ]ã¿ããã¯ãªãã¯ããŸãã
ãã¡ã€ã«ã®ãªã¹ããæŽæ°ããã«ã¯ã[DBã®æŽæ°]ãã¿ã³ãã¯ãªãã¯ããŸãããã®åŸããŸã ãã¬ã€ãªã¹ãã«ãªãæ®ãã®ãã¡ã€ã«ãéžæããå°ãäžã®[è¿œå ]ãã¿ã³ãã¯ãªãã¯ããŸãã
ããŒãžãæŽæ°ãããã¬ã€ãªã¹ãã«è¿œå ãããã¹ãŠã®ãã¡ã€ã«ã確èªããŸãã
ãã¹ã¯ãŒãã䜿çšããŠãã¬ãŒã€ãŒã³ã³ãããŒã«ãé衚瀺ã«ããå¿ èŠãããå Žåã¯ãæ§æãã¡ã€ã«ãç·šéã§ããŸãã
nano /home/hzs/wwwroot/pf/config/config.xml
èšå®ã«ã¯å®å šã«ç解å¯èœãªæ§é ããããŸãã
ãããã£ãŠã10 * 7 * 3ã»ã³ãã¡ãŒãã«ã®æ¬æ Œçãªã€ã³ã¿ãŒãããã©ãžãªãµãŒããŒãµãŒããŒããããŸãã ãã¡ããã䜿çšãããäœé»åãµãŒããŒã¯äœçŸäººãã®ãªã¹ããŒãåŒãä»ããŸããããå°ãªããšãè¿ãã«ã€ã³ã¿ãŒããããããã°ãã©ãã«ããŠããæ°ã«å ¥ãã®é³æ¥œãææŸãããšã¯ãããŸããã
ååãšããŠãããªãã¯èªã¿ç¶ããããšã¯ã§ããŸããããç¹ã«ç²ã匷ã人ã®ããã«ãç§ãã¡ã¯ç¶ããŸãã
å®å šãªãŠã§ããµãŒããŒããããŸãããªã...
ããŠãããªãã¯ãã§ã«ç解ããŠããŸãã
WebãµãŒããŒã®ã«ãŒãã«testradioãã£ã¬ã¯ããªãäœæãããã®äžã«
"index.php"
ãã¡ã€ã«ãäœæããŸãã
<!DOCTYPE html> <html xmlns="https://www.w3.org/1999/xhtml" xml:lang="ru-ru" lang="ru-ru" dir="ltr"> <head> <meta http-equiv="content-type" content="text/html; charset=utf-8" /> <title>My Test Radio</title> <script src="jquery-3.3.1.min.js"></script> </head> <body> <h1>My Test Radio</h1> <div id="song"> now playing:<br> <div id="title">now playing</div> <br> <div> <span id="play" type="button">Play</span> <span id="pause" type="button">Pause</span> </div> <br> <div> vol:<br> <input id="volume" type="range" min="0" max="10" value="5" /> </div> <span id="duration"></span> <br> <div>256 kbps</div> </div> <script language="JavaScript"> var audio = new Audio('http://testradio.nisel.ru:9000'); var play = document.getElementById('play'); play.addEventListener('click', function() { audio.play(); }, false); var pause = document.getElementById('pause'); pause.addEventListener('click', function() { audio.pause(); }, false); var volume = document.getElementById('volume'); volume.addEventListener('change', function(){ audio.volume = parseFloat(this.value / 10); }, false); audio.addEventListener("timeupdate", function() { var duration = document.getElementById('duration'); var s = parseInt(audio.currentTime % 60); var m = parseInt((audio.currentTime / 60) % 60); var h = parseInt((audio.currentTime / 3600) % 60); if (s < 10) s = '0' + s; if (m < 10) m = '0' + m; if (h < 10) h = '0' + h; duration.innerHTML = h + ':' + m + ':' + s; }, false); </script> <script language="JavaScript"> function show() { $.ajax({ url: "trackname.php", cache: false, success: function(html){ $("#title").html(html); } }); } $(document).ready(function(){ show(); setInterval('show()',5000); }); </script> </body> </html>
ããã¯ããµã€ãçšã®ãã¬ãŒã€ãŒãäœæããæãç°¡åãªäŸã§ãããŸãã5ç§ããšã«ajaxã§æŽæ°ãããçŸåšã®ã³ã³ããžã·ã§ã³ã®ååã衚瀺ããããšãã§ããŸãã
CSSã䜿çšããŠãå€èŠ³ãå³ããããšãã§ããŸãã
ãã®ã³ãŒãã¯ããªãŒãã£ãªã¹ããªãŒã ããã¡ã€ã³ã®DNSã§æå®ãããã¢ãã¬ã¹ã«æ¢ã«éä¿¡ãããŠããããšã瀺ããŠããŸãã
jqueryãã¡ã€ã«ããã£ã¬ã¯ããªïŒç§ã®å Žåã¯jquery-3.3.1.min.jsïŒã«ããããããããšãå¿ããªãã§ãã ããã äžè¬ã«ããã¡ãããjqueryã¯ããã«ãããããŠããããªãã§ajaxãªã¯ãšã¹ããè¡ãããšãã§ããŸãããèããã®ãéåžžã«é¢åã§ããããšãå€æããæ¢è£œã®ã³ãŒãã䜿çšããŸããã
次ã«ããã¡ã€ã«
"trackname.php"
äœæããŸãã
<?php echo file_get_contents('http://192.168.0.90/mpc');?>
ãŸããWebãµãŒããŒã®ã«ãŒãã§ãmpcããã£ã¬ã¯ããªãšãã®äžã«
"index.php"
ãã¡ã€ã«ãäœæããŸãã
<?php echo exec('mpc current');?>
ãªããã®ãããªæŸèæãé Œãããšãã§ããã®ããšãããšãç§ã®è»äºã©ãžãªå±ã§ã¯ããã¬ãŒã€ãŒã®ãµãŒããŒã¯1ã€ã®ãµãŒããŒäžã«ããããµã€ãã®Webãã§ã€ã¹ã¯ç©ççã«ç°ãªãWebãµãŒããŒäžã«ãããŸãã
ãµãŒããŒäžã§çŽæ¥åçãããŠãããã©ãã¯ã«ãã¬ãŒã€ãŒã
"trackname.php"
å¿ èŠããããããmpc WebãµãŒããŒãã£ã¬ã¯ããªããã®äžã«ããå¿ èŠããããŸãããã¡ã€ã«
"trackname.php"
ã¯ãµã€ãèªäœã®WebãµãŒããŒäžã«ãããå¥ã®ãµãŒããŒãããã®IPã¢ãã¬ã¹ã«ãã©ãã¯ã®èª¬æãå«ããã¡ã€ã«ãã¢ããããŒãããŸãã
ãã¬ãŒã€ãŒèªäœãšã©ãžãªå±ã®ãµã€ãã¯éåžžã«é¢ããŠããŠãå€éšIPã¢ãã¬ã¹ãšDNSã§è©°ãŸã£ãã¢ãã¬ã¹ã®äž¡æ¹ã§éä¿¡ââã§ããŸãã ãã¹ãŠãæ©èœããã«ã¯ãããŒããæ£ãã転éããå¿ èŠããããŸãã
ãããžã§ã¯ãã奜ããªããã«å€æŽã§ããŸãããŸããåææ¥ã®ååŸã¯æ¥œããæéãéãããŸããã
ãã¹ãŠã®æåããå®éšïŒ
UPD2ïŒ1é±éã«ãããå®éšãè«ççãªçµè«ã«éãããããã©ãžãªå±ã§ãããµãŒããŒã®é»æºãåããŸããã