Wifi/BLE Paxcounter Project with ESP32 boards

I have the latest build running on my Heltec. Covid stats are showing here in Amsterdam.
Behind BLTH:xx it shows (CWA:x)
Very interesting! Is the CWA number also present in the LORA payload?
signal-2020-10-22-103830

Edit: It looks like that it is the data that I see on Port 10.
image

1 Like

Intresting date Format (00.xxx 1970!
I still struggle with the 01.01.1970 Problem on my T-Beams v1.1
As written down in Issue 639 this should be solved.

Indeed. I decided to stop worrying because I will upload it via nodered to a grafana so the timestamp will be there anyway.

This bug should have been fixed a few days ago.

Covid exposure notification Counter data is handled as user sensor#1, thus is delivered on port10.

1 Like

I noticed that and linked the issue id in my post.
My T-Beams are a bit diffrent as they use an ublox M8N GPS Chip (at least they are labeled as M8N).
With a plain serial monitor i observed not ZDA messages only GGA messages from the module.

With u-center i managed to enable the output of ZDA Data on UART1.

ubx_cfg_n8m

Furthermore the gpsread.cpp needed to be edited to GNZDA insted of GPZDA

TinyGPSPlus gps;
TinyGPSCustom gpstime(gps, “GNZDA”, 1); // field 1 = UTC time (hhmmss.ss)
TinyGPSCustom gpsday(gps, “GNZDA”, 2); // field 2 = day (01…31)
TinyGPSCustom gpsmonth(gps, “GNZDA”, 3); // field 3 = month (01…12)
TinyGPSCustom gpsyear(gps, “GNZDA”, 4); // field 4 = year (4-digit)

But propably this output is also dependeant of the GPS module NMEA sentence configuration.

I will verify this with some other T-Beams and open an issue on Github

What we still miss in paxcounter is a GPS chipset detection and configuration function. It is prepared already in gpsread.cpp, but without code yet.

I selected ZDA for timesync, because with certain GPS chips ZDA has deterministic delay on serial interface, thus it’s more precise. I am still struggling with realtime precision of the time sync routine. If you can help here, this would be highly welcome.

1 Like

Today new paxcounter software v2.1.0 was released:

  • New deep sleep mode
  • New mac filter logic (includes remove of formerly used vendor oui filter)
  • Wifi channel hopping can now be switched off (means sniffing is locked to first channel in band)
  • MQTT code reworked, to reduce disconnects

In deep sleep mode a T-Beam v1.0/1.1 with OLED display draws ~900µA battery power. Deep sleep cycle time can be configured by user. Thus, uptimes of weeks and even months are possible with a T-Beam with single 18650 cell - depending on how often the device shall look for pax (or transmit other sensor data).

5 Likes

Hi, first of all, congrats on this project and on growing community of TTN. I tried to read through almost all messages, but I don’t think i found an answer to my question.
I managed to get the Pax counter running with standard code and it seems to work (but the counted number of people around it, changes all the time, eventhough we’re testing it in the office).

My question is: When there are 2 people entering the office with 5 devices (one has 3 cell phones, one has 1 cellphone and 1 tablet). Is it possible to count them as 2, or only possible to count them as 5 ?

Thanks for help in that or any pointers.

Qlex

Short answer : only possible to count them as 5, the Paxcounter only count the amount off detected device’s.

With these sorts of things you have to do some manual calibration / counting to get an average. So if you spend a day with a manual clicker (from Amazon or similar) and then compare with the PAX counter, you can get a ratio. Do that a few more times and it will get more accurate. After that, less accurate …

Apply some AI/ML at the edge/node and correlate pairs/triplets/quads of radio sets coming in together when same person arrives each time then you can be more precise…but likely requires longer term storage (at least of hashed MAC’s etc to avoid risk of privacy issues/breaches…if work premises write into employment t&c’s?) :thinking: If a number of radios associated with given individual then even if only say 2 or 3 out of 4 active you can determine a given individual present…)

1 Like

Reply to self… use case for EdgeImpulse and our friends Jan J., Zach S., and the crew over there?

Hey @janjongboom HNY2U - its been a while since we saw you on the forum… (really since ‘The Sheep’!?) - is the above data/people extraction from Paxcounter a potential use for EI?

Only if you have some training data - which as well as the BlueTooth data you’d need some hard counts on the people passing in range of the counter.

Given that the majority of the population only carry one BT enabled / active device and a measurable number don’t have BT on and a proportion have a device with BT off or of too low a version to hear or no Bt, it’s a simple ratio. In London the ratio will be different than Bolton or Devon or Kendal or wherever. It just needs someone to stand there for a day or so. ML is a bit over the top in this case.

If you want to use it to track individual people, NSA style (GCHQ have already embedded implants via our Covid vaccinations so they don’t need to use BT), then that’s all about context & permission. I use it to unlock doors, a bugger when I don’t have one of my two phones on me. For staff members in the right environment it makes a great deal of sense over messing with an access control system.

For footfall in Castleton, live ML via video plays a part in terms of identifying ovals with a strip at the bottom and two roundish whitish circles above - this counts adults & young people who are on walking. But still needs validation with a hard count just to be sure.

If you are a shopping centre, this is a great application. If you are a nightclub, not so much.

Hi @Verkehrsrot and other people.

First, thanks for your project cyberman54/ESP32-Paxcounter.

Wifi+Ble scan works fine in my new T-BEAM (T22_v1.1 20191212)

I can see data in my TTN Console, but I don’t see GPS data.

By default, GPSPORT is set to 4, but not work … and I try to set it to 1, to send combined GPS+COUNTERPORT payload, but nothing happens, only Wifi & BLE count devices are displayed with the payload decoder.

On the T-BEAM board, there’s a red led blinking … under the GPS chip, but never fix.

I’m out, with a clear sky view ….

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