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.
emulate a USB mass storage device
Moderators: mrben, jono, matt, trig
11 posts • Page 1 of 1
- DanielT
- Concerningly committed to LugRadio
- Posts: 632
- Joined: Sun Mar 28, 2004 9:02 pm
- Location: Manchester
- breakpoint
- New to the freak show
- Posts: 4
- Joined: Wed Jun 18, 2008 11:24 pm
Re: emulate a USB mass storage device
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.
Best place to ask this one is the Linux Kernel Mailing List.
-

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
Just out of curiosity: why a USB link and not ethernet? USB's not nearly as fast as good ol' CAT5.
-

mrben - Unbelievable LugRadio community master
- Posts: 3236
- Joined: Wed Mar 10, 2004 10:27 am
- Location: Glasgow
Re: emulate a USB mass storage device
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 - Unbelievable LugRadio community master
- Posts: 3236
- Joined: Wed Mar 10, 2004 10:27 am
- Location: Glasgow
Re: emulate a USB mass storage device
I asked on IRC, and somebody (astinus) said the LTSP do something like that - might want to try contacting them.
- DanielT
- Concerningly committed to LugRadio
- Posts: 632
- Joined: Sun Mar 28, 2004 9:02 pm
- Location: Manchester
Re: emulate a USB mass storage device
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!
-

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
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
-

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
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.
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
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
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).
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?
-

Prometheus - New to the freak show
- Posts: 4
- Joined: Thu Sep 18, 2008 7:38 am
Re: emulate a USB mass storage device
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)
http://www.usb-server.com/ (hates freedom)
11 posts • Page 1 of 1
Who is online
Users browsing this forum: No registered users and 1 guest
