Skip to content

Commit

Permalink
Added an optional way to add local modifications to platformio.ini
Browse files Browse the repository at this point in the history
For example can the upload_port be set explicitly here
  • Loading branch information
adriangronau committed Jun 24, 2020
1 parent 32cf0cd commit 0638f62
Show file tree
Hide file tree
Showing 4 changed files with 27 additions and 6 deletions.
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -7,3 +7,5 @@
.vscode/extensions.json
CMakeListsPrivate.txt
cmake-build-*/
custom_config.ini
!custom_config.ini.example
6 changes: 6 additions & 0 deletions custom_config.ini.example
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
; This file should contain your local modifications to the PlatformIO.ini file.

[env:esp32dev]
; upload_port: Optional. If not set, PlatformIO will try to autodetect the port.
; (for example for macOS:)
; upload_port = /dev/cu.SLAB_USBtoUART
10 changes: 9 additions & 1 deletion docs/guides/02_setup.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,15 @@
* Connect sensor


Alternatively you can also download the dependencies yourself and install it with the Arduino IDE.
Alternatively you can also download the dependencies yourself and install it with the Arduino IDE (see below).


### Troubleshooting
* Can't upload to device
You can specify the device port that VS Code should upload to. Duplicate the `custom_config.ini.example` file to `custom_config.ini` and set the `upload_port` there manually. If this option is not set, the upload port will be autodetected which can fail on some systems or might select the wrong device if other devices are plugged in.

* Compiling the code fails
Use the `Clean` command and delete the `.pio` directory. Compiling the code again should work now. If any errors persist, please create a new issue!


## [CLion](https://www.jetbrains.com/de-de/clion/)
Expand Down
15 changes: 10 additions & 5 deletions platformio.ini
Original file line number Diff line number Diff line change
Expand Up @@ -8,21 +8,26 @@
; Please visit documentation for the other options and examples
; https://docs.platformio.org/page/projectconf.html

; If you need to set some configurations differently for your local setup, copy
; the 'custom_config.ini.example' to 'custom_config.ini' and put your changes there.
; This new file will be ignored by git and therefore won't be overwritten at some point.

[platformio]
src_dir = OpenBikeSensorFirmware
extra_configs = custom_config.ini

[env:esp32dev]
platform = espressif32
board = esp32dev
framework = arduino
monitor_speed = 9600
# The following dependencies can either use their full name or their (platformio library) id
; The following dependencies can either use their full name or their (platformio library) id
lib_deps =
# ArduinoJson by Benoit Blanchon
; ArduinoJson by Benoit Blanchon
ArduinoJson
# CircularBuffer by AgileWare
; CircularBuffer by AgileWare
CircularBuffer
# TinyGPSPlus by Mikal Hart
; TinyGPSPlus by Mikal Hart
[email protected]
# SSD1306 by ThingPulse
; SSD1306 by ThingPulse
562

0 comments on commit 0638f62

Please sign in to comment.