Skip to main content

rpiup - Raspberry Pi OS Setup

Install

pip install rpiup

Usage

Initializing an application

This is one time setup that you should only need to run once for each application.

download the latest Raspberry OS (firstboot)

The OS is from https://github.com/nmcclain/raspberian-firstboot This is a modified RPi OS where the only change is that it lets you run a script on first boot.

rpiup os download
Initialize your application files

This creates a directory and copies the default files into it. If ./sd is omitted, it will use the current directory (./).

The files in this directory will all be copied into the raspberry pi boot directory after it is flashed.

rpiup init ./myapp
# whats the app name? ...
# What should the device username be? ...
# What should the device password be? ...
# Do you want to set a git username?
# Do you want to set a git password?
# what's your wifi?: ...
# Do you have a set of alternate wifi credentials you would like to add?
# any app variables you want to set? (press enter to skip) ...
# all set!
cd myapp
ls *
# firstboot.sh
#
# resources:
# aps.yml docker services setup.sh vars.sh

Install Balena Etcher

This is an application that will flash your OS image onto your SD card. You can find it here.

Device Specific Setup

Repeat for each device you want to setup.

Flash your SD Card
  • Insert your SD card
  • Open Etcher and flash the downloaded os image (should be in the directory above myapp/)
Copy files over and finish device specific configuration
rpi sd setup
# by default, the hostname will be <APP_NAME>-<ETH0_MAC_ADDR>
# but you can set a custom hostname
rpi sd setup --hostname mytestpi
Alternatives

If you're doing a large batch of devices, it can make sense to generate the hostnames before and print out a list of labels to put on the devices. To do that:

### Run once - generate the hostname list and save it to a tsv file:
# pip install randomname
randomname saved --name myapp -g myapp,uuid/8 -n 100 --overwrite

randomname saved --name myapp export > hostnames.tsv

### Run for each device:
# increment the index at the end of the line
rpi sd setup --hostname $(randomname saved --name myapp get 0)
# increment from 0 to 1
rpi sd setup --hostname $(randomname saved --name myapp get 1)
# and so on...

What it can do:

  • set the device hostname
  • set wifi networks
  • set arbitrary variables that can be accessed from the device.
  • run arbitrary commands

CLI

Set the hostname

rpiup vars set --hostname blah-091091eh901eh
# or
pip install randomname
rpiup vars set --hostname $(randomname get)
Setting arbitrary environment variables
rpiup vars set --some-feature 1 --myapp_something blah

Set wifi networks

rpiup wifi add MySSID-2G
# enter password:

# or
rpiup wifi add MySSID-2G mypassword

Metadata

Release files for rpiup 0.0.6

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for rpiup 0.0.6
File Size Uploaded Provenance Actions
rpiup-0.0.6.tar.gz 12.8 kB Without provenance Details for rpiup-0.0.6.tar.gz

Release files / rpiup-0.0.6.tar.gz

Download URL rpiup-0.0.6.tar.gz
Size 12.8 kB
Tags Source
SHA-256 checksum
How to use checksums
62febf3ecba564a63f5295ea2584e71c370dbb30c9a5fc18cd44331a49c555dd
BLAKE2b-256 checksum
How to use checksums
818ebb6e1ac60a9fd616b93c2460df8ff1aa8d68f6bbb9e97d433f0c1fa76db3
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.1.1 pkginfo/1.5.0.1 requests/2.23.0 setuptools/50.3.0.post20201103 requests-toolbelt/0.9.1 tqdm/4.45.0 CPython/3.7.7

Security for rpiup 0.0.6

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page