diff --git a/src/paxcounter.conf b/src/paxcounter.conf index 6c2b0005..3cdc90ea 100644 --- a/src/paxcounter.conf +++ b/src/paxcounter.conf @@ -36,7 +36,7 @@ #define WIFI_CHANNEL_SWITCH_INTERVAL 50 // [seconds/100] -> 0,5 sec. // LoRa payload default parameters -#define PAYLOAD_ENCODER 1 // select payload encoder: 1=Plain, 2=Packed, 3=CayenneLPP +#define PAYLOAD_ENCODER 3 // select payload encoder: 1=Plain, 2=Packed, 3=CayenneLPP #define SEND_SECS 120 // payload send cycle [seconds/2] -> 240 sec. #define MEM_LOW 2048 // [Bytes] low memory threshold triggering a send cycle #define RETRANSMIT_RCMD 5 // [seconds] wait time before retransmitting rcommand results diff --git a/src/payload.cpp b/src/payload.cpp index 30a311a9..ef6780ce 100644 --- a/src/payload.cpp +++ b/src/payload.cpp @@ -183,14 +183,16 @@ void PayloadConvert::writeBitmap(bool a, bool b, bool c, bool d, bool e, bool f, #elif PAYLOAD_ENCODER == 3 void PayloadConvert::addCount(uint16_t value1, uint16_t value2) { + uint16_t val1 = value1 * 100; + uint16_t val2 = value2 * 100; buffer[cursor++] = LPP_COUNT_WIFI_CHANNEL; buffer[cursor++] = LPP_ANALOG_INPUT; // workaround, type meter not found? - buffer[cursor++] = value1 >> 8; - buffer[cursor++] = value1; + buffer[cursor++] = val1 >> 8; + buffer[cursor++] = val1; buffer[cursor++] = LPP_COUNT_BLE_CHANNEL; buffer[cursor++] = LPP_ANALOG_INPUT; // workaround, type meter not found? - buffer[cursor++] = value1 >> 8; - buffer[cursor++] = value2; + buffer[cursor++] = val2 >> 8; + buffer[cursor++] = val2; } #ifdef HAS_GPS