Roku Developer Program

Join our online forum to talk to Roku developers and fellow channel creators. Ask questions, share tips with the community, and find helpful resources.
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
MojaMike
Newbie

Re: My Media - Your Music and Video on the Roku DVP

"markhood" wrote:
... I'm still using a NAS (old Linksys NSLU2)...

Mark: Just FYI -- I'm running MyMedia on a headless Sheevaplug setup, and I have my MP3 music shares mount from an NSLU2 Debian Slug. The setup in the new download works much easier and it is noticeably quicker (for me) than the previous version.
Roku2 XD (3050X), HDMI out to HDTV
0 Kudos

Re: My Media - Your Music and Video on the Roku DVP

"el.wubo" wrote:
Does it not work currently? I believe people have reported success in the past with setting their music directory to something like: \\myserver\share\music


^ Works just fine for me using the Seagate Dockstar

"markhood" wrote:
I think that works, but I'm still using a NAS (old Linksys NSLU2) itself to run the pre-release MyMedia server and serve up content on the attached external hard drives, and I wonder if Gunslinger2's question refers to the same sort of setup.

Will the new channel packaging allow you to manually edit the config and install the client from a headless NAS running the server? If not, will it still be possible to install and configure the client from a desktop system and then copy the server over to a NAS and run it there?

I think you wrote something about not needing to install Python eventually, so I'm curious as to what will replace it since Python is what makes the server cross-platform and so easy to set up.
"el.wubo" wrote:
Does it not work currently? I believe people have reported success in the past with setting their music directory to something like: \\myserver\share\music


What I was thinking of was more along the lines of since it's going to be in a channel (being able to edit the config from the roku itself) form was the channel just being able to "automagically" connect to any NAS/shared drive specified on the same network as the Roku.

Ideally I think I'm in agreement with RenoJim I don't mind running the python server from my desktop as my PC is a desktop/server/media center in one but however I'd like to be able to shut down my PC once in a while but still be able to get to my local media from the Roku using My Media. If I shut down this PC My Media can't connect to the local media & I was asking since it's going to be in a channel form if something along that functionality was maybe going to be added.

I was tired this morning when I wrote my original post & I just woke up now so I apologize if I'm not making any sense.

edit - having this on all the time gets noisy with its 6 fans
0 Kudos
renojim
Community Streaming Expert

Re: Dockstar setup for MyMedia

"markhood" wrote:
I'm using the Optware ports on a Linksys NSLU2 (slug) running the Unslung firmware. There is a diversion script in the normal boot procedure that starts up stuff in /opt/etc/init.d. In that directory I have a script named S70roku-server with the following contents:

Every script in /opt/etc/init.d is run in alphabetical order, so the script is named such that it starts after the system logger, sshd, and other Optware ports. You may need to change the line that grabs the server's pid from ps since ps output varies by Linux pedigree. You can do better if you have pkill or a working awk.

Don't know about the Dockstar though. It may run the boot scripts directly out of /etc/rc.d. Pretty much the same procedure, except you edit rc.1 in that directory to run the MyMedia server script.

I finally got around to putting the cover back on my Dockstar and trying to start the server at boot up. I'm not having much luck. It doesn't look like anything in /opt/etc/init.d actually gets executed. There's no rcS script anywhere or any rc.1 script. I finally gave up trying to decipher the boot up process and I just called your script at the end of rc.local (I had to add the 'ax' parameters to the ps command). It starts the server ok, but there's a strange side effect - any file with non-ASCII characters in the name causes Python to throw a 'exceptions.UnicodeDecodeError' when I browse from my computer to the "My Music" link. The Roku client gives a "Server Problem" error message.

If I SSH in (as root) and run your script, the server is killed and restarted and everything just works. Is it because I'm calling the script from rc.local?
-JT
Roku Community Streaming Expert

Help others find this answer and click "Accept as Solution."
If you appreciate my answer, maybe give me a Kudo.

I am not a Roku employee.
0 Kudos

Re: My Media - Your Music and Video on the Roku DVP

i spent the better part of 24 hours yesterday trying to get My Media to boot automatically with the Dockstar & couldn't figure out how.

I succesfully installed PlugBox Linux & Samba onto a USB stick following directions from your previous post or just the regular Plugbox install guide. There is a pacman version of python that I installed and it did work located here:

pacman -U http://myplugbox.com/myrepo/arm/extra/p ... pkg.tar.xz

I created a directory called roku in my /home directory on the Dockstar/Plugbox & copied/placed the server install from my windows machine editing the config to find my music & movies directory located @ /media/NAS_Drive. I also installed the PIL via pacman as well, I could run the rss_server.py via the following commands:

cd /home
roku
server
python rss_server.py or python rss_server.py > /dev/null 2>&1 &

however when it came to getting/creating a script or running the the rss_server.py at boot I could NOT get it to work. In plugbox from what I have read you can add scripts or startup commands to rc.local or add a script to init.d & place the script name in the daemons section in /etc/rc.conf.

The only way I could get the server to run on the dockstar/plugbox was by manually ssh'ing in & starting the server via the commands above, all other attempts to get the server to run at boot failed & I have become so frustrated that I've practically given up on trying to run My Media from the Dockstar due to my limited knowledge of *nix & working from the command line.
0 Kudos
renojim
Community Streaming Expert

Re: My Media - Your Music and Video on the Roku DVP

I knew there had to be a python pkg for pacman. I guess I didn't search long enough.

I don't have a problem SSH'ing in and starting it since I never plan on turning it off, but I would like to know what the problem is with starting it from rc.local. As I said, I can get it to start from rc.local and maybe if I didn't have any special characters in my file names it would work. I'm sure it's something simple, but I've pretty much exhausted my knowledge of *nix.

-JT
Roku Community Streaming Expert

Help others find this answer and click "Accept as Solution."
If you appreciate my answer, maybe give me a Kudo.

I am not a Roku employee.
0 Kudos
markhood
Visitor

Re: Dockstar setup for MyMedia

"renojim" wrote:

I finally got around to putting the cover back on my Dockstar and trying to start the server at boot up. I'm not having much luck. It doesn't look like anything in /opt/etc/init.d actually gets executed. There's no rcS script anywhere or any rc.1 script.


Dang. That's really one of the problems with the embedded Linux distributions -- there's no standard boot process. You might even be running everything from flash instead of the hard drive, which means you can't alter the boot up at all. I'm not familiar with Dockstar (though I'm thinking of getting one); do you happen to know what Linux distro is running on it? Do you perhaps have a directory /etc/rc3.d that has links to a bunch of scripts in /etc/init.d?

"renojim" wrote:

I finally gave up trying to decipher the boot up process and I just called your script at the end of rc.local (I had to add the 'ax' parameters to the ps command). It starts the server ok, but there's a strange side effect - any file with non-ASCII characters in the name causes Python to throw a 'exceptions.UnicodeDecodeError' when I browse from my computer to the "My Music" link. The Roku client gives a "Server Problem" error message..


Hmm, I've always had that problem. I think it was discussed way back in this thread and had to do with non-ASCII or non-Latin UTF8 characters in folder names and a bug in the ID3 library, and the work around was to rename the folders. I only encountered it with album folders, and I don't normally use MyMedia for audio, so I pretty much forgot about it. Maybe somebody else knows?

"renojim" wrote:

If I SSH in (as root) and run your script, the server is killed and restarted and everything just works. Is it because I'm calling the script from rc.local?
-JT


The script I posted always kills the server if it's already running and then restarts it; it's a typical boot script for Optware ports but it looks like it might not be the right script for you. But are you saying that you don't have the problem with the non-ASCII characters if you're root and restart the server? I'm not sure what to make of that; perhaps root has a different library load path than a normal user and is running different code?
0 Kudos

Re: My Media - Your Music and Video on the Roku DVP

O.k, as of now I have a working My Media server on the Dockstar/Plugbox(PlugApps) USB stick that AUTOMATICALLY starts the My Media Server when the Dockstar boots/reboots.
I'm going to try & list the install procedures as best as I can because I've been stumbling/bumbling through this for 3 or 4 days now and I've tried a lot of different things, I'll also list my configurations as best as possible.

This setup is done on a Windows 7 Ultimate x64 machine so you'll have to make changes as per your system.

My setup as is follows for reference:

Linksys E2000 router
Custom built Windows 7 Ultimate x64 machine
Seagate Dockstar (White) http://www.amazon.com/Seagate-FreeAgent-DockStar-Network-STDSA10G-RK/dp/tech-data/B002MRRU6G/ref=de_...
1GB SanDisk Micro Cruzer USB
160GB External USB Hard Drive (Powered, Not USB powered)
Document Editor of choice: NotePad ++

**Warning You DO run the risk of BRICKING your Dockstar attempting this **! DO SO @ YOUR OWN RISK !**

Download Putty as you'll have to SSH into the Dockstar: http://www.chiark.greenend.org.uk/~sgtatham/putty/download.html
*tip working with Putty & Nano
ctrl-x to close document - Will ask if you want to save type Y hit Enter to save

STEP 1: Your Dockstar & Plugbox (PlugApps) Linux *READ THIS CAREFULLY & FOLLOW THE DIRECTIONS TO THE LETTER*
Follow the directions here:
http://plugapps.com/index.php5?title=PlugApps:Pogoplug_Setboot
or here:
http://plugapps.com/index.php5?title=Ten(ish)_steps_to_setting_up_a_Seagate_Dockstar

obviously you don't have to install everything listed on the pages after getting PlugBox installed, I chose to install SAMBA & MiniDLNA only

Obviously My Media needs to have Python installed as well so I'll list how/what I did to get it installed. There are apparently 2 ways (I did both & it seems to work so why not right?)

Way 1 (JT's Way):
Get the optware ipkg system so you can install Python via this method:
In Putty do/type the following:

cd /opt

# get the optware ipkg system
wget http://ipkg.nslu2-linux.org/feeds/optware/cs08q1armel/cross/unstable/ipkg-opt_0.99.163-10_arm.ipk

# set it up
tar -xOvzf ipkg-opt_*_arm.ipk ./data.tar.gz | tar -C / -xzvf -
mkdir -p /opt/etc/ipkg
echo "src cross http://ipkg.nslu2-linux.org/feeds/optware/cs08q1armel/cross/unstable" > /opt/etc/ipkg/armel-feed.conf
echo "src native http://ipkg.nslu2-linux.org/feeds/optware/cs08q1armel/native/unstable" >> /opt/etc/ipkg/armel-feed.conf

# first update
/opt/bin/ipkg update

Now get Python & PIL by typing

/opt/bin/ipkg install py26-pil


Way 2 (My Way):
Get Python

pacman -U http://myplugbox.com/myrepo/arm/extra/python-2.6.5-3-arm.pkg.tar.xz

Get PIL
pacman -S python-imaging


STEP 2: PlugBox/Dockstar & My Media

Once you have installed SAMBA you need to find/edit the config file, right now as your probably doing this via Putty/SSH you'll need to execute the following command:

nano /etc/samba/smb.conf

if the file is empty that means it's just been created & you need to write out your config, as I don't know the default configs I'll just provide my configuration & you can just edit it accordingly.

[global]
workgroup = MSHOME
server string = DOCKSTAR
netbios name = DOCKSTAR
security = share
load printers = no
printing = bsd
printcap name = /dev/null
disable spools = yes
log file = /var/log/samba/%m.log
max log size = 50
dns proxy = no
socket options = TCP_NODELAY IPTOS_LOWDELAY SO_KEEPALIVE SO_RCVBUF=131072 SO_SNDBUF=131072 SO_KEEPALIVE

[DS PlugBox USB]
path = /
read only = no
public = yes
writable = yes
force user = root

[M&M Drive]
path = /media/NAS_Drive/
read only = no
public = yes
writable = yes
force user = root


Change workgroup to whatever your home network uses to allow windows to see the samba shares i.e WORKGROUP or MSHOME or whatever you have.

DS Plugbox USB is the 1GB SanDisk Cruzer Micro that I have PlugBox/PlugApps Linux installed on. (sharing it makes it easier later on to edit/change files later on)

M&M Drive is the 160GB external that my Movies & Music are located on.

To get a list of your drives type /sbin/fdisk -l
To find out what your drives are named (Volume Label if you named them)

type /cd media hit enter & type dir

I had trouble getting the 160GB drive to mount/be readable when plugged into the Dockstar apparently due to the drive being formated NTFS. Installing ntfs-3g via pacman & Fuse (adding modprobe fuse to the rc.conf) solved this issue.

nano /etc/rc.conf

Find MODULES ()
ADD modprobe fuse
should now look like this:
MODULES=(modprobe fuse)

save the file, by now you should have PlugBox/PlugApps with Python installed on your USB stick/Dockstar along with SAMBA & whatever else you chose to install. Reboot the Dockstar for the changes to take effect.

If everything goes accordingly you should be able to browse to your network folder and see a new entry for your Dockstar & be able to browse the directory/folder of your PlugBox USB (where PlugBox is installed) as well as browse your shared media.

Now I'll get into how to get My Media set up on the Dockstar. I did this the easiest way possible for me, there may be a better or "official" way of doing this but this was what I did.

Since you should now have access to the PlugBox USB files in Windows (or your OS) browse to the drive & find the Home folder, in the Home folder create a new folder called Roku.
Copy the My Media server files from your Windows location to the Roku folder.
Open the config.ini in your editor (roku\server\config.ini)

This is my config.ini

[config]
music_dir = /media/NAS_Drive/Music
video_dir = /media/NAS_Drive/Movies
server_ip = ***.***.*.***
roku_ip = ***.***.*.***
max_folders_before_split = 10
python_path = \opt\bin\python2.6
theme = default
collapse_collections = False
server_port = 8001
photo_dir = /media/NAS_Drive/Photos


The Music, Video, Server, Photo directories as well as Server, Roku & Python should all be changed per your setup to reflect installation on the PlugBox/Dockster & save the changes you make.

Now here is where things were funky & problematic, getting the server to run/start upon the Dockstar being started or rebooted along with the Python SNAFU I was having.
To get Python to start the My Media Server upon boot or if the Dockstar is rebooted (manually or power failure) you need to edit the file rc.local. Since you have access to the files from Windows browse to the etc\ directory and open the file rc.local. Add the following lines after the commented section (# denotes comment)

#!/bin/bash
#
# /etc/rc.local: Local multi-user startup script.
#
LANG=en_US.UTF-8
export LANG
cd /home/roku/server
python2.6 /home/roku/server/rss_server.py > /dev/null 2>&1 &


Save the file.
Reboot the Dockstar
Once the Dockstar has been rebooted SSH in through Putty again and type the following:

ps aux |grep rss_server.py

you should see the following or something similar print out:

root 1172 0.1 8.9 96952 11040 ? Sl 18:00 0:10 python2.6 /home/roku/server/rss_server.py
root 1211 0.0 0.6 4196 852 pts/0 S+ 20:24 0:00 grep rss_server.py

I have no idea what the hell the above information means other than the server is started & my Roku can now access my movies and music on the external usb drive attached to the Dockstar.

You should be done now and watching a movie or listening to music from your Roku box, after putting in all this work you deserve it.

Final thoughts as of this posting:
1. I never again want to do this.
2. There may be a small hiccup as my Music directory causes the Roku to lose connection to the server. This may be because of the sheer volume of music I have or the way the directories are structured i.e. DRIVE:\Folder\Music\Artist Folder\.mp3 files or something else is going on.

Edit- I have a feeling the Music directory causing the roku to lose connection to the Dockstar/Server may be related to PIL, the album thumbnails/images & the Dockstar not having enough processor power to handle the load or something. Any way to disable thumbnails for testing this?

Edit 2- Just removed all .jpgs album art/thumbnails from the Music directory & still get the error Connection Problem Lost communications to the server notification so the images are not the problem. One thing I do notice even on this PC connecting to my music folder takes an extremely long time and causes the hard drive/cpu to start acting like their under heavy load. So something else is causing the roku to lose connection to the DockStar when processing the Music directory.

My Movies folder contains 8.61GB | 22 Files, 4 Folders
My Music folder contains 17.9 GB | 4,526 Files, 887 Folders

So hmm yeah gonna take a bit to get through that music folder & the Dockstar may not be up to it....
0 Kudos
renojim
Community Streaming Expert

Re: Dockstar setup for MyMedia

"markhood" wrote:
Dang. That's really one of the problems with the embedded Linux distributions -- there's no standard boot process. You might even be running everything from flash instead of the hard drive, which means you can't alter the boot up at all. I'm not familiar with Dockstar (though I'm thinking of getting one); do you happen to know what Linux distro is running on it? Do you perhaps have a directory /etc/rc3.d that has links to a bunch of scripts in /etc/init.d?

As far as I know, it's just called Plugbox Linux. I've seen reference to people using a Debian distro, but I'm not sure what Plugbox is based on. The way I understand it, the Dockstar flash is rewritten to look for a USB device to boot from. If there's no USB device, then it boots the old Dockstar code, otherwise it boots from a flash drive. The only 'rc' directory in /etc is rc.d. The rc.x scripts in /etc are:
rc.conf rc.local.shutdown rc.shutdown rc.sysinit rc.local rc.multi rc.single

"markhood" wrote:
Hmm, I've always had that problem. I think it was discussed way back in this thread and had to do with non-ASCII or non-Latin UTF8 characters in folder names and a bug in the ID3 library, and the work around was to rename the folders. I only encountered it with album folders, and I don't normally use MyMedia for audio, so I pretty much forgot about it. Maybe somebody else knows?

I don't have any non-ASCII characters in folder names, but I do in a few file names. It looks like it gets the exception when it searches the folders for album art.

"markhood" wrote:
The script I posted always kills the server if it's already running and then restarts it; it's a typical boot script for Optware ports but it looks like it might not be the right script for you. But are you saying that you don't have the problem with the non-ASCII characters if you're root and restart the server? I'm not sure what to make of that; perhaps root has a different library load path than a normal user and is running different code?

Yes. It works fine if I just log in as root and run the same script that's run from rc.local. Trying to track down the problem, I think it's a Python problem, but I don't know what to do about it. If I start Python with the -v parameter and save the output, starting from rc.local or starting from the command line I get the exact same output except for the following line:

started from rc.local
import encodings.ascii # precompiled from /opt/lib/python2.6/encodings/ascii.pyc

started from the command line
import encodings.utf_8 # precompiled from /opt/lib/python2.6/encodings/utf_8.pyc

I'm guessing the ascii vs. utf_8 is the problem, but now what?

Thanks for your help!
-JT
Roku Community Streaming Expert

Help others find this answer and click "Accept as Solution."
If you appreciate my answer, maybe give me a Kudo.

I am not a Roku employee.
0 Kudos
renojim
Community Streaming Expert

Re: My Media - Your Music and Video on the Roku DVP

Gunslinger2,

Good guide. Sounds like you had as much fun as I did, but you probably didn't take yours apart to connect to the serial port. 😛 I also wasted a day with various USB flash readers and various flash chips it didn't like.

I don't understand why you're having a problem with music. I've been using my Dockstar to stream all my music in shuffle mode since I got it, sometimes to two Roku's simultaneously. I don't have as much music as you, but I do have 10 GB in 2,717 files and 243 dirs. If I browse through my collection I do occasionally get a "communications error", but not very often and if I try again it always works.

I wonder if your problem is the same as my ASCII vs UTF-8 problem. If you browse to the Dockstar's IP address, port 8001, from your PC and click on "My Media" and then "My Music", does it just spew a long error message?

-JT
Roku Community Streaming Expert

Help others find this answer and click "Accept as Solution."
If you appreciate my answer, maybe give me a Kudo.

I am not a Roku employee.
0 Kudos

Re: My Media - Your Music and Video on the Roku DVP

yes,

<type 'exceptions.UnicodeDecodeError'> at /feed
'ascii' codec can't decode byte 0xc3 in position 2: ordinal not in range(128)

and no I didn't take mine apart to connect to serial port, all done over the network
0 Kudos
Need Assistance?
Welcome to the Roku Community! Feel free to search our Community for answers or post your question to get help.

Become a Roku Streaming Expert!

Share your expertise, help fellow streamers, and unlock exclusive rewards as part of the Roku Community. Learn more.