Flash drive emulation. NFS server?

Hello!

I'm trying to connect a Raspberry PI 2 based on Raspbian OS to a third-party device to view photos via USB. I was wondering how to samulate the "flash drive" from the Linux system on Raspberry? Is it possible to do this via an NFS server? When connecting a Raspberry, the device must recognize it as a normal flash drive and look at a specific folder with photos.

Author: insolor, 2016-10-22

1 answers

NFS - this is network file system. And usb is not network. So that's not it. To connect via USB, you need to implement usb mass storage. And in fact, there are two problems with the connection at once:

First, the hardware. The USB bus requires the participation of the master (host controller) and the slave devices. USB OTG (smartphones, etc.) enables the implementation of both master and slave on the same port. But for the USB standard itself, this is not required, and the controller may not support working as a slave. I managed to find the answer pro first raspberry pi:

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.

As far as I know, rpi 2 is also made via a USB hub. I.e., as a plug-in device, it most likely will not be able to act.

Secondly, the barrier is programmatic. For the mass storage mode, you need a software program support from the OS. The linux kernel has a module g_mass_storage, perhaps by default, this module is not built and you will need to rebuild the kernel.

Finally, it is technically possible to implement USB software on GPIO ports. But it will be extremely slow to work, and quite laborious in terms of writing and debugging.

 3
Author: Мелкий, 2016-10-22 14:41:59