ovaris

ovaris

Raspberry Zero W as USB mass storage drive

Hi, I’m new to Nerves and as a first project I was planning to create project where Zero is used as “smart” USB drive. Host would be storing video files on the drive and I would have some sort of file watcher on Nerves and it would react (upload to some cloud storage) when new files appears on the drive etc. And maybe running Phoenix web server for browsing files by connecting to Zero wifi.

Any pointers that could get me started on right track?

Most Liked

lucaong

lucaong

You might want to look into ConfigFS. Check out this article for a start on how to configure different USB gadgets, especially the “Mass Storage” section: Composite USB Gadgets on the Raspberry Pi Zero | iSticktoit.net

The article is written with Raspbian in mind, but you can do the same in Nerves. You can take inspiration from this proof-of-concept repo where I setup the RPi4 USB-C as a USB Keyboard gadget: GitHub - lucaong/nerves_rpi4_hid_gadget_poc: Proof of concept of enabling USB-C gadget mode on Raspberry Pi 4 with Nerves · GitHub

My repo is based on a RPi4, but it shows one possible approach to do what the article says on Nerves. In the case of the RPi Zero, the USB port is already configured in OTG mode, but you might to do something similar to this pull request to enable ConfigFS: Switch to ConfigFS for USB Gadgets by GregMefford · Pull Request #62 · nerves-project/nerves_system_rpi0 · GitHub

One thing: most Nerves systems do not include the Debian version of common command line utilities, and use BusyBox instead. For this reason, things like echo -n ... or ln do not work exactly like in Raspbian. Pay attention to that when porting the scripts in the article :wink:

Where Next?

Popular in Questions Top

chokchit
** (DBConnection.ConnectionError) connection not available and request was dropped from queue after 2733ms. You can configure how long re...
New
_russellb
I want to try my hand at web scraping. What tools/libraries do I need to use. I’m hoping to turn this into something professional so don’...
New
marius95
Hello everyone, I try to use an Javascript Event Handler in my root.html.leex file. Therefore I created a function in the app.js file: ...
New
vertexbuffer
Hello, can anybody help here..? I have a list of players and I what to delete an element, but every for loop the list is reverting to ori...
New
New
mcarvalho
What is the difference between System.get_env and Application.get_env? For example, what are best practices to use one versus another.
New
qwerescape
Is there a way to get the call stack or stack trace at any point in the code? Not from exceptions, but an expression that returns how the...
New
chrisalley
ExUnit now has describe blocks which is a welcome addition coming from RSpec. In the docs, it states that nested hierarchies of describe ...
New
myronmarston
The Elixir Typespec docs show the following syntax for keyword lists in typespecs: # ... | [key: type] # keyword lists...
New
JorisKok
I have a server on AWS, and was running a load test using artillery. When looking at the Phoenix dashboard I see the Ports going to 100% ...
New

Other popular topics Top

Harrisonl
We have an ECS cluster with 4 services, where each task joins a single cluster, via discovery ECS discovery service. Currently when I de...
New
AstonJ
Posting this to see if we can make things easier for people to get into Neovim. If you use Neovim and have a favourite distro please let ...
New
TunkShif
This post is an instruction guide to help you setup your Neovim for Elixir development from scratch. It includes general information on h...
274 41539 114
New
albydarned
Hello all! I am typing this post from my new MacBook Pro with the M1 chip. I’m loving it so far, and will probably use it as my daily dr...
New
shahryarjb
Hello, I have map which I want to convert it to string like this: the map: %{last_name: "tavakkoli", name: "shahryar"} the string I ne...
New
stefanchrobot
What’s the safe way to decode a JSON string into a struct? I want to avoid calling String.to_atom. Jason.decode can give me a map with st...
New
dokuzbir
I want to highlight html closing tags when i click a html tag. That works in .html files but doesnt work for html.eex templates. How can...
New
Emily
I have VueJS GUIs with the project generated using Webpack. I have Elixir modules that will need to be used by the VueJS GUIs. I forese...
New
ashish173
I am using Ecto timestamps with postgres, I can see the timestamps() use the :naive_dateime but for my use case I wanted to store the ti...
New
boundedvariable
I am going through the kafka architecture. All the features what the kafka is providing are already in Erlang. I would like hear your opi...
New

We're in Beta

About us Mission Statement