CanAirIO is a citizen science initiative for air quality tracking, visualization and dissemination by using PM2.5 particulate material sensors paired with your smartphone via bluetooth.
This code is for CanAir.io Android client and reporter for esp32-hpma115s0 pollution sensor.
Full guide (Hackster.io): English | Spanish
- BLE scanning and connecting
- BLE auto connect and reconnect
- Receive data via BLE notification
- Basic chart for PM 2.5 data
- BLE persist connection on background service
- Recoding data in the phone
- List recorded tracks fragment
- Open Street map fragment
- Connect list records to record track
- Connect Open Street Maps to pollution data
- Firebase connection for publish reports
- Osmdroid clusters (for static points)
- Osmdroid routes (for line or dinamic points)
- Export data to json or others
- Android SDK and NDK
- Tested with gradle 4.4, SDK tools 26 and NDK 15
- CMake
This application uses a Firebase Database instance to store air quality reports.
For local development, you will need to create a database in the Firebase Console using hpsaturn.pollutionreporter
as the application identifier and retrieve a google-services.json
file. See instructions here.
- Create a local keystore:
keytool -genkey -v -keystore my-release-key.keystore -alias alias_name -keyalg RSA -keysize 2048 -validity 10000
- Add a reference to the keystore to your environment variables by adding the following to
~/.bash_profile
or~/.bashrc
depending on your local setup.
export airStoreFile=<your_test.keystore>
export airStorePassword=<your_test_keystore_password>
export airKeyAlias=<your_test_keystore_alias>
export airKeyPassword=<your_key_password>
git clone https://github.com/kike-canaries/android-hpma115s0.git
cd android-hpma115s0.git && ./gradlew assembleDebug