Sunday, January 27, 2013

Using your Pogoplug with LMS

Observations
I had a problem last night where it was very slow in responding.
But, I had been tweaking the options in my wireless router, and had messed with things when I was setting up a 2nd pogo.

I elected to reinstall everything, I reimaged the USB stick to the VAMP image and then reinstalled LMS. At this point, my network didn't show the Pogo anywhere, so I did it one more time, and it worked fine.

Shutdown
I always shutdown by typing "shutdown now" from a putty session, but there were times when I would shutdown, restart, and it wouldn't come back on my network.
I think I wasn't waiting long enough.
When you unplug power, leave it powered down for at least a minute before plugging power back in.
When I do that, it always seems to come up.

Fixing problems
It is a pretty simple system, but I have had a couple problems, and it can be a little hard to figure out what's going on.

One problem I had was somehow my USB hard drive got messed up, and then things stopped working, caused some head scratching.
So, if your Pogo stops coming up, so you don't see the green light, can't log in or see it in your internet program anymore, then try turning it off, unplugging the hard drive, and turn it back on and see if it works then.  It if works without the hard drive, you need to check your hard drive.

EDIT Feb 24
I have also had problems where the hard drive was fine, but the pogo wouldn't come up with the hard drive connected, but if I disconnect the hard drive, then it does come up.

If you type "df" in a pogo session, you should see something like this:


Filesystem           1K-blocks      Used Available Use% Mounted on
tmpfs                   127204         0    127204   0% /lib/init/rw
udev                    125128       144    124984   1% /dev
tmpfs                   127204         4    127200   1% /dev/shm
rootfs                 3096336    918248   2020804  32% /
tmpfs                   127204         0    127204   0% /tmp
/dev/sdb1            488383484 129274624 359108860  27% /music


I typed in DF and got some error message, so I decided to just rebuild the stick.

I  reinstalling VAMP on the usb stick, and then reinstalling LMS on the VAMP.
That's when I decided to get an extra stick, and make an image of the stick after LMS was installed, so I would always have a backup copy of LMS I could just copy to a stick.
I added instructions on how to do this on my setup page.


Adding files to LMS/Pogo
Since you overwrote the Pogo software, you can't write to the Pogo like it was intended.
But, there is an easy way to add music to your Pogo, a program called WinSCP.
http://winscp.net/eng/index.php

It gives you a graphical interface so you can drop and drag your files from your PC to the Pogo.

Install it, and log into the Pogo using the same info as putty.

Click to go back to the root directory

Click on the music folder, and you should see your USB hard drive.

Just add the files whereever you want on the hard drive, and then you can rescan in LMS.


iPhone apps

There is a nice Logitech iPhone app that you can use as a remote control.
https://itunes.apple.com/us/app/logitech-squeezebox-controller/id431302899?mt=8

In spite of the bad reviews, I like it, and I don't have to log in every time, so I don't know what people are complaining about.



There are also SSH terminal apps you can use instead of putty.
I have been using serverauditor because it's free, and works for me
https://itunes.apple.com/us/app/server-auditor-ssh-client/id549039908?mt=8

You can set it up to log in automatically, so you don't need to type the login info every time.

After it connects, then touch the line and it will give you a terminal view.
At the terminal view, if you do an upward swipe, it shows the last command used.  Another swipe and the command before that, so you can easily call up the commands you have been using instead of typing them in.

I mostly use this app to shutdown, and I usually don't have to go back very far to find a shutdown.

They do have other most sophisticated ssh terminal apps, but most are not free.  This one is free, and is easy for me to use, and does what I need.


Notes:
cd /scripts
copy "hd-idle-1.03-bin.tar.gz" from the /scripts to root
I used winscp to do this, and copied the file to my PC, and then to root.


Go to root and then unpack it
cd /
tar -xvzf  hd-idle-1.03-bin.tar.gz

editor nano filename
cd /etc/default

nano /hd-idle

Change line to "START_HD_IDLE=true"

view and change permissions
cd /usr/sbin
stat hd-idle
chmod 777 hd-idle

run it (you need to stay in the sbin directory)
/etc/init.d/hd-idle start

Friday, January 25, 2013

Pogoplug Music Server for $30

EDIT
Feb 24
Deleted network setup because it is not required
Added info for creating a backup usb stick image
Added info for using LMS 7.8

Feb 2
I gave up trying to run Logitech Music Server and a USB DAC from the same Pogo.
I am trying to run separately for now, and see if that works OK.
Sometimes it would work OK, and sometimes LMS would not come up.

Jan 29, I was having problems, but it turned out to be a problem with the USB hard drive.
I think the instructions are OK now.


OK, its a little more than $30, depends on what you already have.

But, you get a little box that can be a music server running Logictech Music Server, and it can also drive a USB DAC, you just need to add the DAC.


The Pogoplug is $25 shipped from here
http://astore.amazon.com/vort-20/detail/B0044CL1N0

It needs to be the E02 model, I bought from this link, and got a pink E02, so it was good for me.

Buy a USB memory stick
Directions call out for a 4GB stick, I bought an 8GB, and it worked fine.
Another $8, so now you are at $30.

Instructions for setting up the Pogoplug to be able to act as a music player are here
http://vortexbox.org/content/150-Building-the-VAMP
But, I tried to follow the directins here, and I couldn't get it to work (they deleted some steps, I'm not sure why).

go to
my.pogoplug.com
and register you pogoplug there

Select "Settings" in the upper right
then select "Security" on the left

Check box by
"Enable SSH access for this Pogoplug device"

It will ask for a password, enter one.

Find the ipaddress for the Pogoplug

If you have trouble figuring out the IP address of the pogoplug, the easist way (at least for me) is if you can log in to your router, and have it display a list of the IP addresses on the network.

Otherwise, there are free IP scanners on the internet.
For windows, I used the Colasoft MAC Scanner

Someone had problems when he plugged in the Ethernet through a couple of switches between the Pogo and the router, so I would recommend plugging the Pogo directly into the router, especially when you first set it up, until you have it working like you want.  Once it is working, and you make sure it works after a long power down, then you can try adding switches to see if it makes a difference.
At the end of this page, I talk about adding a wireless device, so you don't need a hard ethernet connection.

Install Colasoft, and have it scan your net.
Read the ID from the bottom of the Pogo, and find it in the list from Colasoft.
Here is my Pogo.  The number on the right is on the bottom of the pogo, the number on the left  is your IP address

Now you can use Putty to log in, but it is kind of basic.
I used extraputty because you can add scripts to it.

Use "root" for user name.

It will ask for the password, use password that you entered when you turned on ssh access.

If you are using a max, you can use terminal instead of putty.

On putty, type the following (or cut and paste, use right click to paste into putty screen)

cd /tmp
wget http://jeff.doozan.com/debian/uboot/install_uboot_mtd0.sh
chmod +x install_uboot_mtd0.sh
export PATH=$PATH:/usr/sbin:/sbin
./install_uboot_mtd0.sh
After install instruction, type "yes" because it will ask you to.

type "yes" again to disable pogoplug services.

Type
fw_setenv arcNumber
fw_setenv machid dd6

Put the USB key into the front port on the PogoPlug and type reboot in your ssh window.

The PogoPlug should go dark then come back up with an orange LED instead of the green one.

You can now SSH to your VAMP. The user is root and the password is nosoup4u

Make sure you can log in and everything is working. Then connect your USB DAC and reboot again.

From terminal in OSX, the 2nd time you log in (step 12), terminal won't let you log in because the ID changed from before.
You need to go to the root of the hard drive, then go to Users\username\.ssh
Delete the known_hosts file

use the same format as before:
"ssh root@xxx.xxx.xxx.xxx" where xxx.xxx.xxx.xxx is the IP address of the pogoplug.
It will ask for the password, use password nosoup4u here, and from now on.

If you add a USB DAC to a “VAMP”, then you will basically have a device that connects through Ethernet, and lets you play music from the USB DAC.

If you type
http://xxx.xxx.xxx.xxx
where xxx.xxx.xxx.xxx is the VAMP address, you should get this




You can stop here, but I didn’t.

At this point, you should have the USB DAC connected, and the USB memory stick.  You should not have the USB hard drive connected yet, you will connect during the music server setup.  If it is connected, just shutdown, and disconnect, then power up again.

You shutdown by typing "shutdown now" in putty.

Adding the Music Server Software
Initially, I tried a different method, but later I found an easier way to do this.

Connect to the Pogo with whatever “putty” type SSH terminal program you used to set it up with the vortexbox instructions that were used previously.

Type “Setup” at the prompt, and the following screen will be displayed.




Select "Library Music-Library Configuration" and OK



Select OK



Connect the USB hard drive now.

Select "USB USB drive" then OK




This is what I got for my drive. I just selected "Yes"



Select "Yes" and let it reboot.

Wait a couple of minutes


NOTE: at this point, if you are having trouble, it could be a problem with the hard drive. I had this problem, and Pogo stopped coming up, either on the internet browser or on Putty. Removing the USB hard drive got it to come up again.

I ended up reformatting the drive (not a quick format, maybe overkill) to fix the drive.
 

Then, you can go to putty, log in and type "setup" again.



Select “Media-Server Install a Media-Server”, then OK



Select “Squeezebox Install a Squeezebox-Server (free)” then OK



Select "Install Install SqueezeBox on this device" then OK


Select OK

Accept the license, then you will get this:



Select OK, and then installation will start
At some points, screen will stop scrolling for a while, but just be patient.
EDIT Feb 24
I started to used a newer version of LMS, can be found here
LMS Ver 7.8


You need to type this in on the blank line
http://downloads.slimdevices.com/nightly/7.8/sc/2e3000d/logitechmediaserver_7.8.0~1353679004_all.deb

Or just hit OK with the line blank and ver 7.7 will be installed.

For some reason, 7.8 failed to install a couple times, so I uninstalled it, and installed again, and it eventually worked OK.


It took about 10 mins for my installation.

This screen will pop up.


Select OK, then Quit until you get back to the main menu screen.


EDIT Feb 24, 2013  
Deleted Network Configuration stuff, it is not required.



Wait a few minutes, for the light on the front to turn green, then you should be able to open your internet program and
Type "http://xxx.xxx.xxx.xxx:9000"


The Logitech Media Server will open


Login to your account, and then you will get this.





Click on the + by "Music", and you should see the contents of your USB hard drive.

Pick you music directory, then pick your playlist directory.

Go to "Settings" (lower right corner), then "Basic Settings" then pick "English" (or whatever), and then you should be able to see your music.

You can now setup the options however you want.

It should now work as a music server.


Wireless Option
Wired Ethernet is not convenient for me, I wanted to add wireless to it.
I bought one of these since I work by Frys, and it is pretty inexpensive, $20
http://www.frys.com/product/6980167?site=sr:SEARCH:MAIN_RSLT_PG
This is a TP Link model TL-WR702N.

Any router that supports client mode, and the security you use for wireless (ie WEP, WPA, WPA2) will work. I had some old routers that only support WEP, and when I upgraded my security to WPA2 these routers no longer work for me.

Set the the Nano Router to client mode, following the instructions included with it. The router I used doesn't have a switch to set the modes, so you have to do it in software, but it's pretty simple once you connect to it.

I basically just followed the instructions, connected it to my Pogoplug instead of the Ethernet interface, and it worked.

Usually the hardest part about setting up routers is that you might have to change the IP address of the PC you use to set it up. Just remember to revert your settings after you finish setting up the router. I forgot for a while, and had some troubles until I remembered to go back to what it was.

As a bonus, the Nano router is powered via USB, and you can use one of the Pogoplug USB ports to power the router.

It's a very small little box, and now you have a wireless USB DAC.

Cost is up to $50, plus the cost of the DAC.

After I had wireless working, I wanted to assign the IP address in DNS so the address won't change.  Names don't work for me, so I just use addresses.

For me, I need to log into my wireless router, and go to the Ethernet setup page, and I can assign a mac address to a IP address, and name it so I remember what machine it is.

The only wierd thing is on a status page, for the Pogo IP address, I see the mac address for the router, and on the Ethernet setup page, I see the mac address for the Pogo.  But it seems to work OK.

Backup USB stick image
At some point, my USB stick image somehow got corrupted.
I decided to buy an extra 4gb stick, all my other sticks a 8gb because the price difference is small.
I setup the 4gb stick per the instructions above, installing vamp then LMS on the stick.
I setup LMS, scanned my music library, and stopped the plugins I don't use.

After that, I started a putty session, then "shutdown now" to shutdown the Pogo.

Pulled power, and removed the stick.

Put the stick into the PC where you ran the USB Image tool to put the VAMP image on it.
Start the USB Image tool, and then select the stick, and select backup.  It asks for a name, give it a name you'll recognize, I called it something like LMS_v7.8.
It will backup the stick to a new image file.

Now you can create a new stick with this image, and it will be ready to run.
You should just be able to plug it in, and it should just start LMS.
You don't need to install anything, or even setup LMS again.


Observations
I had a problem last night where it was very slow in responding.
But, I had been tweaking the options in my wireless router, and had messed with things when I was setting up a 2nd pogo.

I elected to reinstall everything, I reimaged the USB stick to the VAMP image and then reinstalled LMS.  At this point, my network didn't show the Pogo anywhere, so I did it one more time, and it worked fine.

I'll use it for a few days, without making any changes, and see if thinks are stable.

I also have this page, for hints to make it easier to use such as iPhone apps that I am using and other programs
http://randytsuch-musicserver.blogspot.com/2013/01/using-your-pogoplug-with-lms.html














Wednesday, October 18, 2006

My $60 Homemade NAS/Music Server

Intro
So, here is the story of my $60 music server.
Kind of a diary/guide to save other linux newbies some of the pain I went through. I decided to build a dedicated music server to store my songs, and to run slimserver on. It will live in my garage, and I will turn it on and off as needed. It will be “headless”, no monitor, keyboard or mouse.

Hardware
OK, it was only $60 because I had bits and pieces of stuff around, including a mid tower case, with a generic power supply. I also have some hard drives I have bought on sale at different times. Also had some RAM, left over from when I upgraded my current home PC.

What I needed was a MB and Processor. So, I did some research at the slim devices forums, and at silentpcreview. Looking for something cheap, low power, with enough horsepower to run as a file server and slimserver.I decided on this via based system http://www.newegg.com/product/product.asp?item=N82E16813185043
It is cheap enough, and I think it will do what I need it to do. It also has two Ram slots, two PCI slots and supported USB 2.0. The VIA boards I saw, were more expensive, and did not have all of this. They either had one ram slot, or were USB 1.1, or $100 more expensive.

OS (Linux)
For my OS, since I wanted to run headless, and do not know linux so I looked for something easy. At the slim devices forums, I found this
http://www.clarkconnect.com/
It is free for the “community edition” of clarkconnect. Linux based, but has a GUI interface. Lots of support from web pages and forums, and people are already running slimserver on it. Plus, you can control it remotely, from another PC, so it is ideal for a headless server.

From the clarkconnect site, download the community edition ISO file from here
http://www.clarkconnect.com/downloads/isos.php
You need to burn it to CD as a bootable CD. There are free utilities to do this, google for burning a ISO CD to find one. I used this one
http://isorecorder.alexfeinman.com/isorecorder.htm

Building the PC
So, first I put together the PC. I had an extra mid tower case, with PS, that I used. I also had a 512 and a 256 meg stick of DDR RAM to use. The 512 stick was a higher speed than manfacturer (Chips) calls for the the motherboard, but it worked fine. Normally, it is fine to go with faster RAM.

Since the processor is already installed, it is pretty easy to put this together. Just hook up the Power Supply (you only need a PS with a 20 pin connector), install the RAM, and connect the jumpers from the front of the PC for the LED’s, power switch, ETC. Also, connected two internal USB ports to the front of my case.

At this point, I just installed a small hard drive, and a CD rom drive, on the same IDE port. HD was master, CD slave, both were set to Cable Select (CS). Hooked up monitor, KB and mouse, and it worked .

Then, I went into the BIOS setup, and found the page with the boot drive order. I set the CD Rom to be the first boot device, and the hard drive as the 2nd. Installed my bootable CD with clarkconnect 4.0 on it, and it booted up.

Installing OS
There is a CC installation guide here
http://www.clarkconnect.com/help/pdf/CC-Quickstart.pdf
It is for the older version of CC, but basically the same.



Followed the instructions, and installed CC to the hard drive. It ends up overwriting the hard drive, so don’t have anything you want on the hard drive. First time, I decided to install everything, and the installation failed, had a problem reading the CD. Then, I tried again, this time I did not install the Email and SPAM programs (won’t use this for email), and the installation worked. I have no idea if the stuff I did not install had anything to do with the success.

Removed the CD, and PC booted from the HD now. I connected the PC to my Ethernet switch/router (I am not going to run this wireless right now, I will run a wire from the switch). My switch is a Motorola 802.11G wireless router, with 4 Ethernet port.

I let the PC come up
If you were running the older version of CC, you would see this page






With the version 4.0, first you see a startup page, that asks what type on consule you want to bring up. I think I picked the GUI one, but I did not write down what I did, and I no longer have a monitor attached to my CC PC.



Next, I tried to talk to the CC PC from my XP PC.
You just run explorer, and type in
https://192.168.10.1:81/admin/
where 192.168.10.1 is the ip address found on you CC PC.

It did not work because I was using the DNS (Name Server) address, instead of the PC address. The PC address is the IP address under eth0, or something like that. Once I used the right address, I could talk to it no problem.

Putty
With the explorer interface, you are limited in what you can do. To cause some real damage, you need a console interface. I used putty, can be found here,
http://www.chiark.greenend.org.uk/~sgtatham/putty/
Downloaded it, and I just dragged it to my XP PC’s desktop, and double clicked it to start.
It comes up, with a box for the Host name or IP address. Just type in the IP address for your CC machine. You can save this, so you only need to do it once. Click open, and a new window will open, asking for your username. Type “root”, then the password you entered during the CC installation. Now, you have a console, where the “real” linux people live.

Slimserver Installation
Installing SlimserverIt is easy to install slimserver from putty.
Type in
rpm -Uvh http://www.slimdevices.com/downloads/SlimServer_v6.5.0/SlimServer_v6.5.0.noarch.rpm
This will load in the latest version (6.5) of slimserver. For older versions, find the address, and substitute it in.

rpm -Uvh http://www.slimdevices.com/downloads/nightly/latest/7.0/SlimServer_trunk_v2007-11-24.noarch.rpm

This will load the new version 7.0 beta of slimserver, which is supposed to sound better.
Once slimserver is installed, you can find it using your Win machine, on explorer by typing in http://192.168.10.1:9000/
note: substitute the address for your CC PC here.
This will bring up the familiar slimserver start page.

Adding another HD
I opened up my machine, and added another drive. I actually ended up swapping in a 60G drive for the small hard drive I had already set up, and added a 250G drive for the “data” drive. Since I swapped to boot drive, had to reinstall CC, which is pretty easy, especially after a few times. I probably ended up doing 4-5 installs before I was done.

Then, I tried to use “fdisk” from putty to set up the 2nd hard drive. When I rebooted my CC PC, I had screwed up the boot drive, so it would not boot up, Had to install CC again. Not sure what I did wrong.

When I reinstalled CC this time, on the partitioning screen, instead of “Use Default”, I selected “I will do my own partitioning”. After a few screens, the disk partitioning screen showed up. I picked the non manual option, where the program told you what to do, and just let it do everything.

It ended up creating a partition called /dev/mapper/VolGroup00-LogVol00 , which was almost 300G. It was the 250 gig drive, plus what I had not used from the 60G drive.

Setting up the HD.

To use my 300G partition, I needed to mount it. From the putty interface, typed “df”, and I got the following information.

Filesystem 1K-blocks Used Available Use% Mounted on

/dev/mapper/VolGroup00-LogVol00 297798360 1064600 281606416 1%

//dev/hda1 101086 8975 86892 10%

/bootnone 371156 0 371156 0% /dev/shm

Use the following to make a directory called “/mnt/hd”

mkdir /mnt/hd

Now “mount” it. You have to mount it to use it.

This command maps the directory you just made into the large data partition.

mount -t auto /dev/mapper/VolGroup00-LogVol00 /mnt/hd

Use cd to go to the new directory.

cd /mnt/hd

You need to mount if every time you use it, or automount it. I have not tried to automount it yet, that will come soon.Now, to move stuff between the XP and CC machines, download winscp. This adds a graphical interface to putty, and shows you the directory structures for both machines. Makes it easy to transfer files or directories.I am not sure if you need to set up samba to use winscp. I had already set samba up before I tried winscp. If it works, great, otherwise, the CC web interface program has some built in samba support, so you can use this to set up shares.Oh, and to turn if off, go to “system” then “tools” in the CC web program, and there is a place to turn off, or reset the CC PC.I placed my PC on top of a cabinet, in my garage, so I can’t reach the on/off switch. So, I built a little cable, cut off the connector from the HD LED, which I don’t need, and soldered a switch to it, with about 5 feet of wire added. So, I have a switch I can reach, to turn on the PC.Hope this helps someone. I am sure this is some details I left out, but this should get someone through the big steps. And, I am quite happy with the results. For the money spent, I have a pretty nice NAS, that will be easy to expand later, and seems easy to support and work on. \



Other Helpful Links

http://newbie.valar.co.uk/

http://linux-newbie.sunsite.dk/

Here is a very good link, to a page by another guy who made a cc server like I did.

http://www.ulverston.myzen.co.uk/mini-itx/index.htm

He has more information, and more details than I do.


And I am sure there are other ways to do what I did, and a linux expert will probably laugh at how I did things, but it works, and that's what matters to me Randy