pi-builder icon indicating copy to clipboard operation
pi-builder copied to clipboard

Pi Zero W build scripts for Lego spectrometer + Basic Microscope

Open jywarren opened this issue 6 years ago • 7 comments

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:

  • start with Raspbian
  • install the PHP-based https://elinux.org/RPi-Cam-Web-Interface for accessing a Raspberry Pi camera
  • use these config files to broadcast a WiFi network called 00-PiCamera
  • install raspap-webgui - to administer -- via https://gist.github.com/jywarren/ce82d8c6ec3a05e591b7767d1a33c176#file-rasberrypi-txt-L38-L56
  • change /etc/hosts and /etc/hostname to a unique name so more than one can be run at a time (from a list of animal names)

jywarren avatar Mar 27 '18 21:03 jywarren

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.

itdaniher avatar Mar 28 '18 15:03 itdaniher

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 avatar Apr 01 '18 19:04 jywarren

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 avatar Apr 01 '18 22:04 jywarren

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

jywarren avatar Apr 01 '18 23:04 jywarren

Ok! Seeing this error now: img_20180401_201302

jywarren avatar Apr 02 '18 00:04 jywarren

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 avatar Apr 02 '18 03:04 jywarren

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.

jywarren avatar Apr 02 '18 03:04 jywarren