Merge pull request #945 from sauttefk/feature/be-more-verbose-when-LoRa-TX-not-successful
Feature/be more verbose when lora tx not successful
This commit is contained in:
commit
d93b4dfea3
@ -1,6 +1,7 @@
|
|||||||
; ---> SELECT ONE TARGET BOARD FROM FOLLOWING ROWS <---
|
; ---> 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.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]
|
[board]
|
||||||
@ -126,6 +127,11 @@ upload_protocol = custom
|
|||||||
|
|
||||||
[env:usb]
|
[env:usb]
|
||||||
upload_protocol = esptool
|
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]
|
[env:dev]
|
||||||
upload_protocol = esptool
|
upload_protocol = esptool
|
||||||
|
@ -1,13 +1,14 @@
|
|||||||
// clang-format off
|
// clang-format off
|
||||||
// upload_speed 921600
|
// upload_speed 921600
|
||||||
// board ttgo-lora32-v1
|
// board ttgo-lora32-v2
|
||||||
|
// https://github.com/LilyGO/TTGO-LORA32
|
||||||
|
|
||||||
#ifndef _TTGOV2_H
|
#ifndef _TTGOV2_H
|
||||||
#define _TTGOV2_H
|
#define _TTGOV2_H
|
||||||
|
|
||||||
#include <stdint.h>
|
#include <stdint.h>
|
||||||
|
|
||||||
// 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 HAS_LORA 1 // comment out if device shall not send data via LoRa
|
||||||
#define CFG_sx1276_radio 1 // HPD13A LoRa SoC
|
#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
|
// Pins for LORA chip SPI interface come from board file, we need some
|
||||||
// additional definitions for LMIC
|
// 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_IO1 (33)
|
||||||
|
// ********************************************************************************************
|
||||||
#define LORA_IO2 LMIC_UNUSED_PIN
|
#define LORA_IO2 LMIC_UNUSED_PIN
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
@ -219,7 +219,11 @@ void lora_send(void *pvParameters) {
|
|||||||
xQueueReceive(LoraSendQueue, &SendBuffer, (TickType_t)0);
|
xQueueReceive(LoraSendQueue, &SendBuffer, (TickType_t)0);
|
||||||
break;
|
break;
|
||||||
case LMIC_ERROR_TX_BUSY: // LMIC already has a tx message pending
|
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
|
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
|
vTaskDelay(pdMS_TO_TICKS(500 + random(400))); // wait a while
|
||||||
break;
|
break;
|
||||||
case LMIC_ERROR_TX_TOO_LARGE: // message size exceeds LMIC buffer size
|
case LMIC_ERROR_TX_TOO_LARGE: // message size exceeds LMIC buffer size
|
||||||
|
Loading…
Reference in New Issue
Block a user