diff --git a/README.md b/README.md index e69de29..6e76df2 100644 --- a/README.md +++ b/README.md @@ -0,0 +1,108 @@ +# Requirements +- Tested on Raspberry Pi running Raspbian Lite OS (32-bit) "Bullseye" (Debain 11) Kernel Version 5.15 +- Python3.6 or later + - [influxdb-python](https://github.com/influxdata/influxdb-python) + - numpy (dependency of picosdk) +- [picosdk](https://www.picotech.com/downloads/linux) (installs [picosdk-python-wrappers](https://github.com/picotech/picosdk-python-wrappers/tree/master/usbtc08Examples)) +- [InfluxDB](https://docs.influxdata.com/influxdb/v1.8/) 1.x (tested on 1.8.10) +- [Chronograf](https://docs.influxdata.com/chronograf/v1.9/) (web ui and visualization for InfluxDB) + + +--- + + +# Installation + +## Raspberry Pi setup +1. [Raspberry Pi installation guide](https://www.raspberrypi.com/documentation/computers/getting-started.html#using-raspberry-pi-imager) +2. Run `apt update` + +### wifi + +Getting onto a WPA2 enterprise network takes some special setup. + + - Generate a hash of your password with the command `echo -n 'your_password_in_plaintext' | iconv -t utf16le | openssl md4` (might need to use `UTF-16LE` on mac for iconv parameter). This will generate a string like `(stdin)= d331672fc5c43a5db13c295458beeea1`. The hashed password is just the string `d331672fc5c43a5db13c295458beeea1`. + - Add this block to `/etc/wpa_supplicant.conf`, replacing `NETWORK-NAME`, `USERNAME`, and `HASH` with the appropriate values (e.g. `campus-wifi`, `person@school.edu`, and `d331672fc5c43a5db13c295458beeea1` from above hash example) + +``` +network={ + ssid="NETWORK-NAME" + proto=RSN + key_mgmt=WPA-EAP + auth_alg=OPEN + eap=PEAP + identity="USERNAME" + password=hash:HASH + phase1="peaplabel=0" + phase2="auth=MSCHAPV2" + priority=1 +} +``` + + - Append the following to the end of `/etc/dhcpcd.conf` + +``` +interface wlan0 +env ifwireless = 1 +env wpa_supplicant_driver = wext , nl80211 +``` + +### python + +1. Make sure pip is installed + `sudo apt install python3-pip` +2. install `influxdb` python module + `pip3 install influxdb` + +## Install and run Influxdb OSS v1.8 + +Instructions for latest 1.x OSS influxdb build ([source](https://pimylifeup.com/raspberry-pi-influxdb/)): + +1. Update apt and upgrade current packages + - `sudo apt update` + - `sudo apt upgrade` +2. Import influxdb repository key + - `curl https://repos.influxdata.com/influxdata-archive.key | gpg --dearmor | sudo tee /usr/share/keyrings/influxdb-archive-keyring.gpg >/dev/null` +3. Add repository to apt sources list + - `echo "deb [signed-by=/usr/share/keyrings/influxdb-archive-keyring.gpg] https://repos.influxdata.com/debian $(lsb_release -cs) stable" | sudo tee /etc/apt/sources.list.d/influxdb.list` +4. Update apt again + - `sudo apt update` +5. Install influxdb with apt + - `sudo apt install influxdb` +6. Enable influxdb service and run it + - `sudo systemctl unmask influxdb` + - `sudo systemctl enable influxdb` + - `sudo systemctl start influxdb` + +## Install and run Chronograf +1. Assuming influxdb is already installed, you can install chronograf with apt + - `sudo apt install chronograf` +2. Enable chronograf service and run it + - `sudo systemctl unmask chronograf` + - `sudo systemctl enable chronograf` + - `sudo systemctl start chronograf` +3. Log in to `http://[rasperry-pi-hostname]:8888/` to configure dashboards. + +## picosdk installation (for tc-08 hardware) + +[picotech website](https://www.picotech.com/downloads/linux) + +On the raspberry pi: + +1. Download and install libusbtc08 debian package + - `wget https://labs.picotech.com/debian/pool/main/libu/libusbtc08/libusbtc08_2.0.17-1r1441_armhf.deb` + - `sudo apt install ./libusbtc08_2.0.17-1r1441_armhf.deb` +2. Clone python wrappers git repo and install from it + - `git clone https://github.com/picotech/picosdk-python-wrappers.git` + - `cd picosdk-python-wrappers` + - `pip install .` + +## Install temperature logger service + +1. Clone or copy this repository to the Raspberry Pi, probably in a folder called `tc08-temperature-logger` in the home directory. +2. Install temperature_logger service + - `sudo cp temperature_logger.service /etc/systemd/system/.` + - edit `/etc/systemd/system/temperature_logger.service` and replace all instances of `path/to/repo` with the directory where you cloned or copied `tc08-temperature-logger`. + - `sudo systemctl daemon-reload` + - `sudo systemctl enable temperature_logger` + - `sudo systemctl start temperature_logger` \ No newline at end of file