diff --git a/include/lorawan.h b/include/lorawan.h index 49ecea9e..3e930c7e 100644 --- a/include/lorawan.h +++ b/include/lorawan.h @@ -26,7 +26,7 @@ void os_getDevEui(u1_t *buf); void showLoraKeys(void); void switch_lora(uint8_t sf, uint8_t tx); void lora_send(osjob_t *job); -void lora_enqueuedata(uint8_t messageType, MessageBuffer_t *message); +void lora_enqueuedata(MessageBuffer_t *message); void lora_queuereset(void); void lora_housekeeping(void); void user_request_network_time_callback(void *pVoidUserUTCTime, diff --git a/include/spislave.h b/include/spislave.h index 526203b9..f459b2fd 100644 --- a/include/spislave.h +++ b/include/spislave.h @@ -28,7 +28,7 @@ licenses. Refer to LICENSE.txt file in repository for more details. esp_err_t spi_init(); -void spi_enqueuedata(uint8_t messageType, MessageBuffer_t *message); +void spi_enqueuedata(MessageBuffer_t *message); void spi_queuereset(); void spi_housekeeping(); diff --git a/platformio.ini b/platformio.ini index f47007a0..ad0ec982 100644 --- a/platformio.ini +++ b/platformio.ini @@ -29,7 +29,7 @@ description = Paxcounter is a proof-of-concept ESP32 device for metering passeng [common] ; for release_version use max. 10 chars total, use any decimal format like "a.b.c" -release_version = 1.6.63 +release_version = 1.6.68 ; 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 = 0 @@ -43,6 +43,9 @@ board_build.partitions = min_spiffs.csv monitor_speed = 115200 lib_deps_all = ArduinoJson@^5.13.1 + Adafruit Unified Sensor@^1.0.2 + Adafruit BME680 Library@^1.0.7 + Time@>=1.5 lib_deps_lora = ; MCCI LoRaWAN LMIC library@^2.2.2 lib_deps_display = @@ -51,10 +54,6 @@ lib_deps_rgbled = SmartLeds@>=1.1.3 lib_deps_gps = TinyGPSPlus@>=1.0.2 - Time@>=1.5 -lib_deps_sensors = - Adafruit Unified Sensor@^1.0.2 - Adafruit BME680 Library@^1.0.7 build_flags = -include $PROJECTSRC_DIR/hal/${PIOENV}.h -include $PROJECTSRC_DIR/paxcounter.conf @@ -336,7 +335,6 @@ lib_deps = ${common.lib_deps_rgbled} ${common.lib_deps_gps} ${common.lib_deps_display} - ${common.lib_deps_sensors} build_flags = ${common.build_flags} upload_protocol = ${common.upload_protocol} diff --git a/src/lorawan.cpp b/src/lorawan.cpp index 5159531c..bebac6e9 100644 --- a/src/lorawan.cpp +++ b/src/lorawan.cpp @@ -389,7 +389,7 @@ esp_err_t lora_stack_init() { #endif } -void lora_enqueuedata(uint8_t messageType, MessageBuffer_t *message) { +void lora_enqueuedata(MessageBuffer_t *message) { // enqueue message in LORA send queue #ifdef HAS_LORA BaseType_t ret = diff --git a/src/paxcounter.conf b/src/paxcounter.conf index 1135963d..c8c22984 100644 --- a/src/paxcounter.conf +++ b/src/paxcounter.conf @@ -11,7 +11,7 @@ // Payload send cycle and encoding #define SEND_SECS 30 // payload send cycle [seconds/2] -> 60 sec. -#define PAYLOAD_ENCODER 2 // payload encoder: 1=Plain, 2=Packed, 3=CayenneLPP dynamic, 4=CayenneLPP packed +#define PAYLOAD_ENCODER 3 // payload encoder: 1=Plain, 2=Packed, 3=CayenneLPP dynamic, 4=CayenneLPP packed // Set this to include BLE counting and vendor filter functions #define VENDORFILTER 1 // comment out if you want to count things, not people diff --git a/src/senddata.cpp b/src/senddata.cpp index 78215643..50a160c0 100644 --- a/src/senddata.cpp +++ b/src/senddata.cpp @@ -7,14 +7,12 @@ void SendData(uint8_t port) { MessageBuffer_t SendBuffer; SendBuffer.MessageSize = payload.getSize(); - SendBuffer.MessagePort = PAYLOAD_ENCODER <= 2 - ? port - : (PAYLOAD_ENCODER == 4 ? LPP2PORT : LPP1PORT); + SendBuffer.MessagePort = port; memcpy(SendBuffer.Message, payload.getBuffer(), payload.getSize()); // enqueue message in device's send queues - lora_enqueuedata(port, &SendBuffer); - spi_enqueuedata(port, &SendBuffer); + lora_enqueuedata(&SendBuffer); + spi_enqueuedata(&SendBuffer); // clear counter if not in cumulative counter mode if ((port == COUNTERPORT) && (cfg.countermode != 1)) { @@ -49,7 +47,9 @@ void sendPayload() { ESP_LOGD(TAG, "No valid GPS position or GPS data mode disabled"); } #endif - SendData(COUNTERPORT); + SendData(PAYLOAD_ENCODER <= 2 ? COUNTERPORT + : (PAYLOAD_ENCODER == 4 ? LPP2PORT : LPP1PORT)); + } // sendpayload() void flushQueues() { diff --git a/src/spislave.cpp b/src/spislave.cpp index b4f93c4d..9f17a38b 100644 --- a/src/spislave.cpp +++ b/src/spislave.cpp @@ -149,7 +149,7 @@ esp_err_t spi_init() { #endif } -void spi_enqueuedata(uint8_t messageType, MessageBuffer_t *message) { +void spi_enqueuedata(MessageBuffer_t *message) { // enqueue message in SPI send queue #ifdef HAS_SPI BaseType_t ret =