v1.7.36 (issue #250)
This commit is contained in:
parent
b51f3495af
commit
9fcf374de0
@ -17,7 +17,6 @@ void housekeeping(void);
|
||||
void doHousekeeping(void);
|
||||
uint64_t uptime(void);
|
||||
void reset_counters(void);
|
||||
int redirect_log(const char *fmt, va_list args);
|
||||
uint32_t getFreeRAM();
|
||||
|
||||
#endif
|
@ -4,7 +4,7 @@
|
||||
#include "globals.h"
|
||||
#include "rcommand.h"
|
||||
#include "timekeeper.h"
|
||||
#ifdef DBTIMESYNC
|
||||
#if(DBTIMESYNC)
|
||||
#include "DBtimesync.h"
|
||||
#endif
|
||||
|
||||
|
@ -9,7 +9,7 @@
|
||||
#include <rom/rtc.h>
|
||||
#include "cyclic.h"
|
||||
#include "timekeeper.h"
|
||||
#ifdef DBTIMESYNC
|
||||
#if(DBTIMESYNC)
|
||||
#include "DBtimesync.h"
|
||||
#endif
|
||||
|
||||
|
@ -30,7 +30,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.7.35
|
||||
release_version = 1.7.36
|
||||
; 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 = 3
|
||||
|
@ -116,10 +116,3 @@ void reset_counters() {
|
||||
macs_wifi = 0;
|
||||
macs_ble = 0;
|
||||
}
|
||||
|
||||
#if(VERBOSE)
|
||||
int redirect_log(const char *fmt, va_list args) {
|
||||
// do nothing
|
||||
return 0;
|
||||
}
|
||||
#endif
|
||||
|
@ -225,7 +225,7 @@ void onEvent(ev_t ev) {
|
||||
|
||||
case EV_TXCOMPLETE:
|
||||
|
||||
#ifdef DBTIMESYNC
|
||||
#if(DBTIMESYNC)
|
||||
if (!(LMIC.txrxFlags & TXRX_ACK) && time_sync_seqNo)
|
||||
time_sync_messages[time_sync_seqNo - 1] = LMIC.txend;
|
||||
#endif
|
||||
|
19
src/main.cpp
19
src/main.cpp
@ -105,9 +105,6 @@ static const char TAG[] = __FILE__;
|
||||
|
||||
void setup() {
|
||||
|
||||
// disable the default wifi logging
|
||||
esp_log_level_set("wifi", ESP_LOG_NONE);
|
||||
|
||||
char features[100] = "";
|
||||
|
||||
// create some semaphores for syncing / mutexing tasks
|
||||
@ -130,7 +127,6 @@ void setup() {
|
||||
#else
|
||||
// mute logs completely by redirecting them to silence function
|
||||
esp_log_level_set("*", ESP_LOG_NONE);
|
||||
esp_log_set_vprintf(redirect_log);
|
||||
#endif
|
||||
|
||||
ESP_LOGI(TAG, "Starting %s v%s", PRODUCTNAME, PROGVERSION);
|
||||
@ -162,13 +158,14 @@ void setup() {
|
||||
#ifdef HAS_LORA
|
||||
ESP_LOGI(TAG, "IBM LMIC version %d.%d.%d", LMIC_VERSION_MAJOR,
|
||||
LMIC_VERSION_MINOR, LMIC_VERSION_BUILD);
|
||||
|
||||
ESP_LOGI(TAG, "Arduino LMIC version %d.%d.%d.%d",
|
||||
ARDUINO_LMIC_VERSION_GET_MAJOR(ARDUINO_LMIC_VERSION),
|
||||
ARDUINO_LMIC_VERSION_GET_MINOR(ARDUINO_LMIC_VERSION),
|
||||
ARDUINO_LMIC_VERSION_GET_PATCH(ARDUINO_LMIC_VERSION),
|
||||
ARDUINO_LMIC_VERSION_GET_LOCAL(ARDUINO_LMIC_VERSION));
|
||||
#endif
|
||||
ESP_LOGI(TAG, "DEVEUI: ");
|
||||
showLoraKeys();
|
||||
#endif // HAS_LORA
|
||||
|
||||
#ifdef HAS_GPS
|
||||
ESP_LOGI(TAG, "TinyGPS+ version %s", TinyGPSPlus::libraryVersion());
|
||||
@ -251,10 +248,7 @@ void setup() {
|
||||
btStop();
|
||||
#else
|
||||
// remove bluetooth stack to gain more free memory
|
||||
ESP_ERROR_CHECK(esp_bluedroid_disable());
|
||||
ESP_ERROR_CHECK(esp_bluedroid_deinit());
|
||||
btStop();
|
||||
ESP_ERROR_CHECK(esp_bt_controller_deinit());
|
||||
ESP_ERROR_CHECK(esp_bt_mem_release(ESP_BT_MODE_BTDM));
|
||||
ESP_ERROR_CHECK(esp_coex_preference_set((
|
||||
esp_coex_prefer_t)ESP_COEX_PREFER_WIFI)); // configure Wifi/BT coexist lib
|
||||
@ -346,13 +340,6 @@ void setup() {
|
||||
// show compiled features
|
||||
ESP_LOGI(TAG, "Features:%s", features);
|
||||
|
||||
#ifdef HAS_LORA
|
||||
// output LoRaWAN keys to console
|
||||
#if(VERBOSE)
|
||||
showLoraKeys();
|
||||
#endif
|
||||
#endif
|
||||
|
||||
// start wifi in monitor mode and start channel rotation timer
|
||||
ESP_LOGI(TAG, "Starting Wifi...");
|
||||
wifi_sniffer_init();
|
||||
|
@ -15,7 +15,7 @@
|
||||
|
||||
// Set this to include BLE counting and vendor filter functions
|
||||
#define VENDORFILTER 1 // set to 0 if you want to count things, not people
|
||||
#define BLECOUNTER 1 // set it to 1 if you want to use BLE count, at expense of memory
|
||||
#define BLECOUNTER 0 // set it to 1 if you want to use BLE count, at expense of memory
|
||||
|
||||
// BLE scan parameters
|
||||
#define BLESCANTIME 0 // [seconds] scan duration, 0 means infinite [default], see note below
|
||||
@ -67,8 +67,8 @@
|
||||
|
||||
// settings for syncing time of node with external time source
|
||||
#define TIME_SYNC_INTERVAL 2 // sync time attempt each .. minutes from time source (GPS/LORA/RTC) [default = 60], comment out means off
|
||||
//#define TIME_SYNC_LORA 1 // use LORA network as time source, comment out means off [default = off]
|
||||
//#define DBTIMESYNC 1 // use DB LORA timeserver with patented sync algorithm [default = off]
|
||||
#define TIME_SYNC_LORA 0 // set to 1 to use LORA network as time source, comment out means off [default = off]
|
||||
#define DBTIMESYNC 0 // set to 1 to use DB LORA timeserver with patented sync algorithm [default = off]
|
||||
|
||||
// time zone, see https://github.com/JChristensen/Timezone/blob/master/examples/WorldClock/WorldClock.ino
|
||||
#define DAYLIGHT_TIME {"CEST", Last, Sun, Mar, 2, 120} // Central European Summer Time
|
||||
|
@ -306,7 +306,7 @@ cmd_t table[] = {{0x01, set_rssi, 1, true},
|
||||
{0x84, get_gps, 0, false},
|
||||
{0x85, get_bme, 0, false},
|
||||
{0x86, get_time, 0, false}
|
||||
#ifdef DBTIMESYNC
|
||||
#if(DBTIMESYNC)
|
||||
,
|
||||
{TIME_ANS_OPCODE, recv_DBtime_ans, 0, false},
|
||||
{TIME_SYNC_OPCODE, force_DBtime_sync, 0, false}
|
||||
|
@ -36,10 +36,10 @@ time_t timeProvider(void) {
|
||||
#endif
|
||||
|
||||
// kick off asychronous DB timesync if we have
|
||||
#ifdef DBTIMESYNC
|
||||
#if(DBTIMESYNC)
|
||||
send_DBtime_req();
|
||||
// kick off asychronous lora sync if we have
|
||||
#elif defined HAS_LORA && defined TIME_SYNC_LORA
|
||||
#elif defined HAS_LORA && (TIME_SYNC_LORA)
|
||||
LMIC_requestNetworkTime(user_request_network_time_callback, &userUTCTime);
|
||||
#endif
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user