Add how to compile document
90
docs/howto-compile.md
Normal file
@ -0,0 +1,90 @@
|
|||||||
|
# How to compile AirGradient firmware on Arduino IDE
|
||||||
|
|
||||||
|
## Prequisite
|
||||||
|
|
||||||
|
Arduino IDE version 2.x ([download](https://www.arduino.cc/en/software))
|
||||||
|
|
||||||
|
> For AirGradient model ONE and Open Air, the codebase **WILL NOT** work on the latest major version of arduino-esp32 which is *3.x* . This related to when installing "esp32 by Espressif Systems" in board manager. Instead use version **2.0.17**, please follow the first step carefully.
|
||||||
|
|
||||||
|
## Steps for ESP32C3 based board (ONE and Open Air Model)
|
||||||
|
|
||||||
|
1. Install "esp32 by Espressif Systems" in board manager with version **2.0.17** (Tools ➝ Board ➝ Boards Manager ➝ search for `"espressif"`)
|
||||||
|
|
||||||
|

|
||||||
|
|
||||||
|
2. Install AirGradient library on library manager using the latest version (Tools ➝ Manage Libraries... ➝ search for `"airgradient"`)
|
||||||
|
|
||||||
|

|
||||||
|
|
||||||
|
3. On tools tab, follow settings below
|
||||||
|
|
||||||
|
```
|
||||||
|
Board ➝ ESP32C3 Dev Module
|
||||||
|
USB CDC On Boot ➝ Enabled
|
||||||
|
CPU Frequency ➝ 160MHz (WiFi)
|
||||||
|
Core Debug Level ➝ None (or choose as needed)
|
||||||
|
Erase All Flash Before Sketch Upload ➝ Enabled (or choose as needed)
|
||||||
|
Flash Frequency ➝ 80MHz
|
||||||
|
Flash Mode ➝ QIO
|
||||||
|
Flash Size ➝ 4MB (32Mb)
|
||||||
|
JTAG Adapter ➝ Disabled
|
||||||
|
Partition Scheme ➝ Minimal SPIFFS (1.9MB APP with OTA/190KB SPIFFS)
|
||||||
|
Upload Speed ➝ 921600
|
||||||
|
```
|
||||||
|
|
||||||
|

|
||||||
|
|
||||||
|
4. Open sketch to compile (File ➝ Examples ➝ AirGradient Air Quality Sensor ➝ OneOpenAir). This sketch for AirGradient ONE and Open Air monitor model
|
||||||
|
5. Compile
|
||||||
|
|
||||||
|

|
||||||
|
|
||||||
|
## Steps for ESP8266 based board (DIY model)
|
||||||
|
|
||||||
|
1. Add esp8266 board by adding http://arduino.esp8266.com/stable/package_esp8266com_index.json into Additional Board Manager URLs field (File ➝ Preferences ➝ Additional boards manager URLs)
|
||||||
|
|
||||||
|

|
||||||
|
|
||||||
|
2. Install esp8266 board on board manager with version **3.1.2** (Tools ➝ Board ➝ Boards Manager ➝ search for `"esp8266"`)
|
||||||
|
|
||||||
|

|
||||||
|
|
||||||
|
3. Install AirGradient library on library manager using the latest version (Tools ➝ Manage Libraries... ➝ search for `"airgradient"`)
|
||||||
|
|
||||||
|

|
||||||
|
|
||||||
|
4. On tools tab, set board to `LOLIN(WEMOS) D1 R2 & mini`, and let other settings to default
|
||||||
|
|
||||||
|

|
||||||
|
|
||||||
|
5. Open sketch to compile (File ➝ Examples ➝ AirGradient Air Quality Sensor ➝ `<Model Option>`). Depends on the DIY model, either `BASIC`, `DiyProIndoorV3_3` and `DiyProIndoorV4_2`
|
||||||
|
6. Compile
|
||||||
|
|
||||||
|

|
||||||
|
|
||||||
|
## Possible Issues
|
||||||
|
|
||||||
|
### Linux (Debian)
|
||||||
|
|
||||||
|
ModuleNotFoundError: No module named ‘serial’
|
||||||
|
|
||||||
|

|
||||||
|
|
||||||
|
Make sure python pyserial module installed globally in the environment by executing:
|
||||||
|
|
||||||
|
`$ sudo apt install -y python3-pyserial`
|
||||||
|
|
||||||
|
or
|
||||||
|
|
||||||
|
`$ pip install pyserial`
|
||||||
|
|
||||||
|
Choose based on how python installed on your machine. But most user, using `apt` is better.
|
||||||
|
|
||||||
|
## How to contribute
|
||||||
|
|
||||||
|
Please follow github [contributing to a project](https://docs.github.com/en/get-started/exploring-projects-on-github/contributing-to-a-project) tutorial to contribute to this project.
|
||||||
|
|
||||||
|
There are 2 environment options to compile this project, PlatformIO and ArduinoIDE.
|
||||||
|
|
||||||
|
- For PlatformIO, it should work out of the box
|
||||||
|
- For arduino, files in `src` folder and also from `Examples` can be modified at `Documents/Arduino/libraries` for windows and mac, and `~/Arduino/Libraries` for linux
|
BIN
docs/images/additional-board.png
Normal file
After Width: | Height: | Size: 50 KiB |
BIN
docs/images/ag-lib.png
Normal file
After Width: | Height: | Size: 108 KiB |
BIN
docs/images/compiled-esp8266.png
Normal file
After Width: | Height: | Size: 148 KiB |
BIN
docs/images/compiled.png
Normal file
After Width: | Height: | Size: 131 KiB |
BIN
docs/images/esp32-board.png
Normal file
After Width: | Height: | Size: 62 KiB |
BIN
docs/images/esp8266-board.png
Normal file
After Width: | Height: | Size: 61 KiB |
BIN
docs/images/linux-failed.png
Normal file
After Width: | Height: | Size: 73 KiB |
BIN
docs/images/settings-esp8266.png
Normal file
After Width: | Height: | Size: 104 KiB |
BIN
docs/images/settings.png
Normal file
After Width: | Height: | Size: 106 KiB |
@ -12,10 +12,8 @@ Outdoor Monitor: https://www.airgradient.com/outdoor/
|
|||||||
Build Instructions:
|
Build Instructions:
|
||||||
https://www.airgradient.com/documentation/diy-v4/
|
https://www.airgradient.com/documentation/diy-v4/
|
||||||
|
|
||||||
Please make sure you have esp8266 board manager installed. Tested with
|
Compile Instructions:
|
||||||
version 3.1.2.
|
https://github.com/airgradienthq/arduino/blob/master/docs/howto-compile.md
|
||||||
|
|
||||||
Set board to "LOLIN(WEMOS) D1 R2 & mini"
|
|
||||||
|
|
||||||
Configuration parameters, e.g. Celsius / Fahrenheit or PM unit (US AQI vs ug/m3)
|
Configuration parameters, e.g. Celsius / Fahrenheit or PM unit (US AQI vs ug/m3)
|
||||||
can be set through the AirGradient dashboard.
|
can be set through the AirGradient dashboard.
|
||||||
|
@ -12,10 +12,8 @@ Outdoor Monitor: https://www.airgradient.com/outdoor/
|
|||||||
Build Instructions:
|
Build Instructions:
|
||||||
https://www.airgradient.com/documentation/diy-v4/
|
https://www.airgradient.com/documentation/diy-v4/
|
||||||
|
|
||||||
Please make sure you have esp8266 board manager installed. Tested with
|
Compile Instructions:
|
||||||
version 3.1.2.
|
https://github.com/airgradienthq/arduino/blob/master/docs/howto-compile.md
|
||||||
|
|
||||||
Set board to "LOLIN(WEMOS) D1 R2 & mini"
|
|
||||||
|
|
||||||
Configuration parameters, e.g. Celsius / Fahrenheit or PM unit (US AQI vs ug/m3)
|
Configuration parameters, e.g. Celsius / Fahrenheit or PM unit (US AQI vs ug/m3)
|
||||||
can be set through the AirGradient dashboard.
|
can be set through the AirGradient dashboard.
|
||||||
|
@ -12,10 +12,8 @@ Outdoor Monitor: https://www.airgradient.com/outdoor/
|
|||||||
Build Instructions:
|
Build Instructions:
|
||||||
https://www.airgradient.com/documentation/diy-v4/
|
https://www.airgradient.com/documentation/diy-v4/
|
||||||
|
|
||||||
Please make sure you have esp8266 board manager installed. Tested with
|
Compile Instructions:
|
||||||
version 3.1.2.
|
https://github.com/airgradienthq/arduino/blob/master/docs/howto-compile.md
|
||||||
|
|
||||||
Set board to "LOLIN(WEMOS) D1 R2 & mini"
|
|
||||||
|
|
||||||
Configuration parameters, e.g. Celsius / Fahrenheit or PM unit (US AQI vs ug/m3)
|
Configuration parameters, e.g. Celsius / Fahrenheit or PM unit (US AQI vs ug/m3)
|
||||||
can be set through the AirGradient dashboard.
|
can be set through the AirGradient dashboard.
|
||||||
|
@ -14,17 +14,8 @@ https://www.airgradient.com/documentation/one-v9/ Build Instructions:
|
|||||||
AirGradient Open Air:
|
AirGradient Open Air:
|
||||||
https://www.airgradient.com/documentation/open-air-pst-kit-1-3/
|
https://www.airgradient.com/documentation/open-air-pst-kit-1-3/
|
||||||
|
|
||||||
Please make sure you have esp32 board manager installed. Tested with
|
Compile Instructions:
|
||||||
version 2.0.11.
|
https://github.com/airgradienthq/arduino/blob/master/docs/howto-compile.md
|
||||||
|
|
||||||
Important flashing settings:
|
|
||||||
- Set board to "ESP32C3 Dev Module"
|
|
||||||
- Enable "USB CDC On Boot"
|
|
||||||
- Flash frequency "80Mhz"
|
|
||||||
- Flash mode "QIO"
|
|
||||||
- Flash size "4MB"
|
|
||||||
- Partition scheme "Minimal SPIFFS (1.9MB APP with OTA/190KB SPIFFS)"
|
|
||||||
- JTAG adapter "Disabled"
|
|
||||||
|
|
||||||
Configuration parameters, e.g. Celsius / Fahrenheit or PM unit (US AQI vs ug/m3)
|
Configuration parameters, e.g. Celsius / Fahrenheit or PM unit (US AQI vs ug/m3)
|
||||||
can be set through the AirGradient dashboard.
|
can be set through the AirGradient dashboard.
|
||||||
|