找回密碼
 新用戶註冊
搜索
熱搜: hifi av 音樂
查看: 17372|回復: 48

[CAS] 用 Pogoplug 玩CAS

[複製鏈接]
發表於 2013-3-28 16:46:15 | 顯示全部樓層 |閱讀模式
本帖最後由 obee 於 2013-3-28 16:47 編輯

之前出過一個 post 講過如何用 Pogoplug 玩CAS, 不過有師兄希望唔好加埋Cubox, 有D亂, 所以我開此貼只講 Pogoplug 玩CAS.

基本概念如乜野係 Pogoplug, MPD, "如何透過 SSH 去 remote connect Pogoplug" 等等請大家睇番呢度:
http://www.hiendy.com/hififorum/ ... &extra=page%3D1

現在長話短說:
Pogoplug 的 Linux Setup
以下會做兩樣野:
1. 改pogoplug boot order, 令它能boot from USB key (只需做一次)
2. 安裝 Arch Linux

評分

6

查看全部評分

 樓主| 發表於 2013-3-28 16:47:39 | 顯示全部樓層
本帖最後由 obee 於 2013-3-28 16:50 編輯

1. 改pogoplug boot order, 令它能boot from USB key (只需做一次)
1. 取出 Pogoplug, 只插 LAN 線同電線,等2分鐘。
2. 搵部電腦上網去 Pogoplug 個 website: my.pogoplug.com, register 然後登入
3. 登入 my.pogoplug.com 後, 去 "Security Setting" 果頁, enable 個 “Use full security sessions”, 咁先會令你可以透過 SSH login 到 pogoplug. (呢個步驟只需要個一次)
4. 如果你用 MS Widows, Putty 入去,如果你用 Mac, 打開個 "terminal", 輸入 "ssh root@<IP address>" 用, login name=root, password=ceadmin 登入
5. 打以下 command, 逐句 "copy and paste", highlight 完一行, right-click mouse, "copy", 在 putty (login 後) 按一下mouse right click, 再按一下 "enter" 鍵:

  1. cd /tmp
  2. wget http://jeff.doozan.com/debian/uboot/install_uboot_mtd0.sh
  3. chmod +x install_uboot_mtd0.sh
  4. export PATH=$PATH:/usr/sbin:/sbin
  5. ./install_uboot_mtd0.sh
複製代碼
6. 佢load 一陣會問你 "ok"? 你打 "ok", 再按一下 "enter" 鍵
7. 佢load 多一陣會問你 "Y / N"? 你打 "Y", 再按一下 "enter" 鍵
8. 輸入 "poweroff", 關埋 putty, 關埋pogoplug(息電制).
回復

使用道具 舉報

 樓主| 發表於 2013-3-28 16:47:48 | 顯示全部樓層
本帖最後由 obee 於 2013-3-30 12:00 編輯

2. 安裝 Arch Linux
我之前試過在 Pogoplug 上裝不同的 Linux, 最後都係用 "Arch Linux + MPD" 最好, 所以我以下只會介紹 Arch Linux 的安裝 (原文出自: http://archlinuxarm.org/platforms/armv5/pogoplug-v2-pinkgray)

1. 不插任何 USB key, 插電開著 Pogoplug

2. 待綠色LED燈唔閃, 插入 USB key (2G 或以上)

3. SSH 登入 (username=root, password=ceadmin), Windows 用戶可用 putty , Mac 用戶只要開個 "terminal" 打 "ssh root@IP"

4. 打以下command:

  1. fdisk /dev/sda
複製代碼
鍵入 o, 拍 "enter"
鍵入 n, 拍 "enter"
鍵入 p, 拍 "enter"
鍵入 1, 拍 "enter", 再拍 "enter"
鍵入 w, 拍 "enter"

5. 打以下command:
  1. cd /tmp
  2. wget http://archlinuxarm.org/os/pogoplug/mke2fs
  3. chmod 755 mke2fs
  4. ./mke2fs -j /dev/sda1
  5. mkdir usb
  6. mount /dev/sda1 usb
  7. cd usb
  8. wget http://archlinuxarm.org/os/ArchLinuxARM-armv5te-latest.tar.gz
  9. tar -xzvf ArchLinuxARM-armv5te-*.tar.gz
  10. sync
  11. cd ../
  12. umount usb
  13. /sbin/reboot
複製代碼
6. Pogoplug 會 reboot, 等燈閃定左, 又可以 login (username=root, password=root)

7. 打以下command:

  1. pacman -Syu
  2. pacman -S mpd alsa-utils mpc nfs-utils unzip git gcc make bc ntfs-3g
複製代碼
要答好多"Y", 佢問你"Y/N"時你只要拍"enter"便可. 如果出現 "resource not found", 再重行個 command, 佢有時個 server 會斷線, 過下又可以通番.

8. 繼續打以下command:

  1. mkdir /music
  2. mkdir /var/lib/mpd/playlists
  3. touch /var/lib/mpd/mpd.db
  4. touch /var/lib/mpd/mpdstate
  5. touch /var/lib/mpd/sticker.sql
  6. touch /run/mpd.pid
  7. touch /run/mpd.log
  8. gpasswd -a mpd audio
  9. chown -R mpd:audio /var/lib/mpd
  10. chmod 777 /run/mpd.pid /run/mpd.log
複製代碼
9. Map drive (經NAS share file)
有兩個方法可以令 NAS share file 出來:Windows File Sharing (Samba / CIFS) 及 Network File Sharing (NFS), 你睇番自己想用邊個,就做 9.1 或 9.2
9.1 Windows File Sharing (CIFS)

  1. echo "192.168.1.2:/Multimedia/MUSIC /music cifs username=user,password=12345,file_mode=0644,dir_mode=0755,iocharset=utf8 0 0" >> /etc/fstab
複製代碼
以上的"192.168.1.2:/Multimedia/MUSIC"入乜野人人唔同,你要了解你個 Windows share name係乜user同password係乜,然後輸入番合你用的資料!

9.2 NFS
  1. echo "192.168.1.2:/volume1/music /music nfs soft,fg,retry=0,nolock 0 0" >> /etc/fstab
複製代碼
以上的"192.168.1.2:/volume1/music"入乜野人人唔同,你要了解你個 NFS share name係乜,然後輸入番合你用的 share name!

10. 打以下command:

  1. rm /etc/mpd.conf
複製代碼
Upload (download mpd.zip (421 Bytes, 下載次數: 3669) , unzip & upload to pogoplug at "/etc") 或用 vi 重新寫以下的 mpd.conf

  1. music_directory       "/music"
  2. playlist_directory    "/var/lib/mpd/playlists"
  3. db_file               "/var/lib/mpd/mpd.db"
  4. log_file              "/run/mpd.log"
  5. pid_file              "/run/mpd.pid"
  6. state_file            "/var/lib/mpd/mpdstate"
  7. sticker_file          "/var/lib/mpd/sticker.sql"
  8. user                  "mpd"
  9. group                 "audio"
  10. zeroconf_enabled        "yes"
  11. zeroconf_name           "Pogoplug"
  12. mixer_type              "disabled"

  13. audio_output {
  14.         type            "alsa"
  15.         name            "ALSA Device"
  16.         device          "hw:0,0"
  17. }
  18. audio_buffer_size               "2048"
  19. buffer_before_play              "10%"
複製代碼
11. 打以下command:

  1. sync
  2. reboot
複製代碼
應該開 iPad 的 mpad 可以見到同 connect 到, 做一次"refresh database" 等10-20分鐘再 "refresh local cache" 便可播歌.

評分

1

查看全部評分

回復

使用道具 舉報

發表於 2013-3-29 12:01:42 | 顯示全部樓層
obee ching,
I succeeded all the installation, the mpd is running in ArchLinux. But still can't play music. I encounter some problems:
1. The way to map the NFS and input the correct path pointing to Synology NAS music folder,
2. Using Android phone/pad, the setting in the players, the port, the password etc.

Many thanks for your detailed step by step installation guide.  
回復

使用道具 舉報

 樓主| 發表於 2013-3-29 12:16:14 | 顯示全部樓層
CAS2012 發表於 2013-3-29 12:01
obee ching,
I succeeded all the installation, the mpd is running in ArchLinux. But still can't play  ...

Sorry, I forget to update "mpd.conf" in the tutorial, please go to download mpd.zip, unzip it (there is one file called mpd.conf inside) and upload to "/etc", overwrite existing one. Then run command:

  1. sync
  2. reboot
複製代碼
You should be able to see the pogoplug in ipad after reboot.
回復

使用道具 舉報

發表於 2013-3-29 14:13:24 | 顯示全部樓層
obee hing,
I think for non-Linux like me, a lot to learn vi to edit text. Is it possible to install gedit or user friendly text editor?
My pogoplug's name in putty some how changed to "alarm", so my pogoplug ID is alarm, right?
回復

使用道具 舉報

 樓主| 發表於 2013-3-29 15:04:44 | 顯示全部樓層
CAS2012 發表於 2013-3-29 14:13
obee hing,
I think for non-Linux like me, a lot to learn vi to edit text. Is it possible to install  ...


Sorry, I only know "vi", that's why I use it...
For hostname, you may change it by yourself, it's defined inside /etc/hostname
For "ID", do you mean the name as shown in ipad mpad? It is defined in mpd.conf. I used "Pogoplug" in the mpd.conf as provided above. (zeroconf_name           "Pogoplug")
回復

使用道具 舉報

發表於 2013-3-29 17:27:48 | 顯示全部樓層
Inside /etc/hostname, I saw the hostname is "alarm", I will change back to "pogoplug" to be in line with your tutorial on mpd.conf setting.
Meanwhile, I am learning vi from web site and utube.
回復

使用道具 舉報

發表於 2013-3-29 18:29:28 | 顯示全部樓層
Hello Obee hing

When I type wget http://archlinuxarm.org/os/pogoplug/mke2fs, the Pogoplug said wget: can't open 'mke2fs': Read-only system.

How to fix it ?
回復

使用道具 舉報

發表於 2013-3-29 18:49:18 | 顯示全部樓層
本帖最後由 CAS2012 於 2013-3-29 18:50 編輯

I think I come across this problem, may try change the directory to "cd /tmp" after reboot

評分

1

查看全部評分

回復

使用道具 舉報

發表於 2013-3-29 20:40:57 | 顯示全部樓層
CAS2012 發表於 2013-3-29 18:49
I think I come across this problem, may try change the directory to "cd /tmp" after reboot


Thanks CAS2012 hing.  It works.

However my mpd client cannot connect the pogoplud mod.  Still working on it.  Hope someone can help.

I attached a USB drive at the front USB port.
回復

使用道具 舉報

發表於 2013-3-30 10:21:16 | 顯示全部樓層
obee ching,
I changed the hostname to "Pogoplug", and edited the mpd.conf by vi. All done, but still cannot use Andriod phone to connect to the mpd sever.
If I want to make things simple not using NAS as music sever (still trying to learn the IP config), just hook a USB flash memory or a USB HDD to pogoplug, and play music. What  steps should I do?
回復

使用道具 舉報

 樓主| 發表於 2013-3-30 11:54:44 | 顯示全部樓層
CAS2012 發表於 2013-3-30 10:21
obee ching,
I changed the hostname to "Pogoplug", and edited the mpd.conf by vi. All done, but stil ...

Play from USB is more difficult. So I won't tell in here.
回復

使用道具 舉報

 樓主| 發表於 2013-3-30 12:00:34 | 顯示全部樓層
elo 發表於 2013-3-29 18:29
Hello Obee hing

When I type wget http://archlinuxarm.org/os/pogoplug/mke2fs, the Pogoplug said wget ...

Sorry, missing the "cd /tmp".
Updated in above, thanks.
回復

使用道具 舉報

發表於 2013-3-30 12:06:51 | 顯示全部樓層
本帖最後由 CAS2012 於 2013-3-30 12:08 編輯

obee ching,
I try to run "mpd", just type in "mpd" command, I check in "top", there is no mpd process running, any method to activate and verify mpd is running.
回復

使用道具 舉報

發表於 2013-3-30 17:28:47 | 顯示全部樓層
本帖最後由 CAS2012 於 2013-3-30 17:31 編輯

obee ching,
I look up ArchLinux mpd  setup settings for an hour, try to figure out why mpd and Android phone cannot be connected. When I type in "mpd" to activate, it always shows something wrong with mpd.pid file. I check again the setting of mpd.pid in your setup,

05.pid_file              "/run/mpd.pid"

I think you miss out mpd directory, it should be

05.pid_file              "/run/mpd/mpd.pid"

I can now connected to mpd, but still cannot play music as the pointer to NAS still need to be fixed
回復

使用道具 舉報

發表於 2013-3-30 18:54:23 | 顯示全部樓層
I think I made the mpd  run for a while after created the missing mpd.pid files but then suddenly seems the USB drive corrupted and cannot be recognised by pogoplug and also cannot boot up.  Will redo the installation again next week.
回復

使用道具 舉報

發表於 2013-3-30 19:12:48 | 顯示全部樓層
I saw my mpd running in "top", but don't know how to mount the Synology NAS.

Synology IP:  192.168.1.4
music in folder:  Volume1/music  (the default share folder)

Tried
#echo "192.168.1.4:/Volume1/music /music nfs soft,fg,retry=0,nolock 0 0" >> /etc/fstab

Not successful, can any high hand helps, thanks.
回復

使用道具 舉報

發表於 2013-3-31 13:07:28 | 顯示全部樓層
CAS2012 發表於 2013-3-29 14:13
obee hing,
I think for non-Linux like me, a lot to learn vi to edit text. Is it possible to install  ...

Besides of "vi", you may try "nano", which is another text editor.
回復

使用道具 舉報

 樓主| 發表於 2013-4-2 11:29:27 | 顯示全部樓層
CAS2012 發表於 2013-3-30 19:12
I saw my mpd running in "top", but don't know how to mount the Synology NAS.

Synology IP:  192.168. ...

ching, if you have difficulty in following the installation steps above, you may try VAMP, which is much easier to setup:
http://www.review33.com/avforum/ ... opic=53121030153425
回復

使用道具 舉報

您需要登錄後才可以回帖 登錄 | 新用戶註冊

本版積分規則

Archiver|小黑屋|聯絡我們|刊登廣告|Hiendy.com 影音俱樂部 一個屬於音響愛好者的家

GMT+8, 2025-11-10 02:37 , Processed in 0.050323 second(s), 23 queries .

Powered by Discuz! X3.5

© 2001-2024 Discuz! Team.

快速回復 返回頂部 返回列表