How to share a folder as an USB mass storage device (from a raspberry pi)
I'd like to do something quite simple ... in my mind.
I've got an "old" photo frame with an usb port and SD card slot (but without networking) that I would like to keep in sync with my NAS "Photo folder"
Since I'm looking forward to buy a PI, I'd like to know how I could achieve this ... in a cheap way ($ and computing power).
My main guess would be to connect both on USB.
Looking at other answers I found Serve up PC hard drive as USB mass storage and USB WiFi dongle device that can emulate a virtual mass storage device for a home video player and on the PI board itself Emulate USB mass storage device
So from what I found so far I have two options : an Host-to-Host USB cable or a Wifi-to-USB adapter (Both as expensive as the PI itself)
The problem is that both device are Windows only and neither seem to allow to select a specific folder to share.
Getting back to my goal, does any of you have an idea on how to to connect both on USB ?
Bonus question : is there a way to do this multiple times on the same "server" to connect different folders to differents clients (other frames/radios/...) ?
Thanks for the time spent reading my (long) question !
Solution 1:
Basically USB protocol requires one device to act as a Master, and others as Slaves. Master-master connections are not supported. Master devices typically have A-type connectors: computers, photo frames that support external USB media, etc. Slaves are your typical USB sticks, mice, etc. Master supplies power to slave over USB bus.
To cloud the water, USB OTG specification allows devices that support it to behave both as a master and as a slave (some Android phones, etc.).
Your photo frame is a master device, you need your Raspberry Pi acting as a slave. As far as I know, it is rather tricky, if possible at all: As a computer, Raspberry Pi supports USB master mode, but apparently USB slave mode also should be possible on some devices. Quoting the forum you mentioned in your question:
The model B has a built in 2 port USB hub, which does not know how to act as a USB device. The model A directly connects the processor USB interface, which can be configured either as a USB device or USB host.
Obviously, that won't work until people have Model A's to develop on, and someone has the talent, the time, the inclination, and the documentation, to write the device driver.
Bit-banging a slow speed USB device over GPIO should be possible on the model B.
This all will require some very significant hacking, many hours of programming/debugging time. In my opinion, waste of time.
My suggestion: Throw out your photo frame, get some second-hand/cheap small LCD display, connect it to your Raspberry Pi and use it as a photo frame. Much easier, faster, etc.