-
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'main' of github.com:CivicTechTO/proj-noisemeter-device …
…into platformio-only
- Loading branch information
Showing
31 changed files
with
19,232 additions
and
224 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
# These are supported funding model platforms | ||
|
||
github: # Replace with up to 4 GitHub Sponsors-enabled usernames e.g., [user1, user2] | ||
patreon: # Replace with a single Patreon username | ||
open_collective: tRacket | ||
ko_fi: # Replace with a single Ko-fi username | ||
tidelift: # Replace with a single Tidelift platform-name/package-name e.g., npm/babel | ||
community_bridge: # Replace with a single Community Bridge project-name e.g., cloud-foundry | ||
liberapay: # Replace with a single Liberapay username | ||
issuehunt: # Replace with a single IssueHunt username | ||
lfx_crowdfunding: # Replace with a single LFX Crowdfunding project-name e.g., cloud-foundry | ||
polar: # Replace with a single Polar username | ||
buy_me_a_coffee: # Replace with a single Buy Me a Coffee username | ||
thanks_dev: # Replace with a single thanks.dev username | ||
custom: # Replace with up to 4 custom sponsorship URLs e.g., ['link1', 'link2'] |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
name: OTA Release | ||
|
||
on: | ||
release: | ||
types: [published] | ||
|
||
jobs: | ||
generate: | ||
name: Create release-artifacts | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v4.1.1 | ||
- uses: actions/cache@v4.0.0 | ||
with: | ||
path: | | ||
~/.cache/pip | ||
~/.platformio/.cache | ||
key: ${{ runner.os }}-pio | ||
- uses: actions/setup-python@v5.0.0 | ||
with: | ||
python-version: '3.9' | ||
- name: Install Python packages | ||
run: | | ||
pip install --upgrade platformio | ||
pip install --upgrade cryptography | ||
- name: Create files | ||
env: | ||
OTA_KEY: ${{ secrets.OTA_SIGNING_KEY }} | ||
run: | | ||
echo "$OTA_KEY" > "${GITHUB_WORKSPACE}/priv_key.pem" | ||
cp "${GITHUB_WORKSPACE}/noisemeter-device/config.h.example" "${GITHUB_WORKSPACE}/noisemeter-device/config.h" | ||
python "${GITHUB_WORKSPACE}/noisemeter-device/certs.py" -s api.tracket.info > "${GITHUB_WORKSPACE}/noisemeter-device/certs.h" | ||
- name: Build signed firmware | ||
run: pio run -t ota -e esp32-pcb | ||
|
||
- name: Upload signed firmware | ||
uses: djn24/add-asset-to-release@v1 | ||
with: | ||
token: ${{ secrets.GITHUB_TOKEN }} | ||
path: 'firmware_signed.bin' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,5 @@ | ||
.pio | ||
.vscode | ||
doc | ||
noisemeter-device/config.h | ||
noisemeter-device/secret.h | ||
|
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,28 +1,40 @@ | ||
# Project Noisemeter Device | ||
# tRacket: Community-Driven Urban Noise Monitoring | ||
|
||
[Civic Tech TO](https://civictech.ca/) | ||
This repository contains all source code and hardware design files for the [tRacket](https://tracket.info/) noise sensor. | ||
|
||
## Overview | ||
|
||
This repo contains all source code and design files for the Project Noisemeter Data-Gathering Devices, which are being developed by a group of volunteers at Civic Tech Toronto. The purpose of the device is to gather data about urban noise levels and upload that data to the cloud, whereupon the data can be made available to citizens, activists and lawmakers to help inform public policy around noise bylaws. | ||
Environmental noise, especially in urban settings, is a [known public health concern](https://www.toronto.ca/wp-content/uploads/2017/11/8f98-tph-How-Loud-is-Too-Loud-Health-Impacts-Environmental-Noise.pdf): | ||
|
||
The first-generation device is based around an arduino microcontroller and a MEMS microphone module, which sends audio data over I2S protocol. The device is to be hosted by volunteers at their home or place of work, where it will stay, long-term, to gather noise data and upload it. Currently, the device requires USB power and a WiFi connection in order to operate. Future devices may differ in both respects. | ||
> The growing body of evidence indicates that exposure to excessive environmental | ||
noise does not only impact quality of life and cause hearing loss but also has other health impacts, such as cardiovascular effects, cognitive impacts, sleep disturbance and mental health effects. | ||
|
||
We will try to maintain up-to-date documentation within each hardware/version folder so that volunteers can more easily help out with the project. | ||
The tRacket noise sensor continuous monitors ambient sound levels (in [decibels](https://en.wikipedia.org/wiki/Decibel), dBA) and sends these measurements to an [online dashboard](https://dashboard.tracket.info/locations) ([also on GitHub](https://github.com/CivicTechTO/tRacket-dashboard)). Our goal is to help local communities better understand the sound levels and extreme noise events that they experience day to day. | ||
|
||
The project has been started and is maintained by volunteers from the [CivicTech Toronto](http://www.civictech.ca) community. | ||
|
||
## Privacy | ||
|
||
We followed Privacy by Design principles in setting up the data collection. | ||
|
||
1. The sound meter devices are deployed on private properties in residential areas at different locations in the city. We are **not publishing exact device locations**. | ||
2. The devices **do not record sound** only sound levels in A-weighted decibel levels (dBA)(https://en.wikipedia.org/wiki/Decibel). | ||
3. We calculate minimum and maximum sound levels at 5 minute intervals on the device and **only broadcast these aggregate values** (along wiht the device ID) to a database. | ||
|
||
## Source Code | ||
|
||
The [noisemeter-device](/noisemeter-device) folder contains the device's source code. The code can be built with the Arduino IDE or PlatformIO, and supports two ESP32 targets: a "breadboard" target for the early prototype, and a "pcb" target for the official circuit boards. See the source code's [BUILD.md](/noisemeter-device/BUILD.md) file for build instructions. The source code is released under the [GNU GPL v3 license](/noisemeter-device/LICENSE). | ||
The [noisemeter-device](/noisemeter-device) folder contains the device's source code, which is written in C++ and can be built using [PlatformIO](https://platformio.org/). Build instructions are available [in the online documentation](https://civictechto.github.io/tRacket-sensor/md_noisemeter_device_BUILD.html). | ||
|
||
The source code is released under the [GNU GPL v3 license](/noisemeter-device/LICENSE). | ||
|
||
## Hardware Files | ||
|
||
The [hardware](/hardware) folder contains design files and documentation for each iteration of the noisemeter hardware. The PCBs are made using [KiCAD](https://www.kicad.org/) and are released under an [open hardware license](/hardware/pcb-rev2/LICENSE). | ||
The [hardware](/hardware) folder contains design files and documentation for each iteration of the noisemeter hardware. The PCBs are designed using [KiCAD](https://www.kicad.org/). | ||
|
||
The hardware design files are released under an [open hardware license](/hardware/pcb-rev2/LICENSE). | ||
|
||
## Current Points of Contact for the project: | ||
## For Developers | ||
|
||
(May be subject to change) | ||
* Check out the [Issues page](https://github.com/CivicTechTO/proj-noisemeter-device/issues) to see current bugs and feature requests. Any contributions are welcome! | ||
* Online documentation of the firmware [is available here](https://civictechto.github.io/tRacket-sensor/). | ||
|
||
- Gabe Sawnhey (Project Lead) | ||
- Nick Barnard (Arduino) | ||
- Clyne Sullivan (Arduino) | ||
- Mitch Bechtel (API & Cloud DB) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
# Security Policy | ||
|
||
## Reporting a Vulnerability | ||
|
||
Security vulnerabilities should be reported by emailing `info@tracket.info`. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
#!/bin/bash | ||
# | ||
# Run this script with a newly manufactured tRacket board connected to give it | ||
# a unique storage encryption key and flash the latest firmware. | ||
# The "tail" command will show the board's UUID; this needs to be added to the | ||
# server for device registration. | ||
|
||
dd if=/dev/urandom of=hmac_key bs=1 count=32 | ||
echo "BURN" | pio pkg exec -- espefuse.py --port /dev/ttyACM0 burn_key BLOCK4 hmac_key HMAC_UP | ||
rm hmac_key | ||
pio run -t upload | ||
tail -F /dev/ttyACM0 | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,16 +1,13 @@ | ||
Import("env") | ||
|
||
env.AddPostAction( | ||
"$BUILD_DIR/${PROGNAME}.bin", | ||
env.VerboseAction( | ||
env.AddCustomTarget( | ||
name="ota", | ||
dependencies="$BUILD_DIR/${PROGNAME}.bin", | ||
actions=[ | ||
"openssl dgst -sha256 -sign priv_key.pem -keyform PEM -out $BUILD_DIR/${PROGNAME}.sig -binary $BUILD_DIR/${PROGNAME}.bin", | ||
"Creating OTA signature...") | ||
) | ||
|
||
env.AddPostAction( | ||
"$BUILD_DIR/${PROGNAME}.bin", | ||
env.VerboseAction( | ||
"cat $BUILD_DIR/${PROGNAME}.sig $BUILD_DIR/${PROGNAME}.bin > ${PROGNAME}_signed.bin", | ||
"Creating ${PROGNAME}_signed.bin") | ||
"cat $BUILD_DIR/${PROGNAME}.sig $BUILD_DIR/${PROGNAME}.bin > ${PROGNAME}_signed.bin" | ||
], | ||
title="OTA Signing", | ||
description="Create a signed OTA update" | ||
) | ||
|
Oops, something went wrong.