Home Latest show Previous shows Presenters Forums Contact FAQ LugRadio Live Map Planet #lugradio

emulate a USB mass storage device

General discussion about the LUGRadio shows.

Moderators: mrben, jono, matt, trig

DanielT
Concerningly committed to LugRadio
 
Posts: 632
Joined: Sun Mar 28, 2004 9:02 pm
Location: Manchester

emulate a USB mass storage device

Postby DanielT on Fri Jun 20, 2008 3:00 pm

Ok weird one for you,

I have a device that records video input and then will 'send' it to a pendrive (fat32), it just moves the video/still image file from it's buffer to the pendrive when you hit a button. Then you take the pen drive out walk across the room and pop it in a pc, and then load up the video/image.... problem is this all happens in a environment where you don't terribly want to be hands on with things you don't have to, i.e. a sterile environment, oh and it wastes time which you really don't have.

So my question is; can you get a PC to emulate a USB storage device?

This is what i want: I connect a usb cable to the device and the other end of usb cable to a linux/windows/mac (anything really we have them all) and when i hit 'send' on the machine, instead of it writing that info to the pendrive it blasts it over to the pc (where i can create script to watch the directory and automatically display the images etc etc).

Any other solutions to this problem are of course welcome. I might be missing an obvious one.

Thank you.
Moo!

breakpoint
New to the freak show
 
Posts: 4
Joined: Wed Jun 18, 2008 11:24 pm

Re: emulate a USB mass storage device

Postby breakpoint on Fri Jun 20, 2008 4:07 pm

Well basically you need the PC to somehow set the USB host port into slavemode this is far beyond my knowledge as to how. Then there is the fake im a USB drive thing to think about.

Best place to ask this one is the Linux Kernel Mailing List. :)

User avatar
R.Smith
Knows their stuff
 
Posts: 183
Joined: Fri Nov 09, 2007 7:40 pm
Location: Cardiff, UK

Re: emulate a USB mass storage device

Postby R.Smith on Fri Jun 20, 2008 4:11 pm

Just out of curiosity: why a USB link and not ethernet? USB's not nearly as fast as good ol' CAT5.
Image Please support the FSF!

User avatar
mrben
Unbelievable LugRadio community master
 
Posts: 3236
Joined: Wed Mar 10, 2004 10:27 am
Location: Glasgow

Re: emulate a USB mass storage device

Postby mrben on Fri Jun 20, 2008 4:18 pm

R.Smith wrote:Just out of curiosity: why a USB link and not ethernet? USB's not nearly as fast as good ol' CAT5.


Did you read the original post?

DanielT wrote:I have a device that records video input and then will 'send' it to a pendrive (fat32), it just moves the video/still image file from it's buffer to the pendrive when you hit a button.


I suspect that said device _only_ has a USB connection
mrBen
Carpe Aptenodytes

http://www.jedimoose.org

User avatar
mrben
Unbelievable LugRadio community master
 
Posts: 3236
Joined: Wed Mar 10, 2004 10:27 am
Location: Glasgow

Re: emulate a USB mass storage device

Postby mrben on Fri Jun 20, 2008 4:22 pm

I asked on IRC, and somebody (astinus) said the LTSP do something like that - might want to try contacting them.
mrBen
Carpe Aptenodytes

http://www.jedimoose.org

DanielT
Concerningly committed to LugRadio
 
Posts: 632
Joined: Sun Mar 28, 2004 9:02 pm
Location: Manchester

Re: emulate a USB mass storage device

Postby DanielT on Fri Jun 20, 2008 6:12 pm

mrben wrote:I suspect that said device _only_ has a USB connection


This is true.

mrben wrote:I asked on IRC, and somebody (astinus) said the LTSP do something like that - might want to try contacting them.

Thanks, i'll have a poke around LTSP see what they have to offer.

I'll post back if i find a solution.
Moo!

User avatar
R.Smith
Knows their stuff
 
Posts: 183
Joined: Fri Nov 09, 2007 7:40 pm
Location: Cardiff, UK

Re: emulate a USB mass storage device

Postby R.Smith on Fri Jun 20, 2008 6:33 pm

mrben wrote:Did you read the original post?


Yes, although it wasn't clear to me that the device only had a USB port. :p
Image Please support the FSF!

User avatar
Mig21
LugRadio, a way of life
 
Posts: 1276
Joined: Sun Mar 06, 2005 9:29 am
Location: Internet

Re: emulate a USB mass storage device

Postby Mig21 on Mon Jun 23, 2008 3:33 am

A while ago I was looking for a way to make a PC emulate a USB HID, but that can't be done. Or rather - it can be done if you're willing to spend a year or two writing a driver for the 'device' pc.

I suspect it's the same thing with mass storage. It may be that someone has done it already (LTSP sounds like a good candidate), otherwise you're out of luck.

Parau
New to the freak show
 
Posts: 1
Joined: Fri Aug 15, 2008 3:17 am

Re: emulate a USB mass storage device

Postby Parau on Fri Aug 15, 2008 3:21 am

Any news about a solution to this problem? I'm interested in something similar. Thank you!

Elleomea
Knows their stuff
 
Posts: 264
Joined: Thu Apr 08, 2004 1:58 pm
Location: Aberystwyth, Wales

Re: emulate a USB mass storage device

Postby Elleomea on Fri Aug 15, 2008 11:49 am

If you can switch in to USB device mode (which I doubt is possible with a PC) then you can use the usb gadget API, there's already a driver implemented for doing this sort of thing, you'd simply need to run:

modprobe g_file_storage file=/dev/sda1 (replacing sda1 with the drive you want)

However you must unmount any device you're making available via this method, if it gets written to by anything other than the g_file_storage driver you could face some serious corruption problems (you could use a file instead of an actual block device to avoid this sort of nastyness).
How much ham could a hamster stir, if a hamster could stir ham?

User avatar
Prometheus
New to the freak show
 
Posts: 4
Joined: Thu Sep 18, 2008 7:38 am

Re: emulate a USB mass storage device

Postby Prometheus on Fri Nov 21, 2008 1:03 pm

Hey only came here 'cos of the spam. Its a late suggestion but did you think of usb-over-ip ?
http://www.usb-server.com/ (hates freedom)


Return to General Discussion

Who is online

Users browsing this forum: No registered users and 1 guest

cron