Coder Social home page Coder Social logo

rpizero's Introduction

Raspberry Pi Zero

SSH over USB configuration

To connect to the RPi Zero without a network cable:

  1. Install Raspbian on a microSD card
  2. Mount the /boot partition on the card
  3. In config.txt, add dtoverlay=dwc2 on a new line
  4. In cmdline.txt, add modules-load=dwc2,g_ether after rootwait

NOTE: These are space-delimited values

  1. Unmount and eject the card, installing it in the Pi Zero
  2. Connect a microUSB cable to the USB port (not the PWR IN port) on the Pi
  3. 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
  1. 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.

Software

Node.js

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.

websocketd

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)

Fun things that can be used for telemetry

  • /sys/class/net/usb0/statistics/tx_packets for network packets transmitted
  • Check other /sys/class files for fun stuff (like LED controls, etc)

Bundled apps in this repo

  • reporter/: an app that curls a URL of your choosing with deets
    • set host and port for URL in app.js
  • 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

Other links

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

rpizero's People

Contributors

brampersandon avatar

Stargazers

Roman avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.