diff --git a/README.md b/README.md index 5aafe240..dbe9d425 100644 --- a/README.md +++ b/README.md @@ -7,7 +7,8 @@ - + + # Use case @@ -55,9 +56,14 @@ Depending on board hardware following features are supported: Target platform must be selected in [platformio.ini](https://github.com/cyberman54/ESP32-Paxcounter/blob/master/platformio.ini).
Hardware dependent settings (pinout etc.) are stored in board files in /hal directory. If you want to use a ESP32 board which is not yet supported, use hal file generic.h and tailor pin mappings to your needs. Pull requests for new boards welcome.
-3D printable cases can be found (and, if wanted so, ordered) on Thingiverse, see -Heltec, TTGOv2, TTGOv2.1, T-BEAM, -T-BEAM parts for example.
+Some 3D printable cases can be found (and, if wanted so, ordered) on Thingiverse, see +Heltec, +TTGOv2, +TTGOv2.1, +TTGO, +T-BEAM, +T-BEAM parts, +for example.
Power consumption was metered at around 450 - 1000mW, depending on board and user settings in paxcounter.conf. By default bluetooth sniffing is disabled (line *#define BLECOUNTER* in paxcounter.conf is commented out). Enabling bluetooth costs 30% more power + 30% flash storage for the software stack. Proof of concept showed that for passenger flow metering wifi sniffing shows better results than bluetooth sniffing. If you enable bluetooth be aware that this goes on expense of wifi sniffing results, because then wifi and bt stack must share the 2,4 GHz RF ressources of ESP32. If you need to sniff wifi and bt in parallel and need best possible results, use two boards - one for wifi only and one for bt only - and add counted results. diff --git a/img/TTGO T-Beam.jpg b/img/TTGO T-Beam.jpg new file mode 100644 index 00000000..b2305f2f Binary files /dev/null and b/img/TTGO T-Beam.jpg differ diff --git a/img/TTGO-case.jpg b/img/TTGO-case.jpg new file mode 100644 index 00000000..5e1d1ad2 Binary files /dev/null and b/img/TTGO-case.jpg differ diff --git a/img/TTGO-curves.jpg b/img/TTGO-curves.jpg new file mode 100644 index 00000000..34d1b05e Binary files /dev/null and b/img/TTGO-curves.jpg differ diff --git a/include/globals.h b/include/globals.h index 890e93cc..daff28ea 100644 --- a/include/globals.h +++ b/include/globals.h @@ -4,6 +4,10 @@ // The mother of all embedded development... #include +// Time functions +#include +#include + // std::set for unified array functions #include #include @@ -102,6 +106,7 @@ extern std::array::iterator it; extern std::array beacons; extern TaskHandle_t irqHandlerTask, wifiSwitchTask; +extern Timezone myTZ; // make Timezone myTZ globally available // application includes #include "led.h" diff --git a/include/gpsread.h b/include/gpsread.h index 79c02de1..3cd4a931 100644 --- a/include/gpsread.h +++ b/include/gpsread.h @@ -2,7 +2,6 @@ #define _GPSREAD_H #include // library for parsing NMEA data -#include #ifdef GPS_I2C // Needed for reading from I2C Bus #include diff --git a/include/lorawan.h b/include/lorawan.h index 2bd1b55b..05aba7cd 100644 --- a/include/lorawan.h +++ b/include/lorawan.h @@ -3,7 +3,6 @@ #include "globals.h" #include "rcommand.h" -#include // LMIC-Arduino LoRaWAN Stack #include diff --git a/include/rtctime.h b/include/rtctime.h index e308ec20..d47ae19c 100644 --- a/include/rtctime.h +++ b/include/rtctime.h @@ -2,8 +2,6 @@ #define _RTCTIME_H #include "globals.h" -#include -#include #include // must be included here so that Arduino library object file references work #include @@ -20,7 +18,6 @@ typedef enum { } clock_state_t; extern RtcDS3231 Rtc; // make RTC instance globally available -extern Timezone myTZ; // make Timezone myTZ globally available int rtc_init(void); int set_rtctime(uint32_t UTCTime); diff --git a/platformio.ini b/platformio.ini index 97cdd382..3f2f9c0d 100644 --- a/platformio.ini +++ b/platformio.ini @@ -6,7 +6,7 @@ ; ---> SELECT TARGET PLATFORM HERE! <--- [platformio] -env_default = generic +;env_default = generic ;env_default = ebox ;env_default = eboxtube ;env_default = heltec @@ -24,7 +24,7 @@ env_default = generic ;env_default = lolin32lora ;env_default = lolin32lite ;env_default = octopus32 -;env_default = ebox, eboxtube, heltec, ttgobeam, lopy4, lopy, ttgov21old, ttgov21new +env_default = ebox, eboxtube, heltec, ttgobeam, lopy4, lopy, ttgov21old, ttgov21new, ttgofox ; description = Paxcounter is a proof-of-concept ESP32 device for metering passenger flows in realtime. It counts how many mobile devices are around. diff --git a/src/lorawan.cpp b/src/lorawan.cpp index 46531c17..fa53fdd7 100644 --- a/src/lorawan.cpp +++ b/src/lorawan.cpp @@ -463,4 +463,4 @@ void user_request_network_time_callback(void *pVoidUserUTCTime, ESP_LOGI(TAG, "LORA Network has set system time to %02d/%02d/%d %02d:%02d:%02d", month(t), day(t), year(t), hour(t), minute(t), second(t)); -} \ No newline at end of file +} diff --git a/src/main.cpp b/src/main.cpp index 8bf6c583..64c50093 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -77,6 +77,11 @@ std::set, Mallocator> macs; // initialize payload encoder PayloadConvert payload(PAYLOAD_BUFFER_SIZE); +// set Time Zone, fetch user setting from paxcounter.conf +TimeChangeRule myDST = DAYLIGHT_TIME; +TimeChangeRule mySTD = STANDARD_TIME; +Timezone myTZ(myDST, mySTD); + // local Tag for logging static const char TAG[] = "main"; diff --git a/src/rtctime.cpp b/src/rtctime.cpp index f2f06372..044a8a96 100644 --- a/src/rtctime.cpp +++ b/src/rtctime.cpp @@ -7,11 +7,6 @@ static const char TAG[] = "main"; RtcDS3231 Rtc(Wire); // RTC hardware i2c interface -// set Time Zone, fetch user setting from paxcounter.conf -TimeChangeRule myDST = DAYLIGHT_TIME; -TimeChangeRule mySTD = STANDARD_TIME; -Timezone myTZ(myDST, mySTD); - // initialize RTC int rtc_init(void) {