Wifi/BLE Paxcounter Project with ESP32 boards

Perhaps you can try this sketch to reset the GPS.
The board with Meshtastic preinstaled can behave very odd.

If you have a version with the ublox M8N GPS chip you can expect problems with timesynchronisation.
There is already an open issue in the github an a solution in this thread a few weeks ago.

Thanks @engelking !

I try to upload T22-GPS-reset-v3, but it seems that doesn’t works.
Maybe I need to try this sketch ? T22-GPS-restoreFactory-v2.ino
My GPS module is NEO-6M.

Captura de pantalla 2021-01-29 a las 10.46.25

What board do you recommend to avoid problems? If can have OLED, all the better.

Sorry ! It seems that works …

Captura de pantalla 2021-01-29 a las 11.24.44

1 Like

Some great news:

Paxcounter is now selectable as off-the-shelf end device in new TTN v3 console.
Thanks to @Caspar for implementing this feature!

image

9 Likes

It’s funny because Paxcounter is actually not a device but a piece of software that runs on different types of hardware devices (where each type can have different hardware versions).

I was wondering what options the “Hardware Ver.” dropdown provides, but currently there are none.

Image 2021-07-29 21·48·51

Is this by design? It’s not clear that no Hardware version must be selected here but a firmware version can be selected (because Firmware Ver. appears greyed out).

I would expect to to see a list with supported hardware under “Hardware Ver.” but maybe this can only contain numbers and not strings?

1 Like

S O L V E D !

Anybody able to spot a (probably obvious) mistake?
I have configured the current Paxcounter code from Github for a Heltec V2 module I had in a drawer. I am in IE so EU868, and all looks right at a glance, I see join requests/accept in the console, time request is sent port 9 as code suggests and if I flip through the OLED screens, I have current time so LoRaWAN appears to be OK?

The Paxcount is updated but the board seems to be hanging waiting for a “rxstart”? The queued messages build up past 10 on the display. I can see the messages being queued on a serial console connected to the board’s USB.

Have I missed a basic setting in the paxcounter.conf? Any idea why I get no data transmitted even though queued?

FYI: the last activity on the Things Stack console is that time request being relayed to the Application server.

Any help appreciated!

It turns out that my V2 Heltec was in fact a V1 and I am guessing there is a DIO/pin-mapping issue. There is a merry dance on the IO between TX and RX and it looks like it was hanging waiting for a DIO that never happened…

Thx, G

Can anyone let me know if the PAX Counter automatically dismisses randomised WIFI MAC addresses ?

I believe these are identified with the following characters

x2:xx:xx:xx:xx:xx
x6:xx:xx:xx:xx:xx
xA:xx:xx:xx:xx:xx
xE:xx:xx:xx:xx:xx

Thanks

Paxcounter does the opposite: it counts only randomized MACs.

Paxcounter release v3.1.0 is out now!

Changes:

  • Libraries EZtime and Arduino Time removed (now using esp-idf native time functions incl. timezone handling)
  • readme.md updated, i.e. fport/rcommand protocol descriptions
  • DCF77 encoder reworked (increased stability, reduced RAM)
  • GPS serial encoder task stability increased (caused watchdog trigger because of missing yield)
  • “Mobaserial” clock protocol removed (because code was draft)
  • TTNv3 device support (thanks to @Drasek)
1 Like

Is it possible to make it count “real” MAC addresses, i need something to use that resembles footfall trafficat a small event.

Just out of interest is the BT count randomized, seems to be workig well at home and picking up speakers etc.

It is possible, and indeed former version of paxcounter (v2.x) worked on “real” MACs.

But times and things changed: If you want to measure footfall, i.e. focusing on smartphones or other mobile devices carried by humans, you achive better results if you count randomized MACs. Because otherwise you will catch lot’s of unmanned devices like cars, wifi routers etc.

Also, focusing on randomized MACs makes it easier to keep your application GDPR compliant.

1 Like

By the way: The wifi / ble counting magics was removed from the paxcounter project. It was outsourced as an independent library, called libpax , which you can use for own projects. Paxcounter v3 is based on libpax.

PM sent

HI, Great project, fun to play around with. Is it possible to adjust the RSSI value via config files without connecting to a Lora network. I have a TTGO device with LED so just watching the counts on screen for now.

Hi i’m new here, i bought a LILYGO TTGO Lora V2.1_1.6 868 Mhz OLED 0.96 inch SD Card esp32 Wi-Fi & Bluetooth and i tried to flash paxcounter. I followed the tutorial and i dont’ have error during this, but now the board it’s in loop. This is the log.

[11:14:21]Backtrace:0x40083ff1:0x3ffcf5000x40096be5:0x3ffcf520 0x4009d3b5:0x3ffcf540 0x40096bdb:0x3ffcf5c0 0x400da8c5:0x3ffcf5e0 0x400da714:0x3ffcf6d0 0x400d4c94:0x3ffcf6f0 0x400d5f09:0x3ffcf710 0x400f35c2:0x3ffcf7f0
[11:14:21]
[11:14:21]
[11:14:21]
[11:14:21]
[11:14:21]ELF file SHA256: 0000000000000000
[11:14:21]
[11:14:21]Rebooting…
[11:14:21]ets Jun 8 2016 00:22:57
[11:14:21]
[11:14:21]rst:0xc (SW_CPU_RESET),boot:0x13 (SPI_FAST_FLASH_BOOT)
[11:14:21]configsip: 188777542, SPIWP:0xee
[11:14:21]clk_drv:0x00,q_drv:0x00,d_drv:0x00,cs0_drv:0x00,hd_drv:0x00,wp_drv:0x00
[11:14:21]mode:DIO, clock div:2
[11:14:21]load:0x3fff0018,len:4
[11:14:21]load:0x3fff001c,len:1044
[11:14:21]load:0x40078000,len:8896
[11:14:21]load:0x40080400,len:5828
[11:14:21]entry 0x400806ac
[11:14:22][ 17][I][configmanager.cpp:96] loadConfig(): [src/configmanager.cpp] Loading device configuration from NVRAM…
[11:14:22][ 19][I][configmanager.cpp:122] loadConfig(): [src/configmanager.cpp] Runtime configuration v3.3.2 loaded
[11:14:22][ 27][I][main.cpp:114] setup(): [src/main.cpp] Starting paxcounter_7aedd1ae v3.3.2 (runmode=0 / restarts=87)
[11:14:22][ 36][I][main.cpp:115] setup(): [src/main.cpp] code build date: 1665521572
[11:14:22][ 43][I][main.cpp:131] setup(): [src/main.cpp] This is ESP32 chip with 2 CPU cores, WiFi/BT/BLE, silicon revision 1, 4MB embedded Flash
[11:14:22][ 55][I][main.cpp:133] setup(): [src/main.cpp] Internal Total heap 224192, internal Free Heap 196848
[11:14:22][ 64][I][main.cpp:139] setup(): [src/main.cpp] ChipRevision 1, Cpu Freq 240, SDK Version v4.4.2
[11:14:22][ 73][I][main.cpp:141] setup(): [src/main.cpp] Flash Size 4194304, Flash Speed 40000000
[11:14:22][ 80][I][main.cpp:143] setup(): [src/main.cpp] Wifi/BT software coexist version 1.2.0
[11:14:22][ 88][I][main.cpp:147] setup(): [src/main.cpp] IBM LMIC version 1.6.1468577746
[11:14:22][ 96][I][main.cpp:152] setup(): [src/main.cpp] Arduino LMIC version 4.1.1.0
[11:14:22][ 103][I][lorawan.cpp:170] printKey(): [src/lorawan.cpp] AppEUI: 70B3D50000000000
[11:14:22][ 110][I][lorawan.cpp:170] printKey(): [src/lorawan.cpp] DevEUI: E89F6D088850FEFF
[11:14:22][ 117][I][lorawan.cpp:170] printKey(): [src/lorawan.cpp] AppKey: 00000000000000000000000000000000
[11:14:22][ 126][I][esp32-hal-i2c.c:75] i2cInit(): Initialising I2C Master: sda=21 scl=22 freq=100000
[11:14:22][ 135][I][i2c.cpp:40] i2c_scan(): [src/i2c.cpp] Starting I2C bus scan…
[11:14:22][ 141][W][Wire.cpp:301] begin(): Bus already started in Master Mode.
[11:14:22][ 265][I][i2c.cpp:71] i2c_scan(): [src/i2c.cpp] Device found at 0x3C, type = Unknown
[11:14:22][ 266][I][i2c.cpp:74] i2c_scan(): [src/i2c.cpp] 1 I2C device(s) found
[11:14:22][ 269][W][Wire.cpp:301] begin(): Bus already started in Master Mode.
[11:14:32][ 10416][I][main.cpp:228] setup(): [src/main.cpp] Starting LED Controller…
[11:14:32][ 10417][I][power.cpp:192] calibrate_voltage(): [src/power.cpp] ADC characterization based on reference voltage stored in eFuse
[11:14:32][ 10427][I][main.cpp:274] setup(): [src/main.cpp] Starting libpax…
[11:14:32][ 10429][I][main.cpp:283] setup(): [src/main.cpp] WIFISCAN: on
[11:14:32][ 10434][I][main.cpp:289] setup(): [src/main.cpp] BLESCAN: on
[11:14:32]ESP_ERROR_CHECK failed: esp_err_t 0x102 (ESP_ERR_INVALID_ARG) at 0x40096bd8
[11:14:32]file: “.pio/libdeps/usb/libpax/lib/libpax/wifiscan.cpp” line 106
[11:14:32]func: void wifi_sniffer_init(uint16_t)
[11:14:32]expression: esp_wifi_set_country(&wifi_country)
[11:14:32]
[11:14:32]abort() was called at PC 0x40096bdb on core 1
[11:14:32]
[11:14:32]
[11:14:32]Backtrace:0x40083ff1:0x3ffcf5000x40096be5:0x3ffcf520 0x4009d3b5:0x3ffcf540 0x40096bdb:0x3ffcf5c0 0x400da8c5:0x3ffcf5e0 0x400da714:0x3ffcf6d0 0x400d4c94:0x3ffcf6f0 0x400d5f09:0x3ffcf710 0x400f35c2:0x3ffcf7f0
[11:14:32]
[11:14:32]
[11:14:32]
[11:14:32]
[11:14:32]ELF file SHA256: 0000000000000000
[11:14:32]
[11:14:32]Rebooting…
[11:14:32]ets Jun 8 2016 00:22:57
[11:14:32]
[11:14:32]rst:0xc (SW_CPU_RESET),boot:0x13 (SPI_FAST_FLASH_BOOT)
[11:14:32]configsip: 188777542, SPIWP:0xee
[11:14:32]clk_drv:0x00,q_drv:0x00,d_drv:0x00,cs0_drv:0x00,hd_drv:0x00,wp_drv:0x00
[11:14:32]mode:DIO, clock div:2
[11:14:32]load:0x3fff0018,len:4
[11:14:32]load:0x3fff001c,len:1044
[11:14:32]load:0x40078000,len:8896
[11:14:32]load:0x40080400,len:5828
[11:14:32]entry 0x400806ac
[11:14:33][ 17][I][configmanager.cpp:96] loadConfig(): [src/configmanager.cpp] Loading device configuration from NVRAM…
[11:14:33][ 19][I][configmanager.cpp:122] loadConfig(): [src/configmanager.cpp] Runtime configuration v3.3.2 loaded
[11:14:33][ 27][I][main.cpp:114] setup(): [src/main.cpp] Starting paxcounter_7aedd1ae v3.3.2 (runmode=0 / restarts=88)
[11:14:33][ 36][I][main.cpp:115] setup(): [src/main.cpp] code build date: 1665521572
[11:14:33][ 43][I][main.cpp:131] setup(): [src/main.cpp] This is ESP32 chip with 2 CPU cores, WiFi/BT/BLE, silicon revision 1, 4MB embedded Flash
[11:14:33][ 55][I][main.cpp:133] setup(): [src/main.cpp] Internal Total heap 224192, internal Free Heap 196848
[11:14:33][ 64][I][main.cpp:139] setup(): [src/main.cpp] ChipRevision 1, Cpu Freq 240, SDK Version v4.4.2
[11:14:33][ 73][I][main.cpp:141] setup(): [src/main.cpp] Flash Size 4194304, Flash Speed 40000000
[11:14:33][ 81][I][main.cpp:143] setup(): [src/main.cpp] Wifi/BT software coexist version 1.2.0
[11:14:33][ 88][I][main.cpp:147] setup(): [src/main.cpp] IBM LMIC version 1.6.1468577746
[11:14:33][ 96][I][main.cpp:152] setup(): [src/main.cpp] Arduino LMIC version 4.1.1.0
[11:14:33][ 103][I][lorawan.cpp:170] printKey(): [src/lorawan.cpp] AppEUI: 70B3D50000000000
[11:14:33][ 110][I][lorawan.cpp:170] printKey(): [src/lorawan.cpp] DevEUI: E89F6D088850FEFF
[11:14:33][ 117][I][lorawan.cpp:170] printKey(): [src/lorawan.cpp] AppKey: 00000000000000000000000000000000
[11:14:33][ 126][I][esp32-hal-i2c.c:75] i2cInit(): Initialising I2C Master: sda=21 scl=22 freq=100000
[11:14:33][ 135][I][i2c.cpp:40] i2c_scan(): [src/i2c.cpp] Starting I2C bus scan…
[11:14:33][ 141][W][Wire.cpp:301] begin(): Bus already started in Master Mode.
[11:14:33][ 265][I][i2c.cpp:71] i2c_scan(): [src/i2c.cpp] Device found at 0x3C, type = Unknown
[11:14:33][ 266][I][i2c.cpp:74] i2c_scan(): [src/i2c.cpp] 1 I2C device(s) found
[11:14:33][ 269][W][Wire.cpp:301] begin(): Bus already started in Master Mode.

Can someone help me?

Please post log, code… and all other thing you can using </>

It makes it more readable for us trying to help you.

I use this code and toutorial (GitHub - cyberman54/ESP32-Paxcounter: Wifi & BLE driven passenger flow metering with cheap ESP32 boards) and i use this board (https://www.amazon.it/LILYGO-V2-1_1-6-Pollici-Bluetooth-Sviluppo/dp/B09FXHSS6P/ref=sr_1_1?__mk_it_IT=ÅMÅŽÕÑ&crid=347HC1VW7WSL5&keywords=lilygo&qid=1665569124&qu=eyJxc2MiOiI1LjIyIiwicXNhIjoiNC4wNiIsInFzcCI6IjIuNTIifQ%3D%3D&sprefix=lilygo%2Caps%2C91&sr=8-1). The logs are the ones I posted above.

The point made was that there are code formatting tools </> to make the code or logs more readable …

Can you tell me a few?

There aren’t a few to name - the </> tool is on the toolbar of the entry box where you type responses in this Discourse forum software.

ToolbarCodeFormatting

It turns this:

[11:14:21]Backtrace:0x40083ff1:0x3ffcf5000x40096be5:0x3ffcf520 0x4009d3b5:0x3ffcf540 0x40096bdb:0x3ffcf5c0 0x400da8c5:0x3ffcf5e0 0x400da714:0x3ffcf6d0 0x400d4c94:0x3ffcf6f0 0x400d5f09:0x3ffcf710 0x400f35c2:0x3ffcf7f0
[11:14:21]
[11:14:21]ELF file SHA256: 0000000000000000
[11:14:21]
[11:14:21]Rebooting…
[11:14:21]ets Jun 8 2016 00:22:57
[11:14:21]
[11:14:21]rst:0xc (SW_CPU_RESET),boot:0x13 (SPI_FAST_FLASH_BOOT)
[11:14:21]configsip: 188777542, SPIWP:0xee

in to this:

[11:14:21]Backtrace:0x40083ff1:0x3ffcf5000x40096be5:0x3ffcf520 0x4009d3b5:0x3ffcf540 0x40096bdb:0x3ffcf5c0 0x400da8c5:0x3ffcf5e0 0x400da714:0x3ffcf6d0 0x400d4c94:0x3ffcf6f0 0x400d5f09:0x3ffcf710 0x400f35c2:0x3ffcf7f0
[11:14:21]
[11:14:21]ELF file SHA256: 0000000000000000
[11:14:21]
[11:14:21]Rebooting…
[11:14:21]ets Jun 8 2016 00:22:57
[11:14:21]
[11:14:21]rst:0xc (SW_CPU_RESET),boot:0x13 (SPI_FAST_FLASH_BOOT)
[11:14:21]configsip: 188777542, SPIWP:0xee

which also turns it in to a scroll box when there is a lot of text.