enhanced Lora runtime parameter display

This commit is contained in:
Klaus K Wilting 2020-02-26 00:40:09 +01:00
parent 2cb5325181
commit f00397929b
2 changed files with 29 additions and 4 deletions

View File

@ -39,7 +39,7 @@ FONT_STRETCHED: 16x32px = 8 chars / line
// local Tag for logging // local Tag for logging
static const char TAG[] = __FILE__; static const char TAG[] = __FILE__;
#define DISPLAY_PAGES (6) // number of paxcounter display pages #define DISPLAY_PAGES (7) // number of paxcounter display pages
// settings for oled display library // settings for oled display library
#define USE_BACKBUFFER #define USE_BACKBUFFER
@ -224,7 +224,8 @@ start:
// page 2: GPS // page 2: GPS
// page 3: BME280/680 // page 3: BME280/680
// page 4: time // page 4: time
// page 5: blank screen // page 5: lorawan parameters
// page 6: blank screen
// page 0: parameters overview // page 0: parameters overview
case 0: case 0:
@ -362,8 +363,32 @@ start:
second(t)); second(t));
break; break;
// page 5: blank screen // page 5: lorawan parameters
case 5: case 5:
#if (HAS_LORA)
// 3|NtwkID:000000 TXpw:aa
// 4|DevAdd:00000000 DR:0
// 5|CHMsk:0000 Nonce:0000
// 6|CUp:000000 CDn:000000
// 7|SNR:-0000 RSSI:-0000
dp_printf(0, 3, FONT_SMALL, 0, "NetwID:%06X TXpw:%-2d",
LMIC.netid & 0x001FFFFF, LMIC.radio_txpow);
dp_printf(0, 4, FONT_SMALL, 0, "DevAdd:%08X DR:%1d", LMIC.devaddr,
LMIC.datarate);
dp_printf(0, 5, FONT_SMALL, 0, "ChMsk:%04X Nonce:%04X", LMIC.channelMap,
LMIC.devNonce);
dp_printf(0, 6, FONT_SMALL, 0, "CUp:%-6d CDn:%-6d", LMIC.seqnoUp,
LMIC.seqnoDn);
dp_printf(0, 7, FONT_SMALL, 0, "SNR:%-5d RSSI:%-5d", LMIC.snr / 4,
LMIC.rssi);
break; // page5
#else // don't show blank page if we are unattended
DisplayPage++; // next page
#endif // HAS_LORA
// page 6: blank screen
case 6:
#ifdef HAS_BUTTON #ifdef HAS_BUTTON
oledFill(0, 1); oledFill(0, 1);
break; break;

View File

@ -98,7 +98,7 @@ void lora_setupForNetwork(bool preJoin) {
if (!cfg.adrmode) if (!cfg.adrmode)
LMIC_setDrTxpow(assertDR(cfg.loradr), cfg.txpower); LMIC_setDrTxpow(assertDR(cfg.loradr), cfg.txpower);
// show current devaddr // show current devaddr
ESP_LOGI(TAG, "DEVaddr: 0x%08X | Network ID: 0x%03X | Network Type: %d", ESP_LOGI(TAG, "DEVaddr: 0x%08X | Network ID: 0x%06X | Network Type: %d",
LMIC.devaddr, LMIC.netid & 0x001FFFFF, LMIC.netid & 0x00E00000); LMIC.devaddr, LMIC.netid & 0x001FFFFF, LMIC.netid & 0x00E00000);
ESP_LOGI(TAG, "RSSI: %d | SNR: %d", LMIC.rssi, LMIC.snr / 4); ESP_LOGI(TAG, "RSSI: %d | SNR: %d", LMIC.rssi, LMIC.snr / 4);
ESP_LOGI(TAG, "Radio parameters: %s | %s | %s", ESP_LOGI(TAG, "Radio parameters: %s | %s | %s",