Commit 6d91bc14cdd7f3c6a8717f6a97fb4b2cf6a035bc
1 parent
02a86c97bb
Exists in
main
add readme install notes copied from ssa project
Showing 1 changed file with 108 additions and 0 deletions Inline Diff
README.md
View file @
6d91bc1
1 | # Requirements | |||
2 | - Tested on Raspberry Pi running Raspbian Lite OS (32-bit) "Bullseye" (Debain 11) Kernel Version 5.15 | |||
3 | - Python3.6 or later | |||
4 | - [influxdb-python](https://github.com/influxdata/influxdb-python) | |||
5 | - numpy (dependency of picosdk) | |||
6 | - [picosdk](https://www.picotech.com/downloads/linux) (installs [picosdk-python-wrappers](https://github.com/picotech/picosdk-python-wrappers/tree/master/usbtc08Examples)) | |||
7 | - [InfluxDB](https://docs.influxdata.com/influxdb/v1.8/) 1.x (tested on 1.8.10) | |||
8 | - [Chronograf](https://docs.influxdata.com/chronograf/v1.9/) (web ui and visualization for InfluxDB) | |||
9 | ||||
10 | ||||
11 | --- | |||
12 | ||||
13 | ||||
14 | # Installation | |||
15 | ||||
16 | ## Raspberry Pi setup | |||
17 | 1. [Raspberry Pi installation guide](https://www.raspberrypi.com/documentation/computers/getting-started.html#using-raspberry-pi-imager) | |||
18 | 2. Run `apt update` | |||
19 | ||||
20 | ### wifi | |||
21 | ||||
22 | Getting onto a WPA2 enterprise network takes some special setup. | |||
23 | ||||
24 | - 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`. | |||
25 | - 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) | |||
26 | ||||
27 | ``` | |||
28 | network={ | |||
29 | ssid="NETWORK-NAME" | |||
30 | proto=RSN | |||
31 | key_mgmt=WPA-EAP | |||
32 | auth_alg=OPEN | |||
33 | eap=PEAP | |||
34 | identity="USERNAME" | |||
35 | password=hash:HASH | |||
36 | phase1="peaplabel=0" | |||
37 | phase2="auth=MSCHAPV2" | |||
38 | priority=1 | |||
39 | } | |||
40 | ``` | |||
41 | ||||
42 | - Append the following to the end of `/etc/dhcpcd.conf` | |||
43 | ||||
44 | ``` | |||
45 | interface wlan0 | |||
46 | env ifwireless = 1 | |||
47 | env wpa_supplicant_driver = wext , nl80211 | |||
48 | ``` | |||
49 | ||||
50 | ### python | |||
51 | ||||
52 | 1. Make sure pip is installed | |||
53 | `sudo apt install python3-pip` | |||
54 | 2. install `influxdb` python module | |||
55 | `pip3 install influxdb` | |||
56 | ||||
57 | ## Install and run Influxdb OSS v1.8 | |||
58 | ||||
59 | Instructions for latest 1.x OSS influxdb build ([source](https://pimylifeup.com/raspberry-pi-influxdb/)): | |||
60 | ||||
61 | 1. Update apt and upgrade current packages | |||
62 | - `sudo apt update` | |||
63 | - `sudo apt upgrade` | |||
64 | 2. Import influxdb repository key | |||
65 | - `curl https://repos.influxdata.com/influxdata-archive.key | gpg --dearmor | sudo tee /usr/share/keyrings/influxdb-archive-keyring.gpg >/dev/null` | |||
66 | 3. Add repository to apt sources list | |||
67 | - `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` | |||
68 | 4. Update apt again | |||
69 | - `sudo apt update` | |||
70 | 5. Install influxdb with apt | |||
71 | - `sudo apt install influxdb` | |||
72 | 6. Enable influxdb service and run it | |||
73 | - `sudo systemctl unmask influxdb` | |||
74 | - `sudo systemctl enable influxdb` | |||
75 | - `sudo systemctl start influxdb` | |||
76 | ||||
77 | ## Install and run Chronograf | |||
78 | 1. Assuming influxdb is already installed, you can install chronograf with apt | |||
79 | - `sudo apt install chronograf` | |||
80 | 2. Enable chronograf service and run it | |||
81 | - `sudo systemctl unmask chronograf` | |||
82 | - `sudo systemctl enable chronograf` | |||
83 | - `sudo systemctl start chronograf` | |||
84 | 3. Log in to `http://[rasperry-pi-hostname]:8888/` to configure dashboards. | |||
85 | ||||
86 | ## picosdk installation (for tc-08 hardware) | |||
87 | ||||
88 | [picotech website](https://www.picotech.com/downloads/linux) | |||
89 | ||||
90 | On the raspberry pi: | |||
91 | ||||
92 | 1. Download and install libusbtc08 debian package | |||
93 | - `wget https://labs.picotech.com/debian/pool/main/libu/libusbtc08/libusbtc08_2.0.17-1r1441_armhf.deb` | |||
94 | - `sudo apt install ./libusbtc08_2.0.17-1r1441_armhf.deb` | |||
95 | 2. Clone python wrappers git repo and install from it | |||
96 | - `git clone https://github.com/picotech/picosdk-python-wrappers.git` | |||
97 | - `cd picosdk-python-wrappers` | |||
98 | - `pip install .` | |||
99 | ||||
100 | ## Install temperature logger service | |||
101 | ||||
102 | 1. Clone or copy this repository to the Raspberry Pi, probably in a folder called `tc08-temperature-logger` in the home directory. | |||
103 | 2. Install temperature_logger service | |||
104 | - `sudo cp temperature_logger.service /etc/systemd/system/.` | |||
105 | - 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`. | |||
106 | - `sudo systemctl daemon-reload` | |||
107 | - `sudo systemctl enable temperature_logger` | |||
108 | - `sudo systemctl start temperature_logger` |