From 464809a54e4f530733a16bed0d24b09d442cad29 Mon Sep 17 00:00:00 2001 From: Verkehrsrot Date: Fri, 20 Sep 2019 21:42:59 +0200 Subject: [PATCH] bugfix cfg.txpower --- README.md | 14 +------------- platformio.ini | 8 ++++---- src/paxcounter.conf | 2 +- src/rcommand.cpp | 2 +- 4 files changed, 7 insertions(+), 19 deletions(-) diff --git a/README.md b/README.md index 8b20a195..eaea51cd 100644 --- a/README.md +++ b/README.md @@ -327,19 +327,7 @@ Note: all settings are stored in NVRAM and will be reloaded when device starts. 0x06 set LoRa TXpower - 0 ... 15 [default: 7] - - TXPower Configuration - 0 Max EIRP (usually +16dB) - 1 -2dB - 2 -4dB - 3 -6dB - 4 -8dB - 5 -10dB - 6 -12dB - 7 -14dB - 8 .. 14 reserved for future use (RFU) - 15 ignored (device keeps current setting) + 0 ... 255 desired TX power in dBm [default: 14] 0x07 set LoRa Adaptive Data Rate mode diff --git a/platformio.ini b/platformio.ini index 055aadf3..dbab2b1b 100644 --- a/platformio.ini +++ b/platformio.ini @@ -7,7 +7,7 @@ ; ---> SELECT THE TARGET PLATFORM HERE! <--- [board] -;halfile = generic.h +halfile = generic.h ;halfile = ebox.h ;halfile = eboxtube.h ;halfile = ecopower.h @@ -18,7 +18,7 @@ ;halfile = ttgov21old.h ;halfile = ttgov21new.h ;halfile = ttgofox.h -halfile = ttgobeam.h +;halfile = ttgobeam.h ;halfile = ttgobeam10.h ;halfile = fipy.h ;halfile = lopy.h @@ -43,10 +43,10 @@ description = Paxcounter is a device for metering passenger flows in realtime. I [common] ; for release_version use max. 10 chars total, use any decimal format like "a.b.c" -release_version = 1.8.3 +release_version = 1.8.31 ; DEBUG LEVEL: For production run set to 0, otherwise device will leak RAM while running! ; 0=None, 1=Error, 2=Warn, 3=Info, 4=Debug, 5=Verbose -debug_level = 4 +debug_level = 3 extra_scripts = pre:build.py otakeyfile = ota.conf lorakeyfile = loraconf.h diff --git a/src/paxcounter.conf b/src/paxcounter.conf index 5ee3a9a2..4f866c27 100644 --- a/src/paxcounter.conf +++ b/src/paxcounter.conf @@ -49,7 +49,7 @@ #define RETRANSMIT_RCMD 5 // [seconds] wait time before retransmitting rcommand results #define PAYLOAD_BUFFER_SIZE 51 // maximum size of payload block per transmit #define LORADRDEFAULT 5 // 0 .. 15, LoRaWAN datarate, according to regional LoRaWAN specs [default = 5] -#define LORATXPOWDEFAULT 7 // 0 .. 15, LoRaWAN TX power [default = 7] +#define LORATXPOWDEFAULT 7 // 0 .. 255, LoRaWAN TX power in dBm [default = 14] #define MAXLORARETRY 500 // maximum count of TX retries if LoRa busy #define SEND_QUEUE_SIZE 10 // maximum number of messages in payload send queue [1 = no queue] diff --git a/src/rcommand.cpp b/src/rcommand.cpp index 5c08210e..e8b9f3da 100644 --- a/src/rcommand.cpp +++ b/src/rcommand.cpp @@ -254,7 +254,7 @@ void set_lorapower(uint8_t val[]) { #if (HAS_LORA) // set data rate and transmit power only if we have no ADR if (!cfg.adrmode) { - cfg.txpower = val[0] & 0x0f; + cfg.txpower = val[0]; ESP_LOGI(TAG, "Remote command: set LoRa TXPOWER to %d", cfg.txpower); LMIC_setDrTxpow(assertDR(cfg.loradr), cfg.txpower); } else