Hello! Nerves/Elixir newbie here. I am trying to connect several Nerves devices on a local wired network without any sort of DHCP server, instead using an ethernet switch, with each device having a static IP address. Ideally severally of these devices would be R.Pi Zeros. Is it possible to use a microUSB-to-Ethernet adapter with Nerves on an R.Pi Zero? And if so, would the interface be
eth0? Would nerves_network be the way to go, or is something like VintageNet more appropriate? Or am I wasting my time trying to get the Zeros to work? If I have to, I will switch to using R.Pi 3Bs, but I would much prefer the form factor of Zeros.
Thanks in advance for any help/suggestions!
Sorry for the late response, but I wanted to post in case others came across this. It’s a good question.
First off, VintageNet is the way to go for all network now in my opinion. If nothing else, the maintainers of NervesNetwork have mostly moved on to VintageNet themselves and it’s easier for us to support.
Nerves has two official systems for the Raspberry Pi Zero.
nerves_system_rpi0 is the one most people use. It sets up the RPi0’s one USB port into gadget mode so that you can connect it to a development machine and
nerves_system_rpi (no 0) also works on the Raspberry Pi Zero. It configures the USB port to host mode. That makes it possible to use a microUSB-to-Ethernet adapter with one caveat. The Linux device driver for your microUSB-to-Ethernet adapter will need to be added. The usual way of doing this is to figure out what driver gets used by plugging the adapter into a desktop Linux system and then creating a custom Nerves system with that driver loaded.
After doing all that, the USB-to-Ethernet adapter should show up as
eth0. The VintageNet cookbook directions for setting up a wired Ethernet connection should work. If I’m wrong and the adapter shows up as something else, you can find it by running
ifconfig at the IEx prompt. You can get to the IEx prompt over the RPi0’s UART pins.
No worries! I appreciate the reply, because it answered the piece I was missing, regarding the device driver for the Ethernet adapter. I was using the standard
nerves_system_rpi build, which explains why the adapter wasn’t working. In the meantime I’ve been connecting my devices wirelessly using VintageNet, but at some point I will want to switch over to a wired network, so this was really helpful. Thanks!