I've been joking about this project with a colleague while we were passing USB sticks back and forth to get some piece of software running on a site without internet.
With the Pi Zero (cheap, small form factor, enough processing power, USB, SD card, GPIO) and some WiFi adapter to connect to the remaining IOs (ESP8266 to start out with) it is possible to have the devices connect to each other (by having one set up an access point or using WiFi Direct), forming The Borg Drive that automatically synchronizes drives mounted on the PIs' SD cards while presenting as a generic Mass Storage Device to the host PCs.
It'll be my first "real" PI project so help is greatly appreciated and even if something similar already exists this can still serve as a reasonable learning experience.
Components
1×
48037-0001
Connectors and Accessories / Telecom and Datacom (Modular) Connectors
1×
ISL91127IRAZ-T7A
High Efficiency Buck-Boost Regulator with 4.5A Switches in a QFN Package
1×
74438356010
WE-MAPI SMD Shielded Power Inductor 1µH 7.2A 4x4x2mm³
1×
MCP73831-2ACI/MC
Power Management ICs / Power Supply Support
I'd have opted for a flex cable taking the place of the micro USB header but with a healthy disregard of RF requirements it appears to be "ok" to just solder on some crusty ribbon cable strips
>> The BCM283x SoCs at the heart of every Pi has two MMC controllers. One
of these connects to the SD card slot that the Pi boots and runs its OS
from. The other has largely been ignored, but comes out on the HAT connector
as alternate functions on GPIOs 22-27. Recent kernel and boot blob
changes have enabled these pins to be mapped to the MMC controller that
also supports SDIO devices.
>> SDIO is the SD host/eMMC interface on the Raspberry Pi. SD host signals are normally used for the microSD slot.These pins are "SD host" on Alt0 and "eMMC" on Alt3.
>> The SD cards are primaraly a SPI device, as such you technically could
parallel anouther device as long as you use a seperate chip select line
ut this would then require special driver to know what to use for it.
------
Sometimes it is the hardest to find definitive statements about obvious things. ajlitt has done an excellent job documenting all there is to know about the MMC controller and the secondary SDIO interface. The facts have changed over the past time so I initially found some contradictions.
Looking forward to Jacksons PCBs and ESP 12F modules from abroad.
Yes, regarding locks it starts going down the rabbit hole real quick. The simplest thing to start with would be to synchronize with the remote drive while nobody's looking / file handles are closed / have expired.
The original idea is have something that for the most part feels like a thumb drive to the end used and mounts on linux and windows machines without further ado. I've had my share of fun with libusb filter drivers for AVR programming dongles and windows driver signing. That's what ultimately kept me from venturing deeper into learning how to write drivers.
On the other hand I had some fun using LUFA (USB stack for USB enabled ATMega32u4 and the like) to implement a primitive "sound card" device that allows recording an accelerometer data audio stream. That really made me appreciate generic USB classes.
So my design principle would be to avoid unnecessary complications and I embrace the limitations of the generic driver support forcing me to stick to it.
Thanks for the comment. You made a point there. I'm still using Windows a lot and I've felt the differences without putting a name to it.
MTP would be tempting to use for best storage efficiency at the cost of transfer times and the least hassle with different OS.
On the other hand it would be nice to transfer the files ahead of time and just have them appear on a mass storage device linke an rsync backup. Thinking of it, that might get out of hand depending on file sizes, taking minutes at a time and blocking access to other remote files.
If multiple device endpoints are possible without much of a hassle I can imagine the device presenting as a media device and mass storage device at the same time, with complete access on demand through MTP and folder oriented download on access via the mass storage device.
MTP will be sufficient for most cases however I like the idea of executing binaries and opening different formats with the proper file associations. Just a matter of convenience though.
If you go the mass storage route, one thing to consider is that only one device can access it at a time (filesystem drivers don't take kindly to the bits changing unexpectedly underneath them). MTP should handle that fine, as it's basically a filesystem-level interface. But, as you noted, it comes with its own painful restrictions. I'm curious-- you didn't state it, but it seems that you probably have an implicit requirement for not having any drivers. i.e. just plug it in and it works. Is that so? The reason I ask is that you can probably get the rest of the features you want if you were to add a custom driver, but it does seem to be getting away from the beautiful simplicity of your original concept.
encouraging! My only hope is that all these incomplete implementations have fallen prey to some android-ish singularity that replaced them with one official library.
Yes, regarding locks it starts going down the rabbit hole real quick. The simplest thing to start with would be to synchronize with the remote drive while nobody's looking / file handles are closed / have expired.
The original idea is have something that for the most part feels like a thumb drive to the end used and mounts on linux and windows machines without further ado. I've had my share of fun with libusb filter drivers for AVR programming dongles and windows driver signing. That's what ultimately kept me from venturing deeper into learning how to write drivers.
On the other hand I had some fun using LUFA (USB stack for USB enabled ATMega32u4 and the like) to implement a primitive "sound card" device that allows recording an accelerometer data audio stream. That really made me appreciate generic USB classes.
So my design principle would be to avoid unnecessary complications and I embrace the limitations of the generic driver support forcing me to stick to it.