In a perfect world, our Raspberry Pi Zero W would hook up to the camera, connect to the wifi, and...
Public Lab is an open community which collaboratively develops accessible, open source, Do-It-Yourself technologies for investigating local environmental health and justice issues.
Public Lab chatroom
Reset your password
Read more: publiclab.org/n/16180
In a perfect world, our Raspberry Pi Zero W would hook up to the camera, connect to the wifi, and the seamlessly know to send streaming image data to http://raspberrypi.local. It'd be almost as easy as plugging in a webcam (something we're aiming for here)!
This activity covers the background steps (as documented by @partsandcrafts) that lead to having a ready-made SD card image, as mentioned in this activity. If you use the prepared image in that activity, you can skip all the steps in this activity -- they're already done! This just shows how we did it.
If you just plug in your Pi and go to that website, nothing will happen. Before we get started, though, we'll need to do the following things:
Look at this diagram to see how it'll work:
In a workshop or classroom setting, microscope users can be given a pre-flashed SD card with the appropriate software installed and will only need to edit a single configuration file to provide their wifi credentials.
This is admittedly a somewhat daunting task for many casual computer-users, but it can be explained in a step-by-step manner pretty easily (and could possibly be made easier by having a piece of software prompt the user for their credentials and generate the file automatically).
For now, you'll need to edit the file directly to give the Pi access to your wifi network.
Once the wifi credentials are set up and the Raspberry Pi is booted, users can open up a web browser on any computer on the same network, visit http://raspberrypi.local and see something like this:
If you are doing this from scratch, you will need to install an operating system on your Pi, set up wifi/networking, enable the camera, and install RPi Cam Web Interface -- https://elinux.org/RPi-Cam-Web-Interface -- the software we use for streaming images.
Note: the Public Lab Kits Initiative plans to offer pre-flashed SD cards soon.
1. Installing an Operating System.
First you want to download a copy of the Raspberry PI operating system -- Raspbian. You can get that from the Raspberry Pi website -- https://www.raspberrypi.org/downloads/raspbian/
For this setup we can use Raspbian Stretch Lite (which is smaller and has no desktop software and saves more room on the SD card for pictures and videos.
Download the .iso file, write it to a microSD card using a tool like etcher -- https://etcher.io/
2. Set up Networking
After the image is burned to the SD card we will need to make two changes to it before putting it in the Raspberry Pi and booting it up. We need to set up our wifi credentials so that the Pi can connect to your local network, and we need to enable SSH -- a tool that will allows us to log in to the Pi remotely from another computer so we can finish the set up.
To do both of these things I followed this tutorial -- https://core-electronics.com.au/tutorials/raspberry-pi-zerow-headless-wifi-setup.html -- but found that the wpa_supplicant.conf file they provided did not work for me.
The file I have been using looks like this, but the process is otherwise the same:
3. Enable Camera
To enable the camera and set up the software you will need to connect to your Raspberry Pi over ssh. As described in the tutorial linked to above. Once logged in you will type the command:
The option for enabling the camera is in the "interfacing options." You want to select it and enable the camera, then reboot.
4. Install Streaming Software
The software we use to stream images from the camera is called RPi Web Cam Interface. It can be found here -- https://elinux.org/RPi-Cam-Web-Interface -- along with instructions for how to install it. I used all default options in my install process.
Once it's set up you should be able to go to http://raspberrypi.local/html/ and see what your camera sees.
I did this Help out by offering feedback!
I have problem with this. I cannot get my raspberry pi to connect to my wifi router. I have tried different thing in wpa_supplicant file that I found in different tutorials.
There it says to add these lines only:
Why there is no first line in that video that you can see in what this page says to put in there? Why there is no key_mgmt line in what this page says to put in there?
There seems to be many different things you can put in there but nothing works for me.
I changed key_mgmt line to WPA2-AES because that is encryption what my router uses. I did check it from settings page of my router when it is connected to my laptop by Ethernet cable. From that page I did check if my raspberry is connected to router and it is not.
In this tutorial there is lot more lines in wpa_supplicant file.
Is this a question? Click here to post it to the Questions page.
I managed to connect with usb. Now I will try to get camera to work and calibrate my spectrometer.
I followed this: https://learn.adafruit.com/turning-your-raspberry-pi-zero-into-a-usb-gadget/ethernet-gadget#if-you-are-using-windows-as-the-host-machine
Glad to hear it. I've noted that not all WiFi networks work, and sometimes trying on a different one (like the one I broadcast from my phone) works to get past configuration issues.
You must be logged in to comment.
This is marked this as an activity for others to try.
Try it now
Click here to add some more details.
How long does this activity take?
How hard is this activity?
What kind of activity is it?
What is it's current status?