diff --git a/src/paxcounter.conf b/src/paxcounter.conf index 7481c001..15bce027 100644 --- a/src/paxcounter.conf +++ b/src/paxcounter.conf @@ -56,7 +56,8 @@ #define CONFIGPORT 3 // Port on which device sends gps query results #define GPSPORT 4 // Port on which device sends gps query results #define BUTTONPORT 5 // Port on which device sends button pressed signal -#define CAYENNEPORT 2 // Port for Cayenne LPP 2.0 packet sensor encoding +#define LPP1PORT 1 // Port for Cayenne LPP 1.0 dynamic sensor encoding +#define LPP2PORT 2 // Port for Cayenne LPP 2.0 packed sensor encoding // Some hardware settings #define RGBLUMINOSITY 30 // RGB LED luminosity [default = 30%] diff --git a/src/senddata.cpp b/src/senddata.cpp index fc0123b7..8efe7fd3 100644 --- a/src/senddata.cpp +++ b/src/senddata.cpp @@ -9,9 +9,10 @@ void senddata(uint8_t port) { ESP_LOGI(TAG, "LoRa busy, data not sent"); sprintf(display_line7, "LORA BUSY"); } else { - LMIC_setTxData2(PAYLOAD_ENCODER <= 3 ? port : CAYENNEPORT, - payload.getBuffer(), payload.getSize(), - (cfg.countermode & 0x02)); + LMIC_setTxData2( + PAYLOAD_ENCODER <= 2 ? port + : (PAYLOAD_ENCODER == 4 ? LPP2PORT : LPP1PORT), + payload.getBuffer(), payload.getSize(), (cfg.countermode & 0x02)); ESP_LOGI(TAG, "%d bytes queued to send on LoRa", payload.getSize()); sprintf(display_line7, "PACKET QUEUED");