Wifi/BLE Paxcounter Project with ESP32 boards


(Remko) #267

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.


(Go123) #268

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


(Verkehrsrot) #269

TTGO T3_V1.6 -> ttgo21new


(Go123) #270

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


(Remko) #271

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.


(Verkehrsrot) #272

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


(Verkehrsrot) #273

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


(Remko) #274

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.


(Verkehrsrot) #275

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


(Verkehrsrot) #276

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


(Remko) #277

Likely.

Issue is applied to the repo: https://github.com/cyberman54/ESP32-Paxcounter/issues/206


(Amedee) #278

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


(Verkehrsrot) #279

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.


(Amedee) #280

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


(Verkehrsrot) #281

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


(Go123) #282

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…


(Verkehrsrot) #283

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


(Verkehrsrot) #284

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.


(Remko) #285

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


(Verkehrsrot) #286

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