Getting Started with the Raspberry Pi 3B+ and 4
by Eric VanBuhler | Feb 03, 2020 | Hardware | 4 minute read
by Eric VanBuhler | Feb 03, 2020 | Hardware | 4 minute read
The Raspberry Pi 3B+ and the Raspberry Pi 4 are ubiquitous among the hobbyist community of developers. They are reliable, easy to use single-board computers (SBCs) that are very affordable, making it easy to get your edge computer vision project up and running!
Download the latest alwaysAI version of the Raspbian OS from our website. Next, use a tool like balena Etcher to flash the OS onto your SD card:
Once the flash completes, insert the SD card into your Raspberry Pi.
*note - If you’re using Linux or Mac, you can modify the hostname before starting your Pi by changing alwaysai
to the hostname of your choice in both the /etc/hostname
and /etc/hosts
files.
To power up your Raspberry Pi, simply plug the power supply into the device. You should see the red power LED light up, and the green activity LED start blinking.
Our Raspbian OS comes with balena WiFi Connect, making it easy to connect the Raspberry Pi to your WiFi network. Once the Pi powers up, check your development machine or phone for the “alwaysAI Connect - <device hostname>” in the list of available WiFi networks.
note
The default hostname is “alwaysai”, so if you didn’t set your own device hostname the network will be named “alwaysAI Connect - alwaysai”
Select the network you’d like to connect to from the drop-down list and enter the password. After giving the Pi some time to connect to the network, check if you can see the Pi on the network. You can use the hostname or IP address to connect to the Pi. If you’re using Mac or Linux, mDNS is a simple way to connect to the Pi.
*note - Mac has mDNS set up by default. On Linux, install mDNS with the following command: sudo apt-get install avahi-daemon
$ ping alwaysai.local
On Windows, the hostname may work:
$ ping alwaysai
If not, you’ll have to find the IP address by scanning the network or connecting a monitor, keyboard, and mouse to the Pi and looking up the IP address.
To run an alwaysAI app on your Pi, open a terminal in the application directory and run the app configure
command.
$ aai app configure
✔ Write alwaysai.project.json
✔ Found alwaysai.app.json
? What is the destination? › - Use arrow-keys. Return to submit.
Your local computer
❯ Remote device
✔ Please enter the hostname (with optional user name) to connect to your device via ssh (e.g. "pi@1.2.3.4"): … pi@alwaysai.local
✔ Connect by SSH
✔ Check docker executable
✔ Check docker permissions
✔ Where do you want to run the app? Enter a filesystem path: … alwaysai/realtime_object_detector
✔ Create target directory
✔ Write alwaysai.target.json
Now your app points to the Raspberry Pi. Run the app deploy
command to deploy your app onto the Pi (note that pulling the Docker image over WiFi can take some time on the Raspberry Pi).
$ aai app deploy
✔ Connect by SSH
✔ Create target directory
✔ Copy application to target
✔ Build docker image (this may take several minutes)
✔ Install model alwaysai/mobilenet_ssd
✔ Install python virtual environment
Now when you start your app, it will run on the Pi. If you’re using the alwaysAI Streamer, it will provide a link:
$ aai app start
...
[INFO] Streamer started at http://localhost:5000
Click the link (or copy and paste it into your browser) from your terminal to open up the alwaysAI Streamer and view your program's output.
The alwaysAI platform makes it easy to build, test, and deploy computer vision applications on edge devices. We can’t wait to see what you build with alwaysAI!