1 (edited by dwatson 2007-10-28 02:12:01)

Topic: Mount a Windows share on your Chumby! (Solution inside)

So, I wanted to be able to stream music to my Chumby from my network share. After a few hours of tinkering around with the kernel, I was able to compile the cifs kernel module. I'm not exactly sure how I got it to work, because I tried many different configurations with the kernel until it finally compiled. If you want to build your own, you will need to download all the necessary source code and build it yourself. If you want to trust my word that I took the source code and built it without making any modifications to the source code at all (I only made changes to the configuration scripts to make it compile the cifs.ko module), then I have your solution.

Download the kernel module from my website: http://www.grep-in.net/chumby/cifs.ko (<- Right-click, save as)

Copy this file to a USB drive of some sort (I actually use a card reader with an SD card plugged into it, it works great). SSH into your Chumby. In order to ssh into your chumby you must go into the control panel, then go into settings, then chumby info, then click on the pi symbol in the upper-right of the screen. Now touch "SSHD". You can now use an SSH client to connect as root@(ip of your chumby). Plug your USB drive into your Chumby, and then find where it mounted it to. It will mount it in /mnt/usb, /mnt/usb2, /mnt/usb3, or /mnt/usb4. cd into the directory that your USB device is in, and type "insmod ./cifs.ko". It should now load the kernel module. If you don't see anything and you just get a command prompt after the insmod, then it installed the module correctly. If you do get an error, for whatever reason, please post it into this thread.

You are now ready to mount your Windows share on your Chumby! Here is an example of how to do that.

mkdir /mnt/win_share
mount -t cifs //(IP or hostname of server)/(share name) /mnt/win_share -o username='(your username)',password='(your password)'

Note that you should encapsulate your username and password in single quotes ' ' to avoid any errant shell escape characters.

That's it! If you authenticated correctly, you should now have a Windows share mounted in /mnt/win_share if you followed this example.

Caveat: I've found that btplay does not buffer its audio source at all. You will get choppy audio when trying to use btplay on an MP3 over the network. For the technical minded, as a test I took an MP3 on my network share and did a cat (filename of MP3) >/dev/null. After it was done copying it to null, I then ran btplay on the same file and there was no stutter in the audio at all. Obviously, catting the audio file and redirecting it to null put it in memory cache where btplay fetched it from. I was also doing a tcpdump on the file server and saw that it did not even poll any data from it after the file was cached. Before it was cached, the stutter in the audio file synced perfectly with every time it had to retrieve data from the server. Also, btplay was only using 25% CPU on the Chumby at all times. Point blank, chumby needs an MP3 player that can buffer audio over a network connection to make it worthwhile.

So, there you have it. I'm not totally sure why CIFS wasn't an included module on the Chumby from the get-go. It was really just a configuration change and doing a "make modules" that actually created it. The code was there, just not enabled.

The next feats on my agenda are to 1) Find and compile an audio player for the arm processor that will actually buffer audio from a network source so there is no stutter when trying to stream audio, and 2) making the alarm clock halfway decent. I'm hoping that the Chumby developers will beat me to the punch on the 2nd one though. *hint hint* smile

Re: Mount a Windows share on your Chumby! (Solution inside)

Oh yeah, and two other things:

1) If there is a way to copy this module into /drivers somehow, I'd love to know how. I don't want to have to keep a USB drive plugged in at all times if I can avoid it. If anyone knows how to copy into this read only rom, I'd love to hear it.
2) If you flash designers can somehow come up with widgets to make mounting volumes through the touchscreen, that'd be awesome. Also, I'd love to see good audio/video player widgets out there.

Keep up the good work everyone! We WILL make this a good device in time.

3 (edited by dwatson 2007-10-28 12:02:59)

Re: Mount a Windows share on your Chumby! (Solution inside)

I just thought of a shell script that is a work around to cache and play songs from a Windows share and keep from stuttering the music:

#!/bin/sh

SMB_PATH="/mnt/win_share/music" # Set this to the path of your Windows share where your mp3s are located.

for filename in `ls $SMB_PATH/*.mp3 | sed 's/ /__SPACE__/g'` ; do
   filename_fixed=`echo $filename | sed 's/__SPACE__/ /g'`
   echo "Now playing: $filename_fixed"
   cat "$filename_fixed" >/dev/null &
   sleep 1
  # We need a little lead time to start buffering before btplay starts playing. This may need to be adjusted a little higher. So far 1 second seems
  # sufficient though.
   btplay "$filename_fixed"
done

Re: Mount a Windows share on your Chumby! (Solution inside)

dwatson wrote:

You are now ready to mount your Windows share on your Chumby! Here is an example of how to do that.

mkdir /mnt/win_share
mount -t cifs //(IP or hostname of server)/(share name) /mnt/win_share -o username='(your username)',password='(your password)'

This works great.  However, mounting or unmounting puts a very ugly bunch of garbage (od) in the ring kernel buffer (dmesg).

Re: Mount a Windows share on your Chumby! (Solution inside)

Vanilla libao/libmad/libid3tag/mpg321 worked for me:

http://xiph.org/ao/
http://www.underbit.com/products/mad/
http://mpg321.sourceforge.net/

mad's even ARM aware and runs surprisingly snappily on the chumby smile

Re: Mount a Windows share on your Chumby! (Solution inside)

dwatson wrote:

Oh yeah, and two other things:

1) If there is a way to copy this module into /drivers somehow, I'd love to know how. I don't want to have to keep a USB drive plugged in at all times if I can avoid it. If anyone knows how to copy into this read only rom, I'd love to hear it.
2) If you flash designers can somehow come up with widgets to make mounting volumes through the touchscreen, that'd be awesome. Also, I'd love to see good audio/video player widgets out there.

Keep up the good work everyone! We WILL make this a good device in time.

chumby uses /psp for storing persistent configuration data.  Although we don't advocate this technique, it's possible to store files in /psp as it is a jffs2 file system mounted read/write.  Try not to store anything large in /psp as the chumby may need the storage space for other things.

Re: Mount a Windows share on your Chumby! (Solution inside)

ndoren wrote:
dwatson wrote:

You are now ready to mount your Windows share on your Chumby! Here is an example of how to do that.

mkdir /mnt/win_share
mount -t cifs //(IP or hostname of server)/(share name) /mnt/win_share -o username='(your username)',password='(your password)'

This works great.  However, mounting or unmounting puts a very ugly bunch of garbage (od) in the ring kernel buffer (dmesg).

Wow, you are right. I never noticed that. It looks like debug output. When I have some extra time, I'll look at the module source and see if I can disable the output.

Re: Mount a Windows share on your Chumby! (Solution inside)

Can Chuttenh or  someone in this thread put together a rough step by step on mounting a windows share to play music from?
I really want to get the chumby accessing my mp3 collection...  Thanks

9 (edited by midiwall 2008-04-24 13:59:14)

Re: Mount a Windows share on your Chumby! (Solution inside)

Lasticko wrote:

Can Chuttenh or  someone in this thread put together a rough step by step on mounting a windows share to play music from?
I really want to get the chumby accessing my mp3 collection...  Thanks

- Your Chumby must be on the same network as your PC or Mac
- Do the following on the Chumby:
- - Hit the top button
- - Touch  'Settings'
- - Touch  'Chumby Info'
- - From this screen, note the 'ip:' value. It'll be something like '192.168.1.101'
- - In the extreme upper right corner, you'll see a "PI" symbol. Touch it.
- - Touch 'SSHD'. (there won't be any apparent change)
- - Touch 'Done', 'Done', 'Done' then 'Hide'

- Fire up an "SSH" client. If you don't have one, PuTTY is an excellent freebie.
- Point the SSH client to the IP address that you noted above (in putty do this by entering the IP address in the 'Host' field, set 'SSH' as Connection Type, click 'Open')
- You will get a 'login as:' prompt. This is your Chumby talking to you.
- Type 'root', (CasE MaTtERs!) hit ENTER. There's no password
- You'll be at a prompt of 'chumby:~#'

- Type 'mkdir /mnt/win_share' (note the spaces!), hit ENTER.
- Type 'insmod /drivers/cifs.ko', hit ENTER.

- Now type "mount -t cifs //(IP or hostname of server)/(share name) /mnt/win_share -o username='(your username)',password='(your password)'". The single quotes are important, and watch the spaces!
- Hit ENTER
- If things are good, then you won't see any messages

- Type 'ls /mnt/win_share', hit ENTER.
- You should see the root of your music share


That's it.. Your Chumby now has the ability to read from your Windows based music share.


THANK YOU DWatson!!!!!!!!


(btw.. ARGH! [list] isn't enabled! smile)

:: Mark

Re: Mount a Windows share on your Chumby! (Solution inside)

Incidentally, if you have firmware 1.5 or later, then /drivers/cifs.ko is already in the firmware.

11 (edited by midiwall 2008-04-24 15:57:48)

Re: Mount a Windows share on your Chumby! (Solution inside)

Duane wrote:

Incidentally, if you have firmware 1.5 or later, then /drivers/cifs.ko is already in the firmware.

Updated instructions above!

Thanks Duane!

:: Mark

Re: Mount a Windows share on your Chumby! (Solution inside)

Excellent step by step... but I'm getting an error on trying to mount.  I have a windows box in the default windows "WORKGROUP"..
it IS a large drive I'm trying to mount (over 1TB)...

chumby:~# mount -t cifs //gameon/jukebox /mnt/win_share -o username='administrator',password='(passwordhidden)'   
mount: mounting \\192.168.2.17\jukebox on /mnt/win_share failed

I've tried all combos, including username='gameon/administrator'
and I have a FreeNAS box as well.. I couldn't get it to connect to that either.

Any ideas on what would trip this up?
Thanks

Re: Mount a Windows share on your Chumby! (Solution inside)

Hmmm, maybe I missed it but I don't see the step to install the kernel module:

insmod /drivers/cifs.ko

Re: Mount a Windows share on your Chumby! (Solution inside)

Lasticko wrote:

Excellent step by step... but I'm getting an error on trying to mount.  I have a windows box in the default windows "WORKGROUP"..
it IS a large drive I'm trying to mount (over 1TB)...

chumby:~# mount -t cifs //gameon/jukebox /mnt/win_share -o username='administrator',password='(passwordhidden)'   
mount: mounting \\192.168.2.17\jukebox on /mnt/win_share failed

I've tried all combos, including username='gameon/administrator'
and I have a FreeNAS box as well.. I couldn't get it to connect to that either.

Any ideas on what would trip this up?
Thanks

Yeah, mount's not the best at giving up "why". smile

When I got an error, it was from not having installed cifs. So to be sure, head back to the chumby prompt and:

#insmod /drivers/cifs.ko

(yeup, that's different than in my babble above. That command points to the module that Duane pointed out is a part of firmware 1.5)

If that goes well, then try using the IP address of the windows box instead of the machine name:

#mount -t cifs //192.168.1.101/jukebox /mnt/win_share -o username='administrator',password='(passwordhidden)'

and then, from a shell prompt in Windows, be sure that you can see the share:

c:>dir \\192.168.1.101\jukebox

(note the slashes flipped direction)



(just noticed Duane posted... he's right! I missed it! I'll revise the above)

:: Mark

Re: Mount a Windows share on your Chumby! (Solution inside)

the insmod cmd was the trick! Thanks

Re: Mount a Windows share on your Chumby! (Solution inside)

So Duane.. Is there something in the beta CP that will let us browse the share?

I played around with various ways of stuffing things in "My Streams"...

:: Mark

Re: Mount a Windows share on your Chumby! (Solution inside)

Actually, I found that if I mounted it at /mnt/usb instead, I can have the mp3's more accessible via the "My Music Files" section of the Music control panel.  smile smile

(BTW, would it *REALLY* have been much trouble for the developers to list the media files in a scroll-list so you could tap one to start playing it? I mean, cmon, I know the resources are low on the chum, but a simple list of filenames would have gone a long way)

Re: Mount a Windows share on your Chumby! (Solution inside)

Lasticko wrote:

Actually, I found that if I mounted it at /mnt/usb instead, I can have the mp3's more accessible via the "My Music Files" section of the Music control panel.  smile smile

hahahah! nice move!

:: Mark

Re: Mount a Windows share on your Chumby! (Solution inside)

midiwall wrote:

So Duane.. Is there something in the beta CP that will let us browse the share?

Well, you *could* try the file browser in the "pi" screen.  You can't really do anything but browse from there, but it's a start if you're trying to figure out a file path.  I might enhance that at some point - it's not very good at handling directories with tons of files.

Re: Mount a Windows share on your Chumby! (Solution inside)

hahah.. the browser works - I guess it makes sense that it would, but it's cool to see.

I've been writing network drivers for just about 30 years and I still get giddy when I see stuff like that work. smile


Lesse, now an enhancement to launch the file from there, and to handle the pre-buffering, and then to auto-select the right most window in the browser... smile

:: Mark

Re: Mount a Windows share on your Chumby! (Solution inside)

midiwall wrote:

esse, now an enhancement to launch the file from there, and to handle the pre-buffering, and then to auto-select the right most window in the browser... smile

Argh.

Re: Mount a Windows share on your Chumby! (Solution inside)

Trying to get this to work on firmware 1.7. I'm pretty much a linux newb. I noticed that cifs.ko was not in /drivers any more, and when I tried to put the file linked in this thread on a USB stick and run the insmod command, I get an error ("Invalid module format (-1): Exec format error"). Some light Googling leads me to believe that the version of the cifs.ko file in this thread is not compatible with the current kernel.

I also guessed that maybe I didn't have to insert that module, and just go ahead and mount my network share using these commands:

mkdir /mnt/win_share
chumby:/# mount -t cifs //192.168.1.147/bsrep /mnt/win_share -o username='larry',password='(hidden)'
mount: mounting \\192.168.1.147\bsrep on /mnt/win_share failed


Where do I go from here?

23

Re: Mount a Windows share on your Chumby! (Solution inside)

Give this one a shot - http://files.chumby.com/resources/cifs.ko

You can build this manually by following the instructions here - http://wiki.chumby.com/mediawiki/index. … 1.7_kernel

24 (edited by ski4404 2009-05-29 16:39:53)

Re: Mount a Windows share on your Chumby! (Solution inside)

I was able to get that module to work, thanks Ken.  For those who don't know, cd to /psp and use wget:

# wget http://files.chumby.com/resources/cifs.ko
# insmod cifs.ko

The syntax for mounting is:

# mount -t cifs //your.ip.address/share /mnt/winshare -o user=username,pass=password

Note that it is -o user= and pass= not username= and password= which did not work for me.

For some reason I could only get it to mount the administrative share c$ off my Vista machine.  Since I wanted to play music from the control panel, I made a symbolic link like this:

# ln -s /mnt/winshare/music/mp3files/ /mnt/usb


The only problem I'm having is that the control panel player is only claiming to have found something like 200 files when I have more like 1000.

Re: Mount a Windows share on your Chumby! (Solution inside)

This might be old news, but it appears cifs is built into the kernel now.  I don't have to insmod.