To connect to the RPi Zero without a network cable:
- Install Raspbian on a microSD card
- Mount the /boot partition on the card
- In
config.txt
, adddtoverlay=dwc2
on a new line - In
cmdline.txt
, addmodules-load=dwc2,g_ether
afterrootwait
NOTE: These are space-delimited values
- Unmount and eject the card, installing it in the Pi Zero
- Connect a microUSB cable to the
USB
port (not thePWR IN
port) on the Pi - Wait a minute or two for the Pi to boot.
- Notice a new
USB Ethernet
device in your network console. - In order to SSH, you will need to have this device in a "Connected" state
- You may need to set the device to
link-local
mode in order for this to work
- SSH into the device with
ssh [email protected]
It's even cooler if you can share your WiFi connection over Ethernet. Share the WiFi connection, not the ethernet-over-USB connection, or you will be sad.
Download the latest armv6
release from the Node.js site.
Unzip with tar xvf $FILE_YOU_DOWNLOADED
.
Add that directory's bin
folder to your path.
Download the latest arm
release (not arm64
) from GitHub
Use wget
not curl -O
, as RPi native curl
seems to mess up the file in transit.
Unzip, and place websocketd
somewhere in your PATH
(I used /usr/bin
because it's easy)
/sys/class/net/usb0/statistics/tx_packets
for network packets transmitted- Check other
/sys/class
files for fun stuff (like LED controls, etc)
reporter/
: an app that curls a URL of your choosing with deets- set host and port for URL in
app.js
- set host and port for URL in
nmon/
: an app that can use websockets to visualize network stuff- run with
http-server -p 9999 & websocketd --port=8080 python nmon.py
- kill with
killall node websocketd
- run with
http://www.jeffgeerling.com/blogs/jeff-geerling/controlling-pwr-act-leds-raspberry-pi
https://learn.adafruit.com/turning-your-raspberry-pi-zero-into-a-usb-gadget?view=all