0
votes

I have a device that saves screenshots when you put a flash drive with exFAT/FAT32 and a specific directory tree in its USB socket. I want to livestream these screenshots to other devices as fast as possible via ethernet:

device -> flash drive -> ethernet

So I tried an ARM device (Orange Pi Zero) with OTG support and g_mass_storage kernel module which emulates an USB flash drive via USB OTG:

g_mass_storage - To have your Pi Zero appear as a mass storage device (flash drive), first create a mini filesystem in a file on your Pi with sudo dd if=/dev/zero of=/piusb.bin bs=512 count=2880 and set it up as a fat32 filesystem with sudo mkdosfs /piusb.bin. Then, when enabling it, add file=/piusb.bin stall=0 onto the end, for example sudo modprobe g_mass_storage file=/piusb.bin stall=0.

(from https://gist.github.com/gbaman/50b6cca61dd1c3f88f41)

Next I mounted the emulated flash drive for testing purpose on a Laptop (Linux Mint 18) and the flash drive file via sudo mount /piusb.bin /mnt/ on the ARM device. But when I add new files/directories in one system it doesn't appear on the other. I have to remount the device/file first to refresh the files.

So is it even possible to read (and stream) the written data at the same time on my ARM device with g_mass_storage? Or is there a better way to solve my problem?

1

1 Answers

1
votes

You should try to remount it. sudo umount /mnt/ sudo mount /piusb.bin /mnt/