This document explains how to setup a Raspberry Pi, specifically its OS and system settings, for piPACT. The overall OS and system settings that are implemented by these instructions are captured in the preconfigured OS image. There are steps that will need to be done in any case and are highlighted appropriately. You will need to repeat this for each Raspberry Pi being set up.
For those interested in headless (without a monitor) Raspberry Pi setup, the information found here may be useful.
This section addresses how to use the preconfigured OS image to setup your Raspberry Pi.
- A computer with
- microSD card comptability
- Imaging software (e.g., Balena Etcher)
- microSD card
- Monitor
- Keyboard
- Mouse
- Download the preconfigured OS image onto your computer.
- Flash the image onto the microSD card using your imaging software. It's suggested you "validate" your image if your software provides such an option.
- Connect your monitor, keyboard, and mouse to the Raspberry Pi.
- Insert the microSD card into the Raspberry Pi.
- Apply power to the Raspberry Pi.
- Follow these instructions to create a new username and password.
- It is recommended you disable the default
pi
account in order to secure your Raspberry Pi.
- Follow these instructions to connect your Raspberry Pi to your wireless network of choice. Be sure it is one you trust.
- Clone the piPACT reference code.
- Test the code by attempting to import it in Python.
pi@raspberrypi:~ $ python3 Python 3.7.3 (default, Dec 20 2019, 18:57:59) [GCC 8.3.0] on linux Type "help", "copyright", "credits" or "license" for more information. >>> import pi_pact >>> exit() pi@raspberrypi:~ $
-
Follow these instructions to assign a static IP to your Raspberry Pi. We have prepopulated the
dhcpcd.conf
file with a commented out template of the static IP wireless configuration. You can either update this template and uncomment it or write your own according to the linked to instructions.Be sure to assign unique
<STATIC_IP>
amongst all the devices on your wireless network including other Raspberry Pis that you set up with static IPs.# piPACT wireless static IP configuration template interface wlan0 static ip_address=<STATIC_IP>/24 static routers=<ROUTER_IP> static domain_name_server=<DNS_IP>
-
If you didn't do so in the previous step, reboot your Pi for the wireless setting to take effect.
- From a computer with SSH capability and using the static IP you assigned previously, perform step 4 of these instructions.
- If you have properly configured your Raspberry Pi for SSH via a static IP then you should be able to execute commands on the Raspberry Pi remotely.
These instructions are for those wanting to configure and deploy their Raspberry Pi from scratch, i.e., without using the preconfigured OS image. Please note that these instructions are provided only for informational purposes.
- Download the image of your preferred version of Raspberry Pi OS. We recommend at least a "Desktop" version if not the one that includes "Recommended Sofware".
- Flash the image onto the microSD card using your imaging software. It's suggested you "validate" your image if your software provides such an option.
- Connect your monitor, keyboard, and mouse to the Raspberry Pi.
- Insert the microSD card into the Raspberry Pi.
- Apply power to the Raspberry Pi.
- Follow the on-screen prompts to update system settings (clock, locale, keyboard, etc.), change username/password, select/configure the wireless network to connect to, and update packages.
- From the terminal, install required Debian packages by executing the following command:
sudo apt-get install pkg-config libboost-python-dev libboost-thread-dev libbluetooth-dev libatlas-base-dev libglib2.0-dev python-dev
- From the terminal, install required Python packages by executing the following command:
sudo pip3 install gattlib pybluez[ble] numpy pandas pyyaml
- Clone the piPACT reference code.
- Test the code by attempting to import it in Python.
pi@raspberrypi:~ $ python3 Python 3.7.3 (default, Dec 20 2019, 18:57:59) [GCC 8.3.0] on linux Type "help", "copyright", "credits" or "license" for more information. >>> import pi_pact >>> exit() pi@raspberrypi:~ $
-
Follow these instructions to assign a static IP to your Raspberry Pi. Shown below is the structure of the additions/modifications to the
dhcpcd.conf
file.Be sure to assign unique
<STATIC_IP>
amongst all the devices on your wireless network including other Raspberry Pis that you set up with static IPs.# piPACT wireless static IP configuration template interface wlan0 static ip_address=<STATIC_IP>/24 static routers=<ROUTER_IP> static domain_name_server=<DNS_IP>
-
If you didn't do so in the previous step, reboot your Pi for the wireless setting to take effect.
- From a computer with SSH capability and using the static IP you assigned previously, perform step 4 of these instructions.
- If you have properly configured your Raspberry Pi for SSH via a static IP then you should be able to execute commands on the Raspberry Pi remotely.