From ebf6f1e5786a8ed496f6082bc40b0d205e8ad069 Mon Sep 17 00:00:00 2001 From: Frank Sautter Date: Mon, 27 Feb 2023 01:33:06 +0100 Subject: [PATCH 1/7] suppress empty screen if no button is configured --- src/display.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/display.cpp b/src/display.cpp index 4b5e9801..86061045 100644 --- a/src/display.cpp +++ b/src/display.cpp @@ -375,7 +375,7 @@ void dp_refresh(bool nextPage) { dp_clear(); break; #else // skip this page - DisplayPage++; + DisplayPage = 0; break; #endif } // switch (page) From c0082eb095f158157e6bf79dc3558c9f0506480a Mon Sep 17 00:00:00 2001 From: Frank Sautter Date: Mon, 27 Feb 2023 01:51:26 +0100 Subject: [PATCH 2/7] support for LilyGO TTGO LORA32 v2 board Added hint to connect LORA_IO1 to GPIO33 for LMIC to work --- platformio_orig.ini | 6 ++++++ src/hal/ttgov2.h | 9 ++++++--- 2 files changed, 12 insertions(+), 3 deletions(-) diff --git a/platformio_orig.ini b/platformio_orig.ini index 6890db52..41aa06b0 100644 --- a/platformio_orig.ini +++ b/platformio_orig.ini @@ -1,6 +1,7 @@ ; ---> SELECT ONE TARGET BOARD FROM FOLLOWING ROWS <--- ; ; Note: For "LILYGO TTGO ESP32-Paxcounter LoRa32 V2.1 1.6.1" select board ttgov21new.h +; Note: For "LILYGO TTGO ESP32-Paxcounter LoRa32 V2.0 1.6.0" select board ttgov2.h and add bodge wire from LORA_IO1 to GPIO33 ; ; [board] @@ -126,6 +127,11 @@ upload_protocol = custom [env:usb] upload_protocol = esptool +upload_speed = 921600 +monitor_speed = 115200 +; necessary for macos - adjust devicename accordingly +;upload_port = /dev/tty.usbserial-xxxxxxx +;monitor_port = /dev/tty.usbserial-xxxxxxx [env:dev] upload_protocol = esptool diff --git a/src/hal/ttgov2.h b/src/hal/ttgov2.h index 37d58359..028d4416 100644 --- a/src/hal/ttgov2.h +++ b/src/hal/ttgov2.h @@ -1,13 +1,14 @@ // clang-format off // upload_speed 921600 -// board ttgo-lora32-v1 +// board ttgo-lora32-v2 +// https://github.com/LilyGO/TTGO-LORA32 #ifndef _TTGOV2_H #define _TTGOV2_H #include -// Hardware related definitions for TTGO V2 Board +// Hardware related definitions for LilyGO TTGO LORA32 V2 Board #define HAS_LORA 1 // comment out if device shall not send data via LoRa #define CFG_sx1276_radio 1 // HPD13A LoRa SoC @@ -34,8 +35,10 @@ // Pins for LORA chip SPI interface come from board file, we need some // additional definitions for LMIC -#define LORA_RST LMIC_UNUSED_PIN +// ******************************************************************************************** +//! LORA_IO1 is not connected on LilyGO TTGO V2 - bodge wire from LORA_IO1 to GPIO33 necessary #define LORA_IO1 (33) +// ******************************************************************************************** #define LORA_IO2 LMIC_UNUSED_PIN #endif From d11f921a2baab1798c0acdcb75a79c21091954ab Mon Sep 17 00:00:00 2001 From: Frank Sautter Date: Mon, 27 Feb 2023 01:54:18 +0100 Subject: [PATCH 3/7] log if transmit is not successful --- src/lorawan.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/lorawan.cpp b/src/lorawan.cpp index 1fc67757..024c69e7 100644 --- a/src/lorawan.cpp +++ b/src/lorawan.cpp @@ -219,7 +219,11 @@ void lora_send(void *pvParameters) { xQueueReceive(LoraSendQueue, &SendBuffer, (TickType_t)0); break; case LMIC_ERROR_TX_BUSY: // LMIC already has a tx message pending + ESP_LOGI(TAG, "Message not sent, LMIC busy, will retry later"); + vTaskDelay(pdMS_TO_TICKS(500 + random(400))); // wait a while + break; case LMIC_ERROR_TX_FAILED: // message was not sent + ESP_LOGI(TAG, "Message not sent, TX failed, will retry later"); vTaskDelay(pdMS_TO_TICKS(500 + random(400))); // wait a while break; case LMIC_ERROR_TX_TOO_LARGE: // message size exceeds LMIC buffer size From 48b643dc2207e97667d1a7dfd5ec5a8cd3c23493 Mon Sep 17 00:00:00 2001 From: cyberman54 Date: Fri, 28 Apr 2023 18:36:42 +0200 Subject: [PATCH 4/7] loglevel verbose for tx_busy/tx_failed --- src/lorawan.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/lorawan.cpp b/src/lorawan.cpp index 024c69e7..a8ca9547 100644 --- a/src/lorawan.cpp +++ b/src/lorawan.cpp @@ -219,11 +219,11 @@ void lora_send(void *pvParameters) { xQueueReceive(LoraSendQueue, &SendBuffer, (TickType_t)0); break; case LMIC_ERROR_TX_BUSY: // LMIC already has a tx message pending - ESP_LOGI(TAG, "Message not sent, LMIC busy, will retry later"); + ESP_LOGV(TAG, "Message not sent, LMIC busy, will retry later"); vTaskDelay(pdMS_TO_TICKS(500 + random(400))); // wait a while break; case LMIC_ERROR_TX_FAILED: // message was not sent - ESP_LOGI(TAG, "Message not sent, TX failed, will retry later"); + ESP_LOGV(TAG, "Message not sent, TX failed, will retry later"); vTaskDelay(pdMS_TO_TICKS(500 + random(400))); // wait a while break; case LMIC_ERROR_TX_TOO_LARGE: // message size exceeds LMIC buffer size From e377cfe4cef031e5fe04601d1371d38f8c54edd0 Mon Sep 17 00:00:00 2001 From: Verkehrsrot Date: Sat, 29 Apr 2023 18:54:25 +0200 Subject: [PATCH 5/7] Update build.yml --- .github/workflows/build.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 33c21f8a..a96ccb03 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -255,7 +255,7 @@ jobs: run: sleep 120s shell: bash - name: Query testboard - uses: indiesdev/curl@v1.1 + uses: cyberman54/curl@v1.2 id: ttn with: #Get latest decoded payload message seen last 120 seconds from testboard @@ -266,4 +266,4 @@ jobs: log-response: false - name: Check testboard response run: - echo ${{ fromJson(steps.ttn.outputs.response).data.result.uplink_message.decoded_payload.pax }} \ No newline at end of file + echo ${{ fromJson(steps.ttn.outputs.response).data.result.uplink_message.decoded_payload.pax }} From 6e0d363c72e1d477bf51e64a476cb30a65b0e1f0 Mon Sep 17 00:00:00 2001 From: Verkehrsrot Date: Fri, 19 May 2023 22:05:33 +0200 Subject: [PATCH 6/7] Update build.yml --- .github/workflows/build.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index a96ccb03..9abac963 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -255,7 +255,7 @@ jobs: run: sleep 120s shell: bash - name: Query testboard - uses: cyberman54/curl@v1.2 + uses: cyberman54/curl id: ttn with: #Get latest decoded payload message seen last 120 seconds from testboard From df22dae756d858bf4d80c3538b4ca004e938d5dc Mon Sep 17 00:00:00 2001 From: Verkehrsrot Date: Fri, 19 May 2023 22:15:32 +0200 Subject: [PATCH 7/7] Update build.yml --- .github/workflows/build.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 9abac963..bd4b63e2 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -255,7 +255,7 @@ jobs: run: sleep 120s shell: bash - name: Query testboard - uses: cyberman54/curl + uses: cyberman54/curl@v1.3 id: ttn with: #Get latest decoded payload message seen last 120 seconds from testboard