Wifi/BLE Paxcounter Project with ESP32 boards

With the latest version of PAX counter from github I cannot compile the code.

I do get this error:

src\wifiscan.cpp: In function 'void wifi_sniffer_packet_handler(void*, wifi_promiscuous_pkt_type_t)':
src\wifiscan.cpp:16:9: error: 'wifi_ieee80211_packet_t' does not name a type
const wifi_ieee80211_packet_t *ipkt =
^
src\wifiscan.cpp:18:9: error: 'wifi_ieee80211_mac_hdr_t' does not name a type
const wifi_ieee80211_mac_hdr_t *hdr = &ipkt->hdr;
^
src\wifiscan.cpp:25:24: error: 'hdr' was not declared in this scope
mac_add((uint8_t *)hdr->addr2, ppkt->rx_ctrl.rssi, MAC_SNIFF_WIFI);
^
Compiling .pioenvs\ttgov2\lib666\U8g2_ID942\U8x8lib.cpp.o
*** [.pioenvs\ttgov2\src\wifiscan.cpp.o] Error 1
 [ERROR] Took 19.74 seconds

Can anyone point me in a direction how to solve this?

Thanks in advance.

Sorry, the same problem at the moment. Worked a few days ago.

TTGO T3_V1.6 -> ttgo21new

2 Likes

Right, but why this Error:

Archiving .pioenvs\ttgov21new\libef6\libWire.a
sCrc\wifiscan.cpp: In function ‘void wifi_sniffer_packet_handler(void*, wifi_promiscuous_pkt_type_t)’:ompiling .pioenvs\ttgov21new\libb8e\U8g2_ID942\clib\u8g2_box.c.o

src\wifiscan.cpp:16:9: error: ‘wifi_ieee80211_packet_t’ does not name a type
const wifi_ieee80211_packet_t *ipkt =
^
src\wifiscan.cpp:18:9: error: ‘wifi_ieee80211_mac_hdr_t’ does not name a type
const wifi_ieee80211_mac_hdr_t *hdr = &ipkt->hdr;
^
src\wifiscan.cpp:25:24: error: ‘hdr’ was not declared in this scope
mac_add((uint8_t *)hdr->addr2, ppkt->rx_ctrl.rssi, MAC_SNIFF_WIFI);
^
*** [.pioenvs\ttgov21new\src\wifiscan.cpp.o] Error 1

I had to add the include path to wifiscan.h to remove these errors and produce new ones:
My addition to include to platformio.ini:

build_flags =
    -include include/wifiscan.h

Now I get these errors:

Compiling .pioenvs\ttgov2\FrameworkArduino\WString.cpp.o
C:\Users\drasv\.platformio\packages\framework-arduinoespressif32\cores\esp32\WMath.cpp: In function 'unsigned int makeWord(unsigned char, unsigned char)':
C:\Users\drasv\.platformio\packages\framework-arduinoespressif32\cores\esp32\WMath.cpp:65:55: error: ambiguating new declaration of 'unsigned int makeWord(unsigned char, u
nsigned char)'
unsigned int makeWord(unsigned char h, unsigned char l)
^
In file included from ./include\hash.h:4:0,
from <command-line>:0:
C:\Users\drasv\.platformio\packages\framework-arduinoespressif32\cores\esp32/Arduino.h:162:10: note: old declaration 'uint16_t makeWord(byte, byte)'
uint16_t makeWord(byte h, byte l);
^
*** [.pioenvs\ttgov2\FrameworkArduino\WMath.cpp.o] Error 1
 [ERROR] Took 71.92 seconds

I am lost.

Unfortunately i cannot reproduce this in my IDE (Windows 10, Visual studio code, Platformio), code in current repo master branch (commit b921731) compiles without errors.

I made some changes in platformio.ini, i assume that this causes trouble may be with IDEs using Linux or Atom?

Please open issue, maybe someone else can fix this. I think it’s a minor detail, maybe a path setting in platformio.ini

New features in Paxcounter v1.6.82:

  • now supports Bosch BME680 sensor (temp, pressure, humidity, voc).
    Next release shall also report BME680 IAQ (indoor air quality) scale value.
  • now has timesync for the node implemented, primary using GPS time, if not present using time sync over LoRaWAN network*

*) requires MAC command DevTimeReq, not supported on TTNv2 stack

4 Likes

I am using Windows 10, Atom, Platformio.

Sure, something is seriously messed-up and therefore the project is likely no more platform/IDE independant.

My workaround (dirty but effective):
1: In platformio.ini i added to the build_flags::

-include include/wifiscan.h

2: In the file WMath.cpp (my path: C:\Users<username>.platformio\packages\framework-arduinoespressif32\cores\esp32) I uncommented the following lines as these seem to conflict with the declaration and implementation of the arduino libraries:

// unsigned int makeWord(unsigned char h, unsigned char l)
// {
//     return (h << 8) | l;
// }

Now it compiles and I can continue. :grin:

I’ll make a issue and workaround so the real experts can work on a more solid solution.

Paxcounter v1.6.82 on TTGO T-BEAM with additional Bosch BME680 MEMS I2C sensor Screenshot_20181121-081744

2 Likes

But this won’t be the root cause.
Paxcounter code itself is not using WMath.cpp, must be some sort of side effect.

Likely.

Issue is applied to the repo: Cannot compile on Windows 10, Atom, Platformio · Issue #206 · cyberman54/ESP32-Paxcounter · GitHub

Out of curiosity I did a fresh install on Linux (no ide) and it kind of compiled well.

Issues:

  • BME680 code breaks the build (you need to add the Adafruit libs)
  • It does not work well on case sensitive filesystems (I’ll file an issue for that)

But aside that it compiled correctly

For BME680 on your device you need to add this line in platformio.ini in the device environment:

lib_deps =

${common.lib_deps_sensors}

Or use environment generic, which incorporates all features.

Yes, i have seen that. The thing is that currently it requires the lib to compile (with the default settings)…

There is a also a missing include for TimeLib.h from lorawan.cpp

The Adafruit lib will be removed in next release, moving to precompiled Bosch BSEC lib.

3 Likes

Excuse me, is there a complete version that can be compiled without errors? The current one does not work. On none of my computers (IDE (Windows 10, Visual studio code, Platformio
Version: 1.29.1 (system setup)
Date: 2018-11-15T19: 13: 36.375Z
Electron: 2.0.12
Chrome: 61.0.3163.100
Node.js: 8.9.3
V8: 6.1.534.41
Architecture: x64)?

wifiscan.cpp: 16: 9: error or newest with error in bme680…

I still cannot reproduce these errors, please open issue and give more details, thx

I reverted a change made with one of latest commits in platformio.ini.
User which had compile errors, could you please try again with current version in master branch and report here? Thx.

Sorry, but a clean download from github produces the same error like before.

Thanks for testing!
Allright, i have no idea then. Still cannot reproduce the issue in my environment.

1 Like