Skip to content

Commit

Permalink
docs: Added documentation for compiling this project airgradienthq#160
Browse files Browse the repository at this point in the history
  • Loading branch information
hestia committed Jun 17, 2024
1 parent 3b6859f commit 2e59dea
Show file tree
Hide file tree
Showing 2 changed files with 59 additions and 0 deletions.
4 changes: 4 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,10 @@ Make sure you have exactly the versions of libraries and boards installed as des

If you have an older version of the AirGradient PCB not mentioned in the example files, please downgrade this library to version 2.4.15 to support these legacy boards.

## Development

Development documents are available in [docs/compiling.md](docs/compiling.md).

## Help & Support

If you have any questions or problems, check out [our forum](https://forum.airgradient.com/).
Expand Down
55 changes: 55 additions & 0 deletions docs/compiling.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
# Arduino development setup
See the [blog post](https://www.airgradient.com/blog/install-arduino-c3-mini/) for full instructions on how to set up the Arduino IDE with the ESP32 build chain.

The quick version is this:

- File -> Preferences
- In "Additional boards manager URLs" enter: https://raw.githubusercontent.com/espressif/arduino-esp32/gh-pages/package_esp32_dev_index.json
- Tools -> Board menu -> Boards Manager...
- Search for "ESP32"
- Install the library by Espressif
- Tools -> Board -> esp32 -> Lolin C3 Mini

## Additional settings
The AirGradient One requires a number of additional settings in the Arduino IDE. These can be found in comments at the top of examples/OneOpenAir/OneOpenAir.ino.

- Tools -> Enable USB CDC on boot -> Enabled
- Tools -> Flash frequench -> 80Mhz
- Tools -> Flash mode -> QIO
- Tools -> Flash size -> 4MB (32Mb)
- Tools -> JTAG adapter -> Disabled
- Tools -> Partition scheme -> Minimal SPIFFS (1.9MB APP with OTA/190KB SPIFFS)

# Installing dependencies
In order to use the ESP toolchain, you'll need the Python serial library. On Debian based distros, this is as simple as:

```
sudo apt install python3-serial
```

After getting the system dependencies, you'll also need to get the required Arduino libraries.

- Open the Arduino IDE
- Tools -> Manage Libraries
- Search for and install the AirGradient library

# Identifying your hardware
To know which firmware you should be compiling, see the
[builds overview page](https://www.airgradient.com/documentation/overview/).

This will give you the filename of the Arduino sketch you should be using.

# Compiling
Open the appropriate .ino file and click the verify button (check mark button in the upper left of the Arduino IDE).

# Modifying firmware to be a local server (optional)
By default, your AirGradient air quality monitor will immediately send data to the AirGradient cloud. With the stock firmware, this happens before you are given an opportunity to configure the device to prevent this from happening. However, changing the following line in ./src/AgConfigure.cpp, you can prevent any posts to the server.

Change `#define jprop_postDataToAirGradient_default true' to `#define jprop_postDataToAirGradient_default false'.

This will ensure that your device ID (wifi MAC address) is never sent to a remote server unless you explicitly request this using configuration parameters (see the [local-server documentation](local-server.md) for details).

Making this change makes your air quality monitor more private by default, but also means you can not use the AirGradient Cloud Dashboard by default.

# Flashing to your device
Click the upload button (right arrow next to the verify button in the upper left of the Arduino IDE).

0 comments on commit 2e59dea

Please sign in to comment.