publiclab / pi-builder

Developing a reproducible build script system for making Raspberry Pi .img files
MIT License
22 stars 15 forks source link

Pi Zero W build scripts for Lego spectrometer + Basic Microscope #1

Open jywarren opened 6 years ago

jywarren commented 6 years ago

We're doing a build script that will:

  1. start up headless and broadcast a WiFi hotspot called 00-PiCamera
  2. be available at a fixed IP address (to be printed on the case) OR "captive portal" redirect people to a page with...
  3. a live stream connection to the Pi's camera
  4. (ideally) then connect in turn to another WiFi network given user input credentials, allowing both a) camera use and b) access to the internet through the hotspot at the same time
  5. ensure the final size is less than 8gb for burning onto an 8gb card - may require ntfsresize or PiShrink

In more detail:

itdaniher commented 6 years ago

The last part - unique names, is probably the only part that you'll need to actually implement in custom software. The rest looks like configs and a bunch of systemd unit files / networkmanager configs. You'll probably want to interrogate the MAC address or SD card UID, do some bitmath, index a list of names on first boot to set hosts / hostname.

jywarren commented 6 years ago

Here's an edited version of our .bash_history I'm trying to narrow down into a build script. Thanks, @itdaniher !!

https://gist.github.com/jywarren/48bf4d5ef1d89d0e74472cf8a46f8154

jywarren commented 6 years ago

OK! I've gotten that down to a pretty short script now, <40 lines of actual installs, and I have put it plus a folder of the actual config files from a working Pi into this repo: https://github.com/publiclab/virtual-pi

jywarren commented 6 years ago

OK, this went OK... but i got a lot of NOPASSWD notices for the copying steps... i should just remove sudo

jywarren commented 6 years ago

Ok! Seeing this error now: img_20180401_201302

jywarren commented 6 years ago

Great - this is looking OK, although I haven't been able to get it to start up a WiFi network. I've been refining the install script, and named it inside-setup.sh to indicate that it's to be run inside the Pi, and not on the .img from outside.

By contrast, https://github.com/Drewsif/PiShrink should be run on the image from the outside.

jywarren commented 6 years ago

Not all of the template config files seem absolutely necessary -- a couple I might not have actually changed. But I wanted to be thorough!

I think I need to figure out why ifup: failed to bring up wlan0 is appearing in the readout, but I'm pretty close here.