Wifi/BLE Paxcounter Project with ESP32 boards


(Frasanc1) #371

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


(Verkehrsrot) #372

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.


(Frasanc1) #373

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?


(Verkehrsrot) #374

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


(Frasanc1) #375

This is the output:

Features: LED BATT OTA BLE LORA OUIFLT OLED PLAIN


(Verkehrsrot) #376

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?


(Frasanc1) #377

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


(Frasanc1) #378

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.


(Verkehrsrot) #379

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


(Frasanc1) #380

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?


(Verkehrsrot) #381

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());

(Frasanc1) #382

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.


(Verkehrsrot) #383

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.


(Frasanc1) #384

Thank a lot. I’try to start from there.


(C Wempe) #386

This may be a silly question, because I am a beginner.

But how can I set the RSSI limit via downlink?

I guess I use the downlink form in the concole of my device.
image

I I read the README where it says:

0x01 set scan RSSI limit

1 ... 255 used for wifi and bluetooth scan radius (greater values increase scan radius, values 50...110 > make sense)

0 = RSSI limiter disabled [default]

Bat what does this mean.
What does the Payload look like?

Do I just send 0x0164 ( 0x01 ? for rssi and 64 for 100) if I want to set the rssi limit to 100 ?

Thanks

P.S.: I posted this question with the wrong account earlier.


(Amedee) #387

That’s correct…

And set the FPort to the configured command port (which is by default 2 if my memory serves well)


(Verkehrsrot) #388

For RSSI = 100 you enter 01 64 (for 0x01 0x64) in console downlink field, change FPort to 2, then press send.


(C Wempe) #389

Thanks.
It works. :slight_smile:


(Frasanc1) #390

Hello,
After the tests and to obtain a result close to what we already need, I am writing to tell you the project and some questions.
We will locate the device in the signals of a smart pedestrian crossing, to adjust the assembly the queries are:

  • Could the monitoring be activated when the pedestrian crossing is activated? (What ports could receive the on / off signal of the pedestrian crossing?)
  • Food: Taking into account that the food is similar to public lighting and therefore night, some idea of ​​mounting that allows night charging and daytime operation from the battery. I have been thinking about making a box with a powerbank that charges at night and during the day serves as a battery. The doubt, seeing the consumption is to know the capacity of the battery to cover the needs of the device. Any estimate to support about 16 hours? Any idea will be well received for testing. If you can indicate me some perfect concrete equipment.

Thank you!paso-de-cebra-inteligente


(Verkehrsrot) #391

Power: If you charge 6 hours per night a standard 18650 cell should do the job. You could use a TTGO T-Beam with integrated battery holder/charger for this.

You may check the power of the traffic sign. If the lightning is LED there could be some kind of power supply you may use. Otherwise use 5V USB charger.

Activation: if the goal is to save power this could best be done by using deep sleep mode, but this is not programmed yet. Most power consumption comes from Wifi stack. Take into account that if you load the Wifi stack in the moment when a pedestrian arrived, this could be too late, since starting the stack takes some seconds.

Also take in account that you probably also will count the pax in the waiting cars.