Wifi/BLE Paxcounter Project with ESP32 boards

I am not sure if wifi sniffing mode can be run parallel on the wifi interface if is in accesspoint oder station mode.

With bluetooth this is possible, but needs to reduce the scan interval so that there is a time slot for maintaining the bluetooth connection.

We urgently need some more contributors to the project who improve the code!

But when it comes to OTA for remote flashing of firmware, SPI could be useful?
OTA via I2C?

I have no experience with that. Another option is to do OTA (A for Air :slightly_smiling_face:) firmware updates over WiFi.

I finely got my TTGO V2.1 T3_V1.5 20180523 with Paxcounter v1.3.82
The DEVEUI is shown in the first display. Now I wonder how to see the data if it is picked up.

From where did you get it?

Please update. Current version is 1.3.91:

Nevertheless, v1.3.82 should run stable, too.

TTGO LoRa32 V2.1 868/915Mhz ESP32 LoRa OLED 0.96 Inch SD Card ESP-32 SMA IP5306 Bluetooth WIFI wireless Module
Properties: Color 868MHz
(yuanfang song)
Store name: LilyGO Store
https://www.aliexpress.com/store/2090076?spm=a2g0s.9042311.0.0.6e144c4dlDAyWW

Did not manage to connect to any gateway with the pre installed software. Installed V1.3.91 with my DevEUI and AppEUI.
Display came the right way and it connected in seconds from my home. 8 km to the closest gatway.
I see new data every 1-2 min, but I do not find the data or payload. Maybe I need some integrator?
Found it. Maybe two gateways got the signal.Nice :slight_smile:

Metadata:
{
“time”: “2018-07-19T07:25:48.992818158Z”,
“frequency”: 868.3,
“modulation”: “LORA”,
“data_rate”: “SF9BW125”,
“coding_rate”: “4/5”,
“gateways”: [
{
“gtw_id”: “trt-sluppen-loragw01”,
“timestamp”: 2040610164,
“time”: “2018-07-19T07:24:43Z”,
“channel”: 1,
“rssi”: -107,
“snr”: -4.5,
“rf_chain”: 1
},
{
“gtw_id”: “trt-olav-loragw01”,
“timestamp”: 1080798172,
“time”: “2018-07-19T07:25:05Z”,
“channel”: 1,
“rssi”: -111,
“snr”: -4.75,
“rf_chain”: 1
}
]
}

But where is the payload?
In the display I see in the last line:
Packet Queued

09:44:47 0 1 retry dev id:ttgofirst payload:03000100
09:44:37

Dev addr is changing for each message, and only one time did I get port and payload data?

If the dev addr changes for each message, your device contiously rejoins.
Check on serial console if the device is in a reset loop, but this should be cleary visible on the display, too.

If you do not see status “TX COMPLETE”, only status “PACKET QUEUED” on display, the device is not sending payload data, because it either reached duty cycle or the LoRa chip does not trigger the event, what is typically caused by missing or erraneous wiring of DIO1 pin of LoRa chip or wrong pin setting in the .h file.

1 Like

It is working better today.
First it changes dev addr on every line with activation. Then it starts to send payload every 4 min. Then after 10 uplinks on port 1 it start to also to do downlink on port 0.
bilde

It is downloading on port 0, but I do not see a pattern, or what triggers the downlink?
bilde

When I lifted the TTGO up from the table, so the antenna is vertical, no payload is lost.
37397518_10160742687810217_2232075043234381824_n

Now there is a downlink after every uplink, and I see three different gatways gets the data. So moving the antenna up 30 cm and holding it vertical maks a great improvments in reach.

bilde

Payload send cycle 240secs (= 4 min.) is the default. You can change it in paxcounter.conf.

The packets on port 0 are network MAC commands, sent because ADR is enabled by default. You can disable it in paxcounter.conf.

Send cycle and adr mode can also be set by remote command on port 2.

Read the readme.me and paxcounter.conf!

We are currently building the camp site facilities for two big scout camps in the Netherlands and we are registering the restaurant occupancy using a PAX counter connected to the temporary TTN coverage on the camp-site

16
26

The onsite sensors and the pax counter can be followed live at Cayenne: https://cayenne.mydevices.com/shared/5b3b43e2e27e6d6ced85ab1c/project/85932766-0c1e-4a5d-b7de-2f7bfc9f0e80

5 Likes

Default is no more default :wink:

(Flashed a new device and counted quite a lot of people in my little lab :joy: )

Great! How did you manage to get the pax count number in cayenne as “Custom” field?

Oh, that was an unwanted breaking change, i will correct this.

1 Like

I used analoginput for the pax value. sort of abuse but fits the purpose/