diff --git a/README.md b/README.md index bf03b766..3c6c35f7 100644 --- a/README.md +++ b/README.md @@ -64,8 +64,8 @@ If your device has silicon **Unique ID** which is stored in serial EEPROM Microc To upload the code to your ESP32 board this needs to be switched from run to bootloader mode. Boards with USB bridge like Heltec and TTGO usually have an onboard logic which allows soft switching by the upload tool. In PlatformIO this happenes automatically.
The LoPy/LoPy4 board needs to be set manually. See these -instructions how to do it.
-For the LoPy/LoPy4 the original Pycom firmware is not needed here, so there is no need to update it before flashing Paxcounter. Just flash the paxcounter code on your LoPy/LoPy4. If you want to go back to the Pycom firmware, no problem. Download the firmware from Pycom and flash it over. +instructions how to do it. Don't forget to press on board reset button after switching between run and bootloader mode.
+The original Pycom firmware is not needed, so there is no need to update it before flashing Paxcounter. Just flash the compiled paxcounter binary (.elf file) on your LoPy/LoPy4. If you later want to go back to the Pycom firmware, download the firmware from Pycom and flash it over.
# Legal note
diff --git a/platformio.ini b/platformio.ini
index 8f4d829a..c92a9060 100644
--- a/platformio.ini
+++ b/platformio.ini
@@ -8,12 +8,13 @@
; Please visit documentation for the other options and examples
; http://docs.platformio.org/page/projectconf.html
+
; ---> SELECT TARGET PLATFORM HERE! <---
[platformio]
-env_default = heltec_wifi_lora_32
+;env_default = heltec_wifi_lora_32
;env_default = ttgov1
;env_default = ttgov2
-;env_default = lopy
+env_default = lopy
;env_default = lopy4
;env_default = lolin32lite_lora
;env_default = lolin32_lora
@@ -21,32 +22,32 @@ env_default = heltec_wifi_lora_32
description = Paxcounter is a proof-of-concept ESP32 device for metering passenger flows in realtime. It counts how many mobile devices are around.
[common_env_data]
+monitor_baud = 115200
+lib_deps_display =
+ U8g2@>=2.22.14
+lib_deps_rgbled =
+ SmartLeds
build_flags =
; we need build_flag for logging, otherwise we can't use ESP_LOGx in arduino framework
; ---> NOTE: For production run set DEBUG_LEVEL level to NONE! <---
; otherwise device may crash in dense environments due to serial buffer overflow
;
+ -DCORE_DEBUG_LEVEL=ARDUHAL_LOG_LEVEL_NONE
; -DCORE_DEBUG_LEVEL=ARDUHAL_LOG_LEVEL_INFO
; -DCORE_DEBUG_LEVEL=ARDUHAL_LOG_LEVEL_VERBOSE
- -DCORE_DEBUG_LEVEL=ARDUHAL_LOG_LEVEL_NONE
; -DCORE_DEBUG_LEVEL=ARDUHAL_LOG_LEVEL_DEBUG
;
-;override lora settings from LMiC library in lmic/config.h and use main.h instead
+; override lora settings from LMiC library in lmic/config.h and use main.h instead
-D_lmic_config_h_
-include "src/main.h"
-;
-lib_deps_builtin =
- U8g2@2.22.10
-
[env:heltec_wifi_lora_32]
platform = espressif32
-board = heltec_wifi_lora_32
framework = arduino
-monitor_baud = 115200
+board = heltec_wifi_lora_32
upload_speed = 115200
lib_deps =
- ${common_env_data.lib_deps_builtin}
+ ${common_env_data.lib_deps_display}
build_flags =
${common_env_data.build_flags}
-Dheltec_wifi_lora_32
@@ -54,12 +55,11 @@ build_flags =
[env:ttgov1]
platform = espressif32
-board = esp32dev
framework = arduino
-monitor_baud = 115200
+board = esp32dev
upload_speed = 115200
lib_deps =
- ${common_env_data.lib_deps_builtin}
+ ${common_env_data.lib_deps_display}
build_flags =
${common_env_data.build_flags}
-Dttgov1
@@ -67,12 +67,11 @@ build_flags =
[env:ttgov2]
platform = espressif32
-board = esp32dev
framework = arduino
-monitor_baud = 115200
+board = esp32dev
upload_speed = 921600
lib_deps =
- ${common_env_data.lib_deps_builtin}
+ ${common_env_data.lib_deps_display}
build_flags =
${common_env_data.build_flags}
-Dttgov2
@@ -80,13 +79,11 @@ build_flags =
[env:lopy]
platform = espressif32
-board = esp32dev
framework = arduino
-monitor_baud = 115200
+board = esp32dev
upload_speed = 921600
lib_deps =
- ${common_env_data.lib_deps_builtin}
- SmartLeds
+ ${common_env_data.lib_deps_rgbled}
build_flags =
${common_env_data.build_flags}
-Dlopy
@@ -94,13 +91,11 @@ build_flags =
[env:lopy4]
platform = espressif32
-board = esp32dev
framework = arduino
-monitor_baud = 115200
+board = esp32dev
upload_speed = 921600
lib_deps =
- ${common_env_data.lib_deps_builtin}
- SmartLeds
+ ${common_env_data.lib_deps_rgbled}
build_flags =
${common_env_data.build_flags}
-Dlopy4
@@ -108,13 +103,11 @@ build_flags =
[env:lolin32lite_lora]
platform = espressif32
-board = lolin32
framework = arduino
-monitor_baud = 115200
+board = lolin32
upload_speed = 256000
lib_deps =
- ${common_env_data.lib_deps_builtin}
- SmartLeds
+ ${common_env_data.lib_deps_rgbled}
build_flags =
${common_env_data.build_flags}
-Dlolin32lite_lora
@@ -122,13 +115,11 @@ build_flags =
[env:lolin32_lora]
platform = espressif32
+framework = arduino
board = lolin32
-framework = arduino
-monitor_baud = 115200
upload_speed = 921600
lib_deps =
- ${common_env_data.lib_deps_builtin}
- SmartLeds
+ ${common_env_data.lib_deps_rgbled}
build_flags =
${common_env_data.build_flags}
-Dlolin32_lora
diff --git a/src/globals.h b/src/globals.h
index 06a3de38..72598669 100644
--- a/src/globals.h
+++ b/src/globals.h
@@ -6,8 +6,10 @@
#include