Wifi/BLE Paxcounter Project with ESP32 boards

Did you fix this in the past days? (If not, then I guess a description of the protocol might help people review the code.)

The protocol is simple: 4 bytes seconds and 1 byte 1/250th fraction of second, epoch time.

It now works with precision < 10ms, but after 8-14 hours the software crashes. I suspect a problem with I2C access to RTC. Difficult to find.

And still there is that weird bug that suddenly makes the time jump 1-2 hours.

Thanks for the nice project, still ongoing optimisation.
I read, there are concerns of ‘broken TTGO-modules’ delivered to other enthusiastic makers. My Paxcounter is counting properly with v1.2.8 code but no LoraWan connection - it’s stuck in a heap overload and ‘JOINING’ message. Could you please advise on how to check the Lora connectivity separately?

You should upgrade the software, current version is 1.7.4. There were tons of changes since 1.2.8, including change of LoRaWAN LMIC stack, now using better maintained MCCI version.

Broken TTGO modules means dangerous hardware design flaw making connected LiPo batteries explode.
Older TTGO and HELTEC modules were reported to have bad design in RF path, resulting in LoRa join problems.

If join problems persist with current v1.7.4 double check your pin mapping und your LoRaWAN keys. Older TTGO boards may need additional wiring for LoRa DIO1 pin.

1 Like

Latest paxcounter development version now comes with a new multipage display feature. Display pages can be flipped by pressing the device button. Not a big thing, but it was really missed. We start with 4 pages: main, time (LoRaWAN synched!), GPS and BME. Always the current number of pax is displayed, since this is the core function of the device. All data on display is live, changing in real-time with 25fps, thanks to ESP32-Arduino RTOS.

IMG_20190401_183656

2 Likes

If someone here is used to the u8g2 OLED library: you’re welcome to bring a pull request migrating the display from alphanumeric u8x8 to graphical u8g2. Then we could plot some nice curves over time on the display, e.g. PAX flows in last 60 minutes, battery over time, TTN RSSI over time, etc.

1 Like

Maybe a blank page would be nice…
My always on display is now almost completely burned after a year, now I switch it off using downstream commands, but if we now have pagination, we could easily leave it on a blank page, and switch the the required info at will…

1 Like

Hi,

Hello,

After starting a gateway and a PaxCounter device, and uploading the data to TTN for testing, where I have correctly configured the Application, the gateway and the device, I have problems when it comes to understanding the data:

If you can review the images, sending the data in the “plain” configuration, after decoding, the result I get is strange, since I hope to get the number of WIFIs that are detected (around 25) according to what I see in the Debug . What can you owe?

How can you configure the payload I want to send? Since I have doubts and I would like some indication to be able to follow and make changes based on your indications. First of all I would like to be able to identify the correct value of the WIFI counter, the second step would be to change the Payload to configure and send the combination that is of interest to us.

Thank you in advance for your help.

43 25

You probably did install the wrong payload decoder in your ttn console. There are plain and packed, and decoder and compiled feature on the device must much, otherwise you get weird values as seen.

Thanks for your answer.

I am using in the file paxcounter.conf (#define PAYLOAD_ENCODER 1 // payload encoder: 1 = Plain,).

On the other hand in the decoder part I am using what the plain_decoder.js file includes:

function Decoder (bytes, port) {
  var decoded = {};

  if (port === 1) {
    var i = 0;

    if (bytes.length> = 2) {
    decoded.wifi = (bytes [i ++] << 8) | bytes [i ++];}
    
    if (bytes.length> = 4) {
    decoded.ble = (bytes [i ++] << 8) | bytes [i ++];}

    if (bytes.length> 4) {
      decoded.latitude = ((bytes [i ++] << 24) | (bytes [i ++] << 16) | (bytes [i ++] << 8) | bytes [i ++]);
      decoded.longitude = ((bytes [i ++] << 24) | (bytes [i ++] << 16) | (bytes [i ++] << 8) | bytes [i ++]);
      decoded.sats = bytes [i ++];
      decoded.hdop = (bytes [i ++] << 8) | (bytes [i ++]);
      decoded.altitude = (bytes [i ++] << 8) | (bytes [i ++]);
    }
  }

  if (port === 2) {
    var i = 0;
    decoded.battery = ((bytes [i ++] << 8) | bytes [i ++]);
    decoded.uptime = ((bytes [i ++] << 56) | (bytes [i ++] << 48) | (bytes [i ++] << 40) | (bytes [i ++] << 32) |
      (bytes [i ++] << 24) | (bytes [i ++] << 16) | (bytes [i ++] << 8) | bytes [i ++]);
    decoded.temp = bytes [i ++];
    decoded.memory = ((bytes [i ++] << 24) | (bytes [i ++] << 16) | (bytes [i ++] << 8) | bytes [i ++]);
    decoded.reset0 = bytes [i ++];
    decoded.reset1 = bytes [i ++];
  }

  if (port === 4) {
    var i = 0;
    decoded.latitude = ((bytes [i ++] << 24) | (bytes [i ++] << 16) | (bytes [i ++] << 8) | bytes [i ++]);
    decoded.longitude = ((bytes [i ++] << 24) | (bytes [i ++] << 16) | (bytes [i ++] << 8) | bytes [i ++]);
    decoded.sats = bytes [i ++];
    decoded.hdop = (bytes [i ++] << 8) | (bytes [i ++]);
    decoded.altitude = (bytes [i ++] << 8) | (bytes [i ++]);
  }

  if (port === 5) {
    var i = 0;
    decoded.button = bytes [i ++];
  }

  if (port === 6) {
    var i = 0;
    decoded.rssi = bytes [i ++];
    decoded.beacon = bytes [i ++];
  }
  
  if (port === 7) {
    var i = 0;
    decoded.temperature = ((bytes [i ++] << 8) | bytes [i ++]);
    decoded.pressure = ((bytes [i ++] << 8) | bytes [i ++]);
    decoded.humidity = ((bytes [i ++] << 8) | bytes [i ++]);
    decoded.air = ((bytes [i ++] << 8) | bytes [i ++]);
  }

  return decoded;

}

Any Idea?

what does the device show on console output in the line features, plain or packed?

This is the output:

Features: LED BATT OTA BLE LORA OUIFLT OLED PLAIN

Allright, so compiled encoder and installed decoder match.
Then the decoded numbers are correct, since this is what the device sent as payload.

I have no clue what’s going wrong on the device making it sending this weird data.
What do you see in the console log in debug mode?

Now:
Features: PSRAM LED BATT OTA BLE BTN_PD GPS LORA OUIFLT PLAIN

Click to see Extract of MacSnifF and tx info output
I (3681) wifi: ic_enable_sniffer
[I][main.cpp:363] setup(): Starting Interrupt Handler...
[I][main.cpp:389] setup(): Starting Interrupts...
[W][gpsread.cpp:99] get_gpstime(): GPS has no confident time
[I][main.cpp:408] setup(): Unable to sync system time with GPS
[I][lorawan.cpp:278] onEvent(): EV_JOINING
113428: engineUpdate, opmode=0x4
[I][macsniff.cpp:122] mac_add(): new   WiFi RSSI -37dBi -> MAC A87C35CB -> Hash 52E9 -> WiFi:1  BLTH:0 -> 4191788 Bytes left
[I][macsniff.cpp:122] mac_add(): known WiFi RSSI -35dBi -> MAC A87C35CB -> Hash 52E9 -> WiFi:1  BLTH:0 -> 4191788 Bytes left
[I][macsniff.cpp:122] mac_add(): known WiFi RSSI -35dBi -> MAC A87C35CB -> Hash 52E9 -> WiFi:1  BLTH:0 -> 4191688 Bytes left
[I][macsniff.cpp:122] mac_add(): known WiFi RSSI -35dBi -> MAC A87C35CB -> Hash 52E9 -> WiFi:1  BLTH:0 -> 4191784 Bytes left
[I][macsniff.cpp:122] mac_add(): known WiFi RSSI -34dBi -> MAC A87C35CB -> Hash 52E9 -> WiFi:1  BLTH:0 -> 4191500 Bytes left
[I][macsniff.cpp:122] mac_add(): new   WiFi RSSI -83dBi -> MAC 9757F1D3 -> Hash 0222 -> WiFi:2  BLTH:0 -> 4191752 Bytes left
[I][macsniff.cpp:122] mac_add(): known WiFi RSSI -81dBi -> MAC 9757F1D3 -> Hash 0222 -> WiFi:2  BLTH:0 -> 4191752 Bytes left
[I][macsniff.cpp:122] mac_add(): known WiFi RSSI -81dBi -> MAC 9757F1D3 -> Hash 0222 -> WiFi:2  BLTH:0 -> 4191752 Bytes left
333637: engineUpdate, opmode=0x4
333663: engineUpdate, opmode=0x884
333738: TXMODE, freq=868300000, len=23, SF=7, BW=125, CR=4/5, IH=0
[I][macsniff.cpp:122] mac_add(): new   WiFi RSSI -93dBi -> MAC 6FE23D9C -> Hash 9E37 -> WiFi:3  BLTH:0 -> 4191716 Bytes left
[I][macsniff.cpp:122] mac_add(): new   WiFi RSSI -88dBi -> MAC D91D988B -> Hash 1451 -> WiFi:4  BLTH:0 -> 4191560 Bytes left
[I][macsniff.cpp:122] mac_add(): known WiFi RSSI -88dBi -> MAC D91D988B -> Hash 1451 -> WiFi:4  BLTH:0 -> 4191568 Bytes left
[I][macsniff.cpp:122] mac_add(): new   WiFi RSSI -90dBi -> MAC 584EDB6F -> Hash 6309 -> WiFi:5  BLTH:0 -> 4191640 Bytes left
start single rx: now-rxtime: 3
642239: RXMODE_SINGLE, freq=868300000, SF=7, BW=125, CR=4/5, IH=0
[I][lorawan.cpp:209] onEvent(): ADR=1, SF=9, TXPOWER=15
[I][lorawan.cpp:278] onEvent(): EV_JOINED
654989: engineUpdate, opmode=0x800
[I][macsniff.cpp:122] mac_add(): known WiFi RSSI -83dBi -> MAC 9757F1D3 -> Hash 0222 -> WiFi:5  BLTH:0 -> 4191644 Bytes left
[I][macsniff.cpp:122] mac_add(): known WiFi RSSI -80dBi -> MAC 9757F1D3 -> Hash 0222 -> WiFi:5  BLTH:0 -> 4191644 Bytes left
[I][macsniff.cpp:122] mac_add(): new   WiFi RSSI -85dBi -> MAC A5B331F7 -> Hash 1D2F -> WiFi:6  BLTH:0 -> 4191608 Bytes left
[I][macsniff.cpp:122] mac_add(): known WiFi RSSI -87dBi -> MAC A5B331F7 -> Hash 1D2F -> WiFi:6  BLTH:0 -> 4191520 Bytes left
[I][macsniff.cpp:122] mac_add(): new   WiFi RSSI -74dBi -> MAC C8F6C9B8 -> Hash 4840 -> WiFi:7  BLTH:0 -> 4191564 Bytes left
[I][macsniff.cpp:122] mac_add(): known WiFi RSSI -74dBi -> MAC C8F6C9B8 -> Hash 4840 -> WiFi:7  BLTH:0 -> 4191480 Bytes left
[I][macsniff.cpp:122] mac_add(): known WiFi RSSI -75dBi -> MAC C8F6C9B8 -> Hash 4840 -> WiFi:7  BLTH:0 -> 4191496 Bytes left
[I][macsniff.cpp:122] mac_add(): known WiFi RSSI -74dBi -> MAC C8F6C9B8 -> Hash 4840 -> WiFi:7  BLTH:0 -> 4191076 Bytes left
[I][macsniff.cpp:122] mac_add(): known WiFi RSSI -74dBi -> MAC C8F6C9B8 -> Hash 4840 -> WiFi:7  BLTH:0 -> 4191500 Bytes left
[I][macsniff.cpp:122] mac_add(): known WiFi RSSI -83dBi -> MAC 9757F1D3 -> Hash 0222 -> WiFi:7  BLTH:0 -> 4191564 Bytes left
[I][macsniff.cpp:122] mac_add(): known WiFi RSSI -81dBi -> MAC 9757F1D3 -> Hash 0222 -> WiFi:7  BLTH:0 -> 4191568 Bytes left
[I][macsniff.cpp:122] mac_add(): known WiFi RSSI -74dBi -> MAC C8F6C9B8 -> Hash 4840 -> WiFi:7  BLTH:0 -> 4191500 Bytes left
[I][macsniff.cpp:122] mac_add(): known WiFi RSSI -84dBi -> MAC 9757F1D3 -> Hash 0222 -> WiFi:7  BLTH:0 -> 4191568 Bytes left
[I][macsniff.cpp:122] mac_add(): known WiFi RSSI -83dBi -> MAC 9757F1D3 -> Hash 0222 -> WiFi:7  BLTH:0 -> 4191568 Bytes left
[I][macsniff.cpp:122] mac_add(): known WiFi RSSI -83dBi -> MAC 9757F1D3 -> Hash 0222 -> WiFi:7  BLTH:0 -> 4191568 Bytes left
[I][macsniff.cpp:122] mac_add(): known WiFi RSSI -73dBi -> MAC C8F6C9B8 -> Hash 4840 -> WiFi:7  BLTH:0 -> 4191564 Bytes left
[I][macsniff.cpp:122] mac_add(): new   WiFi RSSI -94dBi -> MAC BD464C48 -> Hash 6913 -> WiFi:8  BLTH:0 -> 4191536 Bytes left
[I][macsniff.cpp:122] mac_add(): new   WiFi RSSI -85dBi -> MAC 1FA85BB8 -> Hash 6FF8 -> WiFi:9  BLTH:0 -> 4191496 Bytes left
[I][macsniff.cpp:122] mac_add(): known WiFi RSSI -91dBi -> MAC 1FA85BB8 -> Hash 6FF8 -> WiFi:9  BLTH:0 -> 4191496 Bytes left
[I][macsniff.cpp:122] mac_add(): new   WiFi RSSI -93dBi -> MAC 535AD143 -> Hash DC77 -> WiFi:10  BLTH:0 -> 4191460 Bytes left
[I][macsniff.cpp:122] mac_add(): new   WiFi RSSI -92dBi -> MAC E87E9BFB -> Hash 11FA -> WiFi:11  BLTH:0 -> 4191424 Bytes left
[I][macsniff.cpp:122] mac_add(): known WiFi RSSI -76dBi -> MAC C8F6C9B8 -> Hash 4840 -> WiFi:11  BLTH:0 -> 4191356 Bytes left
[I][macsniff.cpp:122] mac_add(): known WiFi RSSI -75dBi -> MAC C8F6C9B8 -> Hash 4840 -> WiFi:11  BLTH:0 -> 4191356 Bytes left
[I][macsniff.cpp:122] mac_add(): known WiFi RSSI -86dBi -> MAC C8F6C9B8 -> Hash 4840 -> WiFi:11  BLTH:0 -> 4191356 Bytes left
[I][macsniff.cpp:122] mac_add(): known WiFi RSSI -76dBi -> MAC C8F6C9B8 -> Hash 4840 -> WiFi:11  BLTH:0 -> 4191248 Bytes left
[I][macsniff.cpp:122] mac_add(): known WiFi RSSI -76dBi -> MAC C8F6C9B8 -> Hash 4840 -> WiFi:11  BLTH:0 -> 4191344 Bytes left
[I][macsniff.cpp:122] mac_add(): known WiFi RSSI -76dBi -> MAC C8F6C9B8 -> Hash 4840 -> WiFi:11  BLTH:0 -> 4191344 Bytes left
[I][macsniff.cpp:122] mac_add(): known WiFi RSSI -76dBi -> MAC C8F6C9B8 -> Hash 4840 -> WiFi:11  BLTH:0 -> 4191344 Bytes left
[I][macsniff.cpp:122] mac_add(): known WiFi RSSI -75dBi -> MAC C8F6C9B8 -> Hash 4840 -> WiFi:11  BLTH:0 -> 4191424 Bytes left
[I][macsniff.cpp:122] mac_add(): known WiFi RSSI -77dBi -> MAC C8F6C9B8 -> Hash 4840 -> WiFi:11  BLTH:0 -> 4191424 Bytes left
[I][macsniff.cpp:122] mac_add(): known WiFi RSSI -77dBi -> MAC C8F6C9B8 -> Hash 4840 -> WiFi:11  BLTH:0 -> 4191332 Bytes left
[I][macsniff.cpp:122] mac_add(): new   WiFi RSSI -71dBi -> MAC A360A748 -> Hash 6764 -> WiFi:12  BLTH:0 -> 4190424 Bytes left
[I][macsniff.cpp:122] mac_add(): known WiFi RSSI -71dBi -> MAC A360A748 -> Hash 6764 -> WiFi:12  BLTH:0 -> 4190600 Bytes left
[I][macsniff.cpp:122] mac_add(): known WiFi RSSI -71dBi -> MAC A360A748 -> Hash 6764 -> WiFi:12  BLTH:0 -> 4190772 Bytes left
[I][macsniff.cpp:122] mac_add(): known WiFi RSSI -71dBi -> MAC A360A748 -> Hash 6764 -> WiFi:12  BLTH:0 -> 4190948 Bytes left
[I][macsniff.cpp:122] mac_add(): known WiFi RSSI -71dBi -> MAC A360A748 -> Hash 6764 -> WiFi:12  BLTH:0 -> 4191128 Bytes left
[I][macsniff.cpp:122] mac_add(): known WiFi RSSI -71dBi -> MAC A360A748 -> Hash 6764 -> WiFi:12  BLTH:0 -> 4191304 Bytes left
[I][macsniff.cpp:122] mac_add(): known WiFi RSSI -74dBi -> MAC A360A748 -> Hash 6764 -> WiFi:12  BLTH:0 -> 4191304 Bytes left
[I][macsniff.cpp:122] mac_add(): known WiFi RSSI -74dBi -> MAC A360A748 -> Hash 6764 -> WiFi:12  BLTH:0 -> 4190776 Bytes left
[I][macsniff.cpp:122] mac_add(): known WiFi RSSI -74dBi -> MAC A360A748 -> Hash 6764 -> WiFi:12  BLTH:0 -> 4190952 Bytes left
[I][macsniff.cpp:122] mac_add(): known WiFi RSSI -74dBi -> MAC A360A748 -> Hash 6764 -> WiFi:12  BLTH:0 -> 4191124 Bytes left
[I][macsniff.cpp:122] mac_add(): known WiFi RSSI -74dBi -> MAC A360A748 -> Hash 6764 -> WiFi:12  BLTH:0 -> 4191300 Bytes left
[I][macsniff.cpp:122] mac_add(): new   WiFi RSSI -91dBi -> MAC 0E4A22AD -> Hash EB7B -> WiFi:13  BLTH:0 -> 4190672 Bytes left
[I][macsniff.cpp:122] mac_add(): known WiFi RSSI -70dBi -> MAC A360A748 -> Hash 6764 -> WiFi:13  BLTH:0 -> 4190564 Bytes left
[I][macsniff.cpp:122] mac_add(): known WiFi RSSI -70dBi -> MAC A360A748 -> Hash 6764 -> WiFi:13  BLTH:0 -> 4190740 Bytes left
[I][macsniff.cpp:122] mac_add(): known WiFi RSSI -70dBi -> MAC A360A748 -> Hash 6764 -> WiFi:13  BLTH:0 -> 4190916 Bytes left
[I][macsniff.cpp:122] mac_add(): known WiFi RSSI -70dBi -> MAC A360A748 -> Hash 6764 -> WiFi:13  BLTH:0 -> 4191092 Bytes left
[I][macsniff.cpp:122] mac_add(): known WiFi RSSI -70dBi -> MAC A360A748 -> Hash 6764 -> WiFi:13  BLTH:0 -> 4191268 Bytes left
[I][macsniff.cpp:122] mac_add(): known WiFi RSSI -76dBi -> MAC C8F6C9B8 -> Hash 4840 -> WiFi:13  BLTH:0 -> 4191264 Bytes left
[I][macsniff.cpp:122] mac_add(): known WiFi RSSI -77dBi -> MAC C8F6C9B8 -> Hash 4840 -> WiFi:13  BLTH:0 -> 4191284 Bytes left
[I][macsniff.cpp:122] mac_add(): known WiFi RSSI -74dBi -> MAC C8F6C9B8 -> Hash 4840 -> WiFi:13  BLTH:0 -> 4190736 Bytes left
[I][macsniff.cpp:122] mac_add(): known WiFi RSSI -74dBi -> MAC C8F6C9B8 -> Hash 4840 -> WiFi:13  BLTH:0 -> 4191096 Bytes left
[I][macsniff.cpp:122] mac_add(): known WiFi RSSI -74dBi -> MAC C8F6C9B8 -> Hash 4840 -> WiFi:13  BLTH:0 -> 4191260 Bytes left
[I][macsniff.cpp:122] mac_add(): known WiFi RSSI -74dBi -> MAC C8F6C9B8 -> Hash 4840 -> WiFi:13  BLTH:0 -> 4189044 Bytes left
[I][macsniff.cpp:122] mac_add(): known WiFi RSSI -74dBi -> MAC C8F6C9B8 -> Hash 4840 -> WiFi:13  BLTH:0 -> 4189068 Bytes left
[I][macsniff.cpp:122] mac_add(): known WiFi RSSI -74dBi -> MAC C8F6C9B8 -> Hash 4840 -> WiFi:13  BLTH:0 -> 4189228 Bytes left
[I][macsniff.cpp:122] mac_add(): known WiFi RSSI -75dBi -> MAC C8F6C9B8 -> Hash 4840 -> WiFi:13  BLTH:0 -> 4189408 Bytes left
[I][macsniff.cpp:122] mac_add(): known WiFi RSSI -75dBi -> MAC C8F6C9B8 -> Hash 4840 -> WiFi:13  BLTH:0 -> 4189764 Bytes left
[I][macsniff.cpp:122] mac_add(): known WiFi RSSI -75dBi -> MAC C8F6C9B8 -> Hash 4840 -> WiFi:13  BLTH:0 -> 4189924 Bytes left
[I][macsniff.cpp:122] mac_add(): known WiFi RSSI -85dBi -> MAC C8F6C9B8 -> Hash 4840 -> WiFi:13  BLTH:0 -> 4190108 Bytes left
[I][macsniff.cpp:122] mac_add(): known WiFi RSSI -73dBi -> MAC C8F6C9B8 -> Hash 4840 -> WiFi:13  BLTH:0 -> 4190468 Bytes left
[I][macsniff.cpp:122] mac_add(): known WiFi RSSI -73dBi -> MAC C8F6C9B8 -> Hash 4840 -> WiFi:13  BLTH:0 -> 4191116 Bytes left
[I][macsniff.cpp:122] mac_add(): known WiFi RSSI -74dBi -> MAC C8F6C9B8 -> Hash 4840 -> WiFi:13  BLTH:0 -> 4191280 Bytes left
[I][macsniff.cpp:122] mac_add(): known WiFi RSSI -75dBi -> MAC C8F6C9B8 -> Hash 4840 -> WiFi:13  BLTH:0 -> 4190180 Bytes left
[I][macsniff.cpp:122] mac_add(): known WiFi RSSI -75dBi -> MAC C8F6C9B8 -> Hash 4840 -> WiFi:13  BLTH:0 -> 4190340 Bytes left
[I][macsniff.cpp:122] mac_add(): known WiFi RSSI -75dBi -> MAC C8F6C9B8 -> Hash 4840 -> WiFi:13  BLTH:0 -> 4190504 Bytes left
[I][macsniff.cpp:122] mac_add(): known WiFi RSSI -74dBi -> MAC C8F6C9B8 -> Hash 4840 -> WiFi:13  BLTH:0 -> 4190668 Bytes left
[I][macsniff.cpp:122] mac_add(): known WiFi RSSI -74dBi -> MAC C8F6C9B8 -> Hash 4840 -> WiFi:13  BLTH:0 -> 4191260 Bytes left
[I][macsniff.cpp:122] mac_add(): known WiFi RSSI -75dBi -> MAC C8F6C9B8 -> Hash 4840 -> WiFi:13  BLTH:0 -> 4190920 Bytes left
[I][macsniff.cpp:122] mac_add(): known WiFi RSSI -75dBi -> MAC C8F6C9B8 -> Hash 4840 -> WiFi:13  BLTH:0 -> 4191280 Bytes left
[I][macsniff.cpp:122] mac_add(): known WiFi RSSI -75dBi -> MAC C8F6C9B8 -> Hash 4840 -> WiFi:13  BLTH:0 -> 4190368 Bytes left
[I][macsniff.cpp:122] mac_add(): known WiFi RSSI -75dBi -> MAC C8F6C9B8 -> Hash 4840 -> WiFi:13  BLTH:0 -> 4190720 Bytes left
[I][macsniff.cpp:122] mac_add(): known WiFi RSSI -75dBi -> MAC C8F6C9B8 -> Hash 4840 -> WiFi:13  BLTH:0 -> 4191076 Bytes left
[I][macsniff.cpp:122] mac_add(): known WiFi RSSI -74dBi -> MAC C8F6C9B8 -> Hash 4840 -> WiFi:13  BLTH:0 -> 4190576 Bytes left
[I][macsniff.cpp:122] mac_add(): known WiFi RSSI -75dBi -> MAC C8F6C9B8 -> Hash 4840 -> WiFi:13  BLTH:0 -> 4190736 Bytes left
[I][macsniff.cpp:122] mac_add(): known WiFi RSSI -75dBi -> MAC C8F6C9B8 -> Hash 4840 -> WiFi:13  BLTH:0 -> 4190900 Bytes left
[I][macsniff.cpp:122] mac_add(): known WiFi RSSI -72dBi -> MAC C8F6C9B8 -> Hash 4840 -> WiFi:13  BLTH:0 -> 4191348 Bytes left
[D][cyclic.cpp:54] doHousekeeping(): IRQhandler 3644 bytes left | Taskstate = 0
[D][cyclic.cpp:57] doHousekeeping(): Gpsloop 1596 bytes left | Taskstate = 1
[D][cyclic.cpp:71] doHousekeeping(): LEDloop 480 bytes left | Taskstate = 2
[D][battery.cpp:51] read_voltage(): Raw: 2425 / Voltage: 4142mV
[I][cyclic.cpp:77] doHousekeeping(): Voltage: 4142mV
[I][macsniff.cpp:122] mac_add(): new   WiFi RSSI -84dBi -> MAC BA3AC745 -> Hash B6C5 -> WiFi:14  BLTH:0 -> 4191216 Bytes left
[I][macsniff.cpp:122] mac_add(): known WiFi RSSI -84dBi -> MAC BA3AC745 -> Hash B6C5 -> WiFi:14  BLTH:0 -> 4191216 Bytes left
[I][macsniff.cpp:122] mac_add(): new   WiFi RSSI -92dBi -> MAC AD8DB872 -> Hash 5206 -> WiFi:15  BLTH:0 -> 4191168 Bytes left
[I][macsniff.cpp:122] mac_add(): known WiFi RSSI -33dBi -> MAC A87C35CB -> Hash 52E9 -> WiFi:15  BLTH:0 -> 4191172 Bytes left
[I][macsniff.cpp:122] mac_add(): known WiFi RSSI -31dBi -> MAC A87C35CB -> Hash 52E9 -> WiFi:15  BLTH:0 -> 4191172 Bytes left
[I][macsniff.cpp:122] mac_add(): known WiFi RSSI -83dBi -> MAC 1FA85BB8 -> Hash 6FF8 -> WiFi:15  BLTH:0 -> 4191272 Bytes left
[I][macsniff.cpp:122] mac_add(): known WiFi RSSI -91dBi -> MAC 1FA85BB8 -> Hash 6FF8 -> WiFi:15  BLTH:0 -> 4191272 Bytes left
[I][macsniff.cpp:122] mac_add(): known WiFi RSSI -90dBi -> MAC 1FA85BB8 -> Hash 6FF8 -> WiFi:15  BLTH:0 -> 4191272 Bytes left
[I][macsniff.cpp:122] mac_add(): known WiFi RSSI -93dBi -> MAC 1FA85BB8 -> Hash 6FF8 -> WiFi:15  BLTH:0 -> 4191272 Bytes left
[I][macsniff.cpp:122] mac_add(): known WiFi RSSI -37dBi -> MAC A87C35CB -> Hash 52E9 -> WiFi:15  BLTH:0 -> 4191272 Bytes left
[I][macsniff.cpp:122] mac_add(): known WiFi RSSI -37dBi -> MAC A87C35CB -> Hash 52E9 -> WiFi:15  BLTH:0 -> 4191272 Bytes left
[I][macsniff.cpp:122] mac_add(): known WiFi RSSI -36dBi -> MAC A87C35CB -> Hash 52E9 -> WiFi:15  BLTH:0 -> 4191272 Bytes left
[I][macsniff.cpp:122] mac_add(): known WiFi RSSI -36dBi -> MAC A87C35CB -> Hash 52E9 -> WiFi:15  BLTH:0 -> 4191272 Bytes left
[I][macsniff.cpp:122] mac_add(): known WiFi RSSI -75dBi -> MAC C8F6C9B8 -> Hash 4840 -> WiFi:15  BLTH:0 -> 4190852 Bytes left
[I][macsniff.cpp:122] mac_add(): known WiFi RSSI -75dBi -> MAC C8F6C9B8 -> Hash 4840 -> WiFi:15  BLTH:0 -> 4191208 Bytes left
[I][macsniff.cpp:122] mac_add(): known WiFi RSSI -75dBi -> MAC C8F6C9B8 -> Hash 4840 -> WiFi:15  BLTH:0 -> 4191204 Bytes left
[I][macsniff.cpp:122] mac_add(): known WiFi RSSI -75dBi -> MAC C8F6C9B8 -> Hash 4840 -> WiFi:15  BLTH:0 -> 4191204 Bytes left
[I][macsniff.cpp:122] mac_add(): known WiFi RSSI -76dBi -> MAC C8F6C9B8 -> Hash 4840 -> WiFi:15  BLTH:0 -> 4191040 Bytes left
[I][macsniff.cpp:122] mac_add(): known WiFi RSSI -76dBi -> MAC C8F6C9B8 -> Hash 4840 -> WiFi:15  BLTH:0 -> 4191188 Bytes left
[I][macsniff.cpp:122] mac_add(): known WiFi RSSI -76dBi -> MAC C8F6C9B8 -> Hash 4840 -> WiFi:15  BLTH:0 -> 4191016 Bytes left
[I][macsniff.cpp:122] mac_add(): known WiFi RSSI -75dBi -> MAC C8F6C9B8 -> Hash 4840 -> WiFi:15  BLTH:0 -> 4190576 Bytes left
[I][macsniff.cpp:122] mac_add(): known WiFi RSSI -75dBi -> MAC C8F6C9B8 -> Hash 4840 -> WiFi:15  BLTH:0 -> 4190736 Bytes left
[I][macsniff.cpp:122] mac_add(): known WiFi RSSI -75dBi -> MAC C8F6C9B8 -> Hash 4840 -> WiFi:15  BLTH:0 -> 4190904 Bytes left
[I][macsniff.cpp:122] mac_add(): known WiFi RSSI -76dBi -> MAC C8F6C9B8 -> Hash 4840 -> WiFi:15  BLTH:0 -> 4191068 Bytes left
[I][macsniff.cpp:122] mac_add(): known WiFi RSSI -75dBi -> MAC C8F6C9B8 -> Hash 4840 -> WiFi:15  BLTH:0 -> 4190304 Bytes left
[I][macsniff.cpp:122] mac_add(): known WiFi RSSI -75dBi -> MAC C8F6C9B8 -> Hash 4840 -> WiFi:15  BLTH:0 -> 4190464 Bytes left
[I][macsniff.cpp:122] mac_add(): known WiFi RSSI -76dBi -> MAC C8F6C9B8 -> Hash 4840 -> WiFi:15  BLTH:0 -> 4191188 Bytes left
[I][macsniff.cpp:122] mac_add(): known WiFi RSSI -86dBi -> MAC C8F6C9B8 -> Hash 4840 -> WiFi:15  BLTH:0 -> 4191020 Bytes left
[I][macsniff.cpp:122] mac_add(): known WiFi RSSI -76dBi -> MAC C8F6C9B8 -> Hash 4840 -> WiFi:15  BLTH:0 -> 4191072 Bytes left
[I][macsniff.cpp:122] mac_add(): known WiFi RSSI -76dBi -> MAC C8F6C9B8 -> Hash 4840 -> WiFi:15  BLTH:0 -> 4190744 Bytes left
[I][macsniff.cpp:122] mac_add(): known WiFi RSSI -76dBi -> MAC C8F6C9B8 -> Hash 4840 -> WiFi:15  BLTH:0 -> 4190904 Bytes left
[I][macsniff.cpp:122] mac_add(): known WiFi RSSI -77dBi -> MAC C8F6C9B8 -> Hash 4840 -> WiFi:15  BLTH:0 -> 4191068 Bytes left
[I][macsniff.cpp:122] mac_add(): known WiFi RSSI -76dBi -> MAC C8F6C9B8 -> Hash 4840 -> WiFi:15  BLTH:0 -> 4190292 Bytes left
[I][macsniff.cpp:122] mac_add(): known WiFi RSSI -76dBi -> MAC C8F6C9B8 -> Hash 4840 -> WiFi:15  BLTH:0 -> 4190452 Bytes left
[I][macsniff.cpp:122] mac_add(): new   WiFi RSSI -87dBi -> MAC 0B64224C -> Hash 2A8F -> WiFi:16  BLTH:0 -> 4191184 Bytes left
[I][macsniff.cpp:122] mac_add(): new   WiFi RSSI -87dBi -> MAC 187ABF0C -> Hash 4ECC -> WiFi:17  BLTH:0 -> 4191200 Bytes left
[I][macsniff.cpp:122] mac_add(): known WiFi RSSI -87dBi -> MAC 187ABF0C -> Hash 4ECC -> WiFi:17  BLTH:0 -> 4191200 Bytes left
[I][macsniff.cpp:122] mac_add(): new   WiFi RSSI -54dBi -> MAC 390E0C46 -> Hash FB24 -> WiFi:18  BLTH:0 -> 4189816 Bytes left
[I][macsniff.cpp:122] mac_add(): known WiFi RSSI -54dBi -> MAC 390E0C46 -> Hash FB24 -> WiFi:18  BLTH:0 -> 4191076 Bytes left
[I][macsniff.cpp:122] mac_add(): known WiFi RSSI -55dBi -> MAC 390E0C46 -> Hash FB24 -> WiFi:18  BLTH:0 -> 4191076 Bytes left
[D][senddata.cpp:84] sendCounter(): No valid GPS position
[D][senddata.cpp:54] sendCounter(): No valid GPS position. GPS data not appended to counter data.
[I][lorawan.cpp:416] lora_enqueuedata(): 2 bytes enqueued for LORA interface
[I][senddata.cpp:63] sendCounter(): Counter cleared
[D][battery.cpp:51] read_voltage(): Raw: 2425 / Voltage: 4142mV
[I][lorawan.cpp:416] lora_enqueuedata(): 2 bytes enqueued for LORA interface
[D][cyclic.cpp:54] doHousekeeping(): IRQhandler 2604 bytes left | Taskstate = 0
[D][cyclic.cpp:57] doHousekeeping(): Gpsloop 1596 bytes left | Taskstate = 1
[D][cyclic.cpp:71] doHousekeeping(): LEDloop 480 bytes left | Taskstate = 2
[D][battery.cpp:51] read_voltage(): Raw: 2417 / Voltage: 4128mV
[I][cyclic.cpp:77] doHousekeeping(): Voltage: 4128mV
3860387: engineUpdate, opmode=0x808
[I][lorawan.cpp:278] onEvent(): EV_TX_START
3860427: engineUpdate, opmode=0x888
3860494: TXMODE, freq=867100000, len=15, SF=9, BW=125, CR=4/5, IH=0
[I][lorawan.cpp:341] lora_send(): 2 byte(s) sent to LoRa
start single rx: now-rxtime: 11
3931996: RXMODE_SINGLE, freq=867100000, SF=9, BW=125, CR=4/5, IH=0
rxtimeout: entry: 3936887 rxtime: 3931977 entry-rxtime: 4910 now-entry: 4 rxtime-txend: 61092

I think that I have solved the problem. I was compiling with TTGOv21new, now I have change to TTGOTBEAM and It’s ok. The data on TTN have the correct values.
Now I have difference bettwen por 1 and 4, in port 4 the value of GPS is OK, but in port 4, no. I’ll do more tests of configurations.

Thanks a lot. The next step is to change the payload format and data to update.

Paxcounter with new display for BME280/680 sensor values: pax, temp, hum, indoor air quality. Getting insights in pax versus air :mask:

IMG_20190408_200332

7 Likes

For some tests, I would like to be able to print, in Debug mode, on the screen, the list of the hash of macs that are in the variable macs. I do not know exactly how to access this type of variables to be able to traverse and print each mac.

extern std :: set <uint16_t, std :: less <uint16_t>, Mallocator <uint16_t >> macs;

Can you give me some reference?

This is already coded in macsniff.cpp, use debug level verbose to see.

// Log scan result
ESP_LOGV(TAG,
         "%s %s RSSI %ddBi -> MAC %s -> Hash %04X -> WiFi:%d  BLTH:%d -> "
         "%d Bytes left",
         added ? "new  " : "known",
         sniff_type == MAC_SNIFF_WIFI ? "WiFi" : "BLTH", rssi, buff,
         hashedmac, macs_wifi, macs_ble, getFreeRAM());

Right, that option is what I can do now. What I try is to visualize at a certain moment the list of stored macs, that is, when I generate the payload, I would like Debug to be able to see a list of all the macs followed, since in the Debug it writes even when they are repeated indicating if they are new or already included.

What I would need is to show on the screen the list of the macs stored in the memory variable.

Such kind of function was intentionally not integrated in the code due to privacy reasons.
Internally all collected MACs are stored in a container, until they are cleared after a scan cycle. Look at https://en.cppreference.com/w/cpp/container/set to see the options.