Unit software for University of Idaho CS480 Capstone Project
Download Raspbian https://www.raspberrypi.org/downloads/raspbian/ unzip the file.
Follow these instructions https://www.raspberrypi.org/documentation/installation/installing-images/README.md or download Rufus and flash the image
Run sudo raspi-config
-
Change User Password – This step is absolutly required! Follow the on-screen directions to set a new password for you Pi. By default the password is set to
raspberry
, and the user is set topi
. -
Under Networking
- N1 Change Hostname to
Smartsettia-Unit
or another descriptive name - N2 Setup wifi. Enter 'AirVandalGuest' &
GoVandals!
to connect to guest network- Note: This will only work for the guest network. AirVandalGold requires additional setup
- Wifi Settings can be configured with
sudo nano /etc/wpa_supplicant/wpa_supplicant.conf
- N1 Change Hostname to
-
(optional) Enable Boot to Desktop(default) or command line – Select whether to boot into desktop or simply the text console. The console mode will obviously boot faster, and you can type Startx to open the GUI. Booting to desktop may be easier for those more comfortable with Windows or Mac, though. Internationalisation Options – Here you can adjust the timezone, keyboard layout, and language of your Pi. These changes take a while to be made, so be patient.
-
Localization - By default raspberian is in britain.
- T1 Change Locale - By default raspberian is in britain.
- Use the space key to enable
en_US.UTF-8
- Next menu choose
en_US.UTF-8
for the default language
- Use the space key to enable
- T2 Change Timezonee -
US
>Pacific-New
or your prefered timezone- Note: the smartsettia-unit script uses UTC time so the device timezone does not affect the opperation of this project
- T1 Change Locale - By default raspberian is in britain.
-
Interfacing Options
- SSH - (optional) Enable if you need it. More secure if left disabled
- I2C - Enable
-
Advanced Options
- Expand Filesystem - This will ensure that the entire sd card is available to the system
-
Finish
-
Reboot
sudo reboot
Run the following commands
sudo apt update
sudo apt install git
git clone https://github.com/uidaho/smartsettia-unit.git
Change directory into the cloned folder.
cd smartsettia-unit
Run the setup script.
sudo ./setup.sh -y
For most situations and production the script is run and managed by the system.
To check the status: sudo systemctl status smartsettia.service
* status
can be replaced with the following commands: stop
, start
, restart
To view output
Follow current program output: journalctl -u smartsettia.service -f
To see output since a date:
* journalctl -u smartsettia.service --since yesterday
* journalctl -u smartsettia.service --since '1 hour ago'
To exit, press: ctl + c
For more options and controls for viewing logs: https://www.loggly.com/ultimate-guide/using-journalctl/
When new code is pushed to github, you can update the device through this command
cd smartsettia-unit
./update.sh
Note you can add -d
to pull and update on the development branch. ./update.sh -d
These commands are primarly focused for development purposes.
usage: main.py [-h] [-s] [-fw] [-d D] [-cd CD] [-npi] [-u UUID]
optional arguments:
-h, --help show this help message and exit
-s, --single Runs the program loop only once
-fw, --fakewebcam Use Fake webcam
-d D Specify Domain. 0 prod, 1 brandon c9, 2 nick c9.
Default 0
-cd CD Specify custom Domain. This overrides all other domain
settings
-npi, --notpi Run as if this was not a raspberry pi. Disables GPIO
reading
-u UUID, --uuid UUID Use supplied UUID5 instead of generated uuid
-s
or --single
Runs all the internal tasks only once then exits
fw
or --fakewebcam
This pulls an image from a fast updating trafic camera when testing on a system without a physical camera
-d D
Used like -d 2
This selects from a list of predefined urls for tesing on other development servers.
-cd CD
Overrides server address to given address. -cd https://httpbin.org
for example
npi
or notpi
Used when running on a system that does not have GPIO ports, aka hardware pins. This is used to disable GPIO outputs and simulates inputs for testing.
-u UUID
or -uuid UUID
This is used to override the generated UUID number to what is provided. This can be used to replace a device and give it an existing identity. -u "fdf9626a-65da-52ef-b43b-aed368471aa1"
https://learn.sparkfun.com/tutorials/setting-up-raspbian-and-doom#setup-raspbian