Giter VIP home page Giter VIP logo

esp32-blecollector's Introduction

ESP32-BLECollector

Join the chat at https://gitter.im/ESP32-BLECollector/ESP32-BLECollector Build Status

A BLE Scanner with persistence.

ESP32 BLECollector running on Wrover-Kit ESP32 BLECollector running on M5Stack

BLECollector is just a passive BLE scanner with a fancy UI. All BLE data found by the BLE Scanner is collected into a sqlite3 format on the SD Card.

Public Mac addresses are compared against OUI list, while Vendor names are compared against BLE Device list.

Those two database files are provided in a db format (mac-oui-light.db and ble-oui.db).

On first run, a default blemacs.db file is created, this is where BLE data will be stored. When a BLE device is found by the scanner, it is populated with the matching oui/vendor name (if any) and eventually inserted in the blemasc.db file.

⚠️ This sketch is big! Use the "No OTA (Large Apps)" or "Minimal SPIFFS (Large APPS with OTA)" partition scheme to compile it. The memory cost of using sqlite and BLE libraries is quite high.

⚠️ Builds using ESP32-Wrover can eventually choose the 3.6MB SPIFFS partition scheme, and have the BLECollector working without the SD Card. Experimental support only since SPIFFS tends to get slower and buggy when the partition becomes full.

Hardware requirements

  • [mandatory] ESP32-Wroom or ESP32-Wrover (Wrover is recommended)
  • [mandatory] SD Card (breakout or bundled in Wrover-Kit, M5Stack, Odroid-Go, LoLinD32 Pro)
  • [mandatory] Micro SD (FAT32 formatted, max 4GB)
  • [mandatory] mac-oui-light.db and ble-oui.db files copied on the Micro SD Card root
  • [mandatory] ST7789/ILI9341 320x240 TFT (or bundled in Wrover-Kit, M5Stack, Odroid-Go, LoLinD32 Pro, D-Duino32-XS)
  • [optional] (but recommended) I2C RTC Module (see #define HAS_EXTERNAL_RTC in Settings.h)
  • [optional] Serial GPS Module (see #define HAS_GPS in Settings.h)
  • [⚠ NEW][optional] XPad Buttons Shield from Radomir Dopieralski

Software requirements (updated)

Behaviours (auto-selected except for WiFi):

  • Hobo: when no TinyRTC module exists in your build, only uptime will be displayed
  • Rogue: TinyRTC module adjusted after flashing (build DateTime), shares time over BLE
  • Chronomaniac: TinyRTC module adjusts itself via GPS, shares time over BLE
  • With WiFi: Temporary dual BLE/WiFi mode to allow downloading or serving .db files, see #define WITH_WIFI in Settings.h

Optional I2C RTC Module requirements

  • Wire your TinyRTC to RTC_SDA/RTC_SCL (see Settings.h or Display.h to override)
  • Insert the SD Card
  • Set #define HAS_EXTERNAL_RTC true in Settings.h
  • Flash the ESP with partition scheme Minimal SPIFFS (Large APPS with OTA)

Optional Serial GPS Module requirements

  • Wire your GPS module to TX1/RX1 (edit GPS_RX and GPS_TX in GPS.h
  • Set #define HAS_GPS true in Settings.h
  • Flash the ESP with partition scheme Minimal SPIFFS (Large APPS with OTA)
  • Wait for the GPS to find a fix
  • issue the command gpstime in the serial console

Optional XPad Buttons Shield requirements

  • Wire your XPad Buttons Shield to XPAD_SDA/XPAD_SCL (see HID_XPad.h to override)
  • Enable the module in Display.h : #define hasXPaxShield() (bool) true
  • Controls are:
    • Down / Up : brightness
    • Right / Left : unassigned (yet)
    • A : start/stop scan
    • B / C : toggle mac filter
    • D : unassigned (yet)

Time Sharing

  • Once the time is set using RTC, GPS or NTP, the BLECollector may start the TimeSharing service and advertise a DateTime characteristic for other BLECollectors to sync with.
  • Builds with no RTC/GPS will try to identify this service during their scan duty cycle and subscribe for notifications.

File Downloading (still experimental)

Sending the DownloadDB command will:

  • Stop BLE
  • Start WiFi
  • Synchronize time to a nearby NTP server
  • Download the latest oui/vendors database from github

Serial command interface

Available Commands:

01)             help : Print this list
02)             halp : Same as help except it doesn't print anything
03)            start : Start/resume scan
04)             stop : Stop scan
05)     toggleFilter : Toggle vendor filter on the TFT (persistent)
06)       toggleEcho : Toggle BLECards in the Serial Console (persistent)
07)      setTimeZone : Set the timezone for next NTP Sync (persistent)
08)    setSummerTime : Toggle CEST / CET for next NTP Sync (persistent)
09)             dump : Dump returning BLE devices to the display and updates DB
10)    setBrightness : Set brightness to [value] (0-255) (persistent)
11)               ls : Show [dir] Content on the SD
12)               rm : Delete [file] from the SD
13)          restart : Restart BLECollector ('restart now' to skip replication)
14)       screenshot : Make a screenshot and save it on the SD
15)       screenshow : Show screenshot
16)           toggle : toggle a bool value
17)          resetDB : Hard Reset DB + forced restart
18)          pruneDB : Soft Reset DB without restarting (hopefully)
19)         bleclock : Broadcast time to another BLE Device (implicit)
20)          bletime : Get time from another BLE Device (explicit)
21)          gpstime : Sync time from GPS
22)           latlng : Print the GPS lat/lng
23)          stopBLE : Stop BLE (use 'restart' command to re-enable)
24)        startWiFi : Start WiFi (will stop BLE)
25)      setPoolZone : Set NTP Pool Zone for next NTP Sync (persistent)
26)          NTPSync : Update time from NTP (will start WiFi)
27)       DownloadDB : Download or update db files (will start WiFi and update NTP first)
28)      setWiFiSSID : Set WiFi SSID
29)      setWiFiPASS : Set WiFi Password

Contributions are welcome :-)

Known issues / Roadmap

Implementing both LovyanGFX and Nimble-Arduino was such a huge optimization that none of the previous blockers exist any more!

Some ideas I'll try to implement in the upcoming changes:

  • Add GPS Coords to entries for better pruning as suggested by /u/playaspect
  • Better Analysis of ServiceData (see @reelyactive's advlib)
  • Extended logging (SDCard-less meshed builds)

Other ESP32 security related tools:

Credits/requirements:

esp32-blecollector's People

Contributors

per1234 avatar tobozo avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

esp32-blecollector's Issues

Noob question

Hey!

Just stumbled upon this impressive project! I've been looking around for a way of sniffing BLE packets to reverse engineer the communications of some electronics. Being very new at this "hardware stuff" I'm just struggling a bit to understand if this project could achieve this? Basically I want to sniff traffic and get it into Wireshark somehow. I've got no problem with the code itself, just new to this particular area. So trying to figure out the right end to start in 😅

Thanks!

Oh, and sorry for making an issue here. Didn't manage to explain myself within a tweet :P

What WROVER_KIT_LCD lib

What WROVER_KIT_LCD lib you used?
error: 'class WROVER_KIT_LCD' has no member named 'setupScrollArea'
error: no matching function for call to 'WROVER_KIT_LCD::getTextBounds(String&, int&, int&, int16_t*, int16_t*, uint16_t*, uint16_t*)'

also
src\UI.h:177:85: error: invalid conversion from 'const char*' to 'char*' [-fpermissive]

Known issues: BLEScan.cpp or sqlite3.c errors

thanks to @chegewara, the latest changes on this app use a modified version of the ESP32_BLE library where many memory leaks are fixed,

This version hasn't been released yet and might change in the future, until then use this version:

ESP32_ble_library.zip

The sqlite3.c library now has a permanent fix for the assert() error, just make sure you update to the latest version from the repository.

image

'rnd' was not declared in this scope

log_i("Testing random mac #%06X: %s / %s", random(0, OUIDBSize), OuiPsramCache[rnd]->mac, OuiPsramCache[rnd]->assignment );

In file included from /Users/mishamarinenko/Library/Arduino15/packages/esp32/hardware/esp32/1.0.4/cores/esp32/esp32-hal.h:50:0,
                 from /Users/mishamarinenko/Library/Arduino15/packages/esp32/hardware/esp32/1.0.4/cores/esp32/Arduino.h:35,
                 from sketch/ESP32-BLECollector.ino.cpp:1:
sketch/DB.h: In member function 'void DBUtils::loadVendorsToPSRam()':
DB.h:639:99: error: 'rnd' was not declared in this scope
         log_i("Testing random vendor mac #%d: %d / %s", random(0, VendorDBSize), VendorPsramCache[rnd]->devid[0], VendorPsramCache[rnd]->vendor );
                                                                                                   ^
/Users/mishamarinenko/Library/Arduino15/packages/esp32/hardware/esp32/1.0.4/cores/esp32/esp32-hal-log.h:97:72: note: in definition of macro 'log_i'
 #define log_i(format, ...) log_printf(ARDUHAL_LOG_FORMAT(I, format), ##__VA_ARGS__)
                                                                        ^
sketch/DB.h: In member function 'void DBUtils::loadOUIToPSRam()':
DB.h:660:88: error: 'rnd' was not declared in this scope
         log_i("Testing random mac #%06X: %s / %s", random(0, OUIDBSize), OuiPsramCache[rnd]->mac, OuiPsramCache[rnd]->assignment );
                                                                                        ^
/Users/mishamarinenko/Library/Arduino15/packages/esp32/hardware/esp32/1.0.4/cores/esp32/esp32-hal-log.h:97:72: note: in definition of macro 'log_i'
 #define log_i(format, ...) log_printf(ARDUHAL_LOG_FORMAT(I, format), ##__VA_ARGS__)
                                                                        ^
sketch/BLE.h: In static member function 'static void BLEScanUtils::dumpStats(const char*)':
BLE.h:1100:9: error: 'SelfCacheHit' was not declared in this scope
         SelfCacheHit,
         ^
/Users/mishamarinenko/Library/Arduino15/packages/esp32/hardware/esp32/1.0.4/cores/esp32/esp32-hal-log.h:97:72: note: in definition of macro 'log_i'
 #define log_i(format, ...) log_printf(ARDUHAL_LOG_FORMAT(I, format), ##__VA_ARGS__)
                                                                        ^
Несколько библиотек найдено для "BLEDevice.h"
 Используется: /Users/mishamarinenko/Documents/Arduino/libraries/BLE
Не используется: /Users/mishamarinenko/Library/Arduino15/packages/esp32/hardware/esp32/1.0.4/libraries/BLE
Несколько библиотек найдено для "SD.h"
 Используется: /Users/mishamarinenko/Library/Arduino15/packages/esp32/hardware/esp32/1.0.4/libraries/SD
Не используется: /Applications/Arduino.app/Contents/Java/libraries/SD
exit status 1
'rnd' was not declared in this scope

no matching function for call to 'M5Stack::begin(bool, bool, bool, bool, bool)'

File Display.h

void tft_begin() {
  M5.begin( true, true, false, false, false );
In file included from sketch/Settings.h:152:0,
                 from /Users/mishamarinenko/Downloads/ESP32-BLECollector-master/ESP32-BLECollector/ESP32-BLECollector.ino:50:
sketch/Display.h: In function 'void tft_begin()':
Display.h:118:45: error: no matching function for call to 'M5Stack::begin(bool, bool, bool, bool, bool)'
   M5.begin( true, true, false, false, false ); // don't start Serial
                                             ^
In file included from sketch/Display.h:5:0,
                 from sketch/Settings.h:152,
                 from /Users/mishamarinenko/Downloads/ESP32-BLECollector-master/ESP32-BLECollector/ESP32-BLECollector.ino:50:
/Users/mishamarinenko/Documents/Arduino/libraries/M5Stack-master/src/M5Stack.h:125:14: note: candidate: void M5Stack::begin(bool, bool, bool, bool)
         void begin(bool LCDEnable = true, bool SDEnable = true, bool SerialEnable = true, bool I2CEnable = false);
              ^
/Users/mishamarinenko/Documents/Arduino/libraries/M5Stack-master/src/M5Stack.h:125:14: note:   candidate expects 4 arguments, 5 provided
In file included from sketch/Settings.h:152:0,
                 from /Users/mishamarinenko/Downloads/ESP32-BLECollector-master/ESP32-BLECollector/ESP32-BLECollector.ino:50:
sketch/Display.h: At global scope:
Display.h:190:86: error: 'RGBColor' has not been declared
 void tft_fillGradientHRect( uint16_t x, uint16_t y, uint16_t width, uint16_t height, RGBColor colorstart, RGBColor colorend ) {
                                                                                      ^
Display.h:190:107: error: 'RGBColor' has not been declared
 void tft_fillGradientHRect( uint16_t x, uint16_t y, uint16_t width, uint16_t height, RGBColor colorstart, RGBColor colorend ) {
                                                                                                           ^
sketch/Display.h: In function 'void tft_fillGradientHRect(uint16_t, uint16_t, uint16_t, uint16_t, int, int)':
Display.h:195:18: error: 'class TFT_eSprite' has no member named 'drawGradientHLine'
   gradientSprite.drawGradientHLine( 0, 0, width, colorstart, colorend );
                  ^
sketch/Display.h: At global scope:
Display.h:202:86: error: 'RGBColor' has not been declared
 void tft_fillGradientVRect( uint16_t x, uint16_t y, uint16_t width, uint16_t height, RGBColor colorstart, RGBColor colorend ) {
                                                                                      ^
Display.h:202:107: error: 'RGBColor' has not been declared
 void tft_fillGradientVRect( uint16_t x, uint16_t y, uint16_t width, uint16_t height, RGBColor colorstart, RGBColor colorend ) {
                                                                                                           ^
sketch/Display.h: In function 'void tft_fillGradientVRect(uint16_t, uint16_t, uint16_t, uint16_t, int, int)':
Display.h:207:18: error: 'class TFT_eSprite' has no member named 'drawGradientVLine'
   gradientSprite.drawGradientVLine( 0, 0, height, colorstart, colorend );
                  ^
sketch/Display.h: At global scope:
Display.h:214:65: error: 'RGBColor' has not been declared
 void tft_drawGradientHLine( uint32_t x, uint32_t y, uint32_t w, RGBColor colorstart, RGBColor colorend ) {
                                                                 ^
Display.h:214:86: error: 'RGBColor' has not been declared
 void tft_drawGradientHLine( uint32_t x, uint32_t y, uint32_t w, RGBColor colorstart, RGBColor colorend ) {
                                                                                      ^
Display.h:218:65: error: 'RGBColor' has not been declared
 void tft_drawGradientVLine( uint32_t x, uint32_t y, uint32_t h, RGBColor colorstart, RGBColor colorend ) {
                                                                 ^
Display.h:218:86: error: 'RGBColor' has not been declared
 void tft_drawGradientVLine( uint32_t x, uint32_t y, uint32_t h, RGBColor colorstart, RGBColor colorend ) {
                                                                                      ^
In file included from sketch/Settings.h:222:0,
                 from /Users/mishamarinenko/Downloads/ESP32-BLECollector-master/ESP32-BLECollector/ESP32-BLECollector.ino:50:
ScrollPanel.h:53:5: error: 'RGBColor' does not name a type
     RGBColor BGColorStart;
     ^
ScrollPanel.h:54:5: error: 'RGBColor' does not name a type
     RGBColor BGColorEnd;
     ^
ScrollPanel.h:72:54: error: 'RGBColor' has not been declared
     void setupScrollArea(uint16_t TFA, uint16_t BFA, RGBColor colorstart, RGBColor colorend, bool clear = false) {
                                                      ^
ScrollPanel.h:72:75: error: 'RGBColor' has not been declared
     void setupScrollArea(uint16_t TFA, uint16_t BFA, RGBColor colorstart, RGBColor colorend, bool clear = false) {
                                                                           ^
sketch/ScrollPanel.h: In member function 'void ScrollableOutput::setupScrollArea(uint16_t, uint16_t, int, int, bool)':
ScrollPanel.h:73:7: error: 'BGColorStart' was not declared in this scope
       BGColorStart = colorstart;
       ^
ScrollPanel.h:74:7: error: 'BGColorEnd' was not declared in this scope
       BGColorEnd = colorend;
       ^
In file included from sketch/Settings.h:222:0,
                 from /Users/mishamarinenko/Downloads/ESP32-BLECollector-master/ESP32-BLECollector/ESP32-BLECollector.ino:50:
sketch/ScrollPanel.h: In member function 'int ScrollableOutput::scroll(const char*)':
ScrollPanel.h:161:61: error: 'BGColorStart' was not declared in this scope
       tft_fillGradientHRect( 0, scrollPosY, width/2, h_tmp, BGColorStart, BGColorEnd );
                                                             ^
ScrollPanel.h:161:75: error: 'BGColorEnd' was not declared in this scope
       tft_fillGradientHRect( 0, scrollPosY, width/2, h_tmp, BGColorStart, BGColorEnd );
                                                                           ^
In file included from sketch/Settings.h:152:0,
                 from /Users/mishamarinenko/Downloads/ESP32-BLECollector-master/ESP32-BLECollector/ESP32-BLECollector.ino:50:
sketch/SDUtils.h: In function 'bool SDSetup()':
Display.h:17:16: error: 'M5STACK_SD' was not declared in this scope
 #define BLE_FS M5STACK_SD // inherited from ESP32-Chimera-Core
                ^
sketch/Display.h:26:18: note: in expansion of macro 'BLE_FS'
 #define SD_begin BLE_FS.begin
                  ^
sketch/SDUtils.h:9:10: note: in expansion of macro 'SD_begin'
     if ( SD_begin() ) {
          ^
In file included from sketch/Settings.h:224:0,
                 from /Users/mishamarinenko/Downloads/ESP32-BLECollector-master/ESP32-BLECollector/ESP32-BLECollector.ino:50:
sketch/UI.h: In member function 'void UIUtils::init()':
UI.h:205:7: error: 'RGBColor' was not declared in this scope
       RGBColor colorstart = { 0x44, 0x44, 0x88 };
       ^
UI.h:206:16: error: expected ';' before 'colorend'
       RGBColor colorend   = { 0x22, 0x22, 0x44 };
                ^
UI.h:210:76: error: 'colorstart' was not declared in this scope
         tft_fillGradientHRect( 0, headerHeight, Out.width/2, scrollHeight, colorstart, colorend );
                                                                            ^
UI.h:210:88: error: 'colorend' was not declared in this scope
         tft_fillGradientHRect( 0, headerHeight, Out.width/2, scrollHeight, colorstart, colorend );
                                                                                        ^
UI.h:232:56: error: 'colorstart' was not declared in this scope
       Out.setupScrollArea( headerHeight, footerHeight, colorstart, colorend );
                                                        ^
UI.h:232:68: error: 'colorend' was not declared in this scope
       Out.setupScrollArea( headerHeight, footerHeight, colorstart, colorend );
                                                                    ^
In file included from sketch/Settings.h:224:0,
                 from /Users/mishamarinenko/Downloads/ESP32-BLECollector-master/ESP32-BLECollector/ESP32-BLECollector.ino:50:
sketch/UI.h: In static member function 'static void UIUtils::screenShot()':
UI.h:305:10: error: 'class M5Stack' has no member named 'ScreenShot'
       M5.ScreenShot.snap("BLECollector", true);
          ^
In file included from sketch/Settings.h:152:0,
                 from /Users/mishamarinenko/Downloads/ESP32-BLECollector-master/ESP32-BLECollector/ESP32-BLECollector.ino:50:
sketch/UI.h: In static member function 'static void UIUtils::screenShow(void*)':
Display.h:17:16: error: 'M5STACK_SD' was not declared in this scope
 #define BLE_FS M5STACK_SD // inherited from ESP32-Chimera-Core
                ^
sketch/UI.h:316:14: note: in expansion of macro 'BLE_FS'
         if( !BLE_FS.exists( (const char*)fileName ) ) {
              ^
Display.h:17:16: error: 'M5STACK_SD' was not declared in this scope
 #define BLE_FS M5STACK_SD // inherited from ESP32-Chimera-Core
                ^
sketch/UI.h:323:26: note: in expansion of macro 'BLE_FS'
         tft.drawJpgFile( BLE_FS, (const char*)fileName, 0, 0, Out.width, Out.height, 0, 0, JPEG_DIV_NONE );
                          ^
Display.h:17:16: error: 'M5STACK_SD' was not declared in this scope
 #define BLE_FS M5STACK_SD // inherited from ESP32-Chimera-Core
                ^
sketch/UI.h:329:31: note: in expansion of macro 'BLE_FS'
         File screenshotFile = BLE_FS.open( (const char*)fileName );
                               ^
sketch/DB.h: In member function 'bool DBUtils::init()':
Display.h:17:16: error: 'M5STACK_SD' was not declared in this scope
 #define BLE_FS M5STACK_SD // inherited from ESP32-Chimera-Core
                ^
sketch/DB.h:264:12: note: in expansion of macro 'BLE_FS'
       if( !BLE_FS.exists( BLEMacsDbFSPath ) ) {
            ^
sketch/DB.h: In static member function 'static bool DBUtils::checkFile(const char*, size_t)':
Display.h:17:16: error: 'M5STACK_SD' was not declared in this scope
 #define BLE_FS M5STACK_SD // inherited from ESP32-Chimera-Core
                ^
sketch/DB.h:325:13: note: in expansion of macro 'BLE_FS'
       if( ! BLE_FS.exists( fileName ) ) {
             ^
sketch/DB.h: In member function 'bool DBUtils::maintain()':
Display.h:17:16: error: 'M5STACK_SD' was not declared in this scope
 #define BLE_FS M5STACK_SD // inherited from ESP32-Chimera-Core
                ^
sketch/DB.h:476:14: note: in expansion of macro 'BLE_FS'
         if( !BLE_FS.exists( BLEMacsDbFSPath ) ) {
              ^
In file included from /Users/mishamarinenko/Library/Arduino15/packages/esp32/hardware/esp32/1.0.4/cores/esp32/esp32-hal.h:50:0,
                 from /Users/mishamarinenko/Library/Arduino15/packages/esp32/hardware/esp32/1.0.4/cores/esp32/Arduino.h:35,
                 from sketch/ESP32-BLECollector.ino.cpp:1:
sketch/DB.h: In member function 'void DBUtils::loadVendorsToPSRam()':
DB.h:639:99: error: 'rnd' was not declared in this scope
         log_i("Testing random vendor mac #%d: %d / %s", random(0, VendorDBSize), VendorPsramCache[rnd]->devid[0], VendorPsramCache[rnd]->vendor );
                                                                                                   ^
/Users/mishamarinenko/Library/Arduino15/packages/esp32/hardware/esp32/1.0.4/cores/esp32/esp32-hal-log.h:97:72: note: in definition of macro 'log_i'
 #define log_i(format, ...) log_printf(ARDUHAL_LOG_FORMAT(I, format), ##__VA_ARGS__)
                                                                        ^
sketch/DB.h: In member function 'void DBUtils::loadOUIToPSRam()':
DB.h:660:88: error: 'rnd' was not declared in this scope
         log_i("Testing random mac #%06X: %s / %s", random(0, OUIDBSize), OuiPsramCache[rnd]->mac, OuiPsramCache[rnd]->assignment );
                                                                                        ^
/Users/mishamarinenko/Library/Arduino15/packages/esp32/hardware/esp32/1.0.4/cores/esp32/esp32-hal-log.h:97:72: note: in definition of macro 'log_i'
 #define log_i(format, ...) log_printf(ARDUHAL_LOG_FORMAT(I, format), ##__VA_ARGS__)
                                                                        ^
In file included from sketch/Settings.h:152:0,
                 from /Users/mishamarinenko/Downloads/ESP32-BLECollector-master/ESP32-BLECollector/ESP32-BLECollector.ino:50:
sketch/DB.h: In member function 'void DBUtils::resetDB()':
Display.h:17:16: error: 'M5STACK_SD' was not declared in this scope
 #define BLE_FS M5STACK_SD // inherited from ESP32-Chimera-Core
                ^
sketch/DB.h:808:7: note: in expansion of macro 'BLE_FS'
       BLE_FS.remove( BLEMacsDbFSPath );
       ^
sketch/BLEFileSharing.h: In function 'void FileSharingReceiveFile(const char*)':
Display.h:17:16: error: 'M5STACK_SD' was not declared in this scope
 #define BLE_FS M5STACK_SD // inherited from ESP32-Chimera-Core
                ^
sketch/BLEFileSharing.h:402:18: note: in expansion of macro 'BLE_FS'
   FileReceiver = BLE_FS.open( filename, FILE_WRITE );
                  ^
sketch/BLEFileSharing.h: In member function 'virtual void FileSharingRouteCallbacks::onWrite(BLECharacteristic*)':
Display.h:17:16: error: 'M5STACK_SD' was not declared in this scope
 #define BLE_FS M5STACK_SD // inherited from ESP32-Chimera-Core
                ^
sketch/BLEFileSharing.h:509:21: note: in expansion of macro 'BLE_FS'
         File root = BLE_FS.open("/");
                     ^
sketch/BLEFileSharing.h: In function 'void FileSharingSendFile(BLERemoteCharacteristic*, const char*)':
Display.h:17:16: error: 'M5STACK_SD' was not declared in this scope
 #define BLE_FS M5STACK_SD // inherited from ESP32-Chimera-Core
                ^
sketch/BLEFileSharing.h:698:25: note: in expansion of macro 'BLE_FS'
   File fileToTransfer = BLE_FS.open( filename );
                         ^
sketch/BLE.h: In static member function 'static void BLEScanUtils::rmFileTask(void*)':
Display.h:17:16: error: 'M5STACK_SD' was not declared in this scope
 #define BLE_FS M5STACK_SD // inherited from ESP32-Chimera-Core
                ^
sketch/BLE.h:519:14: note: in expansion of macro 'BLE_FS'
         if ( BLE_FS.remove( (const char*)param ) ) {
              ^
In file included from sketch/Settings.h:227:0,
                 from /Users/mishamarinenko/Downloads/ESP32-BLECollector-master/ESP32-BLECollector/ESP32-BLECollector.ino:50:
sketch/BLE.h: In static member function 'static void BLEScanUtils::screenShotTask(void*)':
BLE.h:546:12: error: 'class M5Stack' has no member named 'ScreenShot'
         M5.ScreenShot.init( &tft, BLE_FS );
            ^
In file included from sketch/Settings.h:152:0,
                 from /Users/mishamarinenko/Downloads/ESP32-BLECollector-master/ESP32-BLECollector/ESP32-BLECollector.ino:50:
Display.h:17:16: error: 'M5STACK_SD' was not declared in this scope
 #define BLE_FS M5STACK_SD // inherited from ESP32-Chimera-Core
                ^
sketch/BLE.h:546:35: note: in expansion of macro 'BLE_FS'
         M5.ScreenShot.init( &tft, BLE_FS );
                                   ^
In file included from sketch/Settings.h:227:0,
                 from /Users/mishamarinenko/Downloads/ESP32-BLECollector-master/ESP32-BLECollector/ESP32-BLECollector.ino:50:
BLE.h:547:12: error: 'class M5Stack' has no member named 'ScreenShot'
         M5.ScreenShot.begin();
            ^
In file included from sketch/Settings.h:152:0,
                 from /Users/mishamarinenko/Downloads/ESP32-BLECollector-master/ESP32-BLECollector/ESP32-BLECollector.ino:50:
sketch/BLE.h: In static member function 'static void BLEScanUtils::listDirTask(void*)':
Display.h:17:16: error: 'M5STACK_SD' was not declared in this scope
 #define BLE_FS M5STACK_SD // inherited from ESP32-Chimera-Core
                ^
sketch/BLE.h:563:14: note: in expansion of macro 'BLE_FS'
         if(! BLE_FS.exists( (const char*)param ) ) {
              ^
Display.h:17:16: error: 'M5STACK_SD' was not declared in this scope
 #define BLE_FS M5STACK_SD // inherited from ESP32-Chimera-Core
                ^
sketch/BLE.h:569:17: note: in expansion of macro 'BLE_FS'
         listDir(BLE_FS, "/", 0, DB.BLEMacsDbFSPath);
                 ^
In file included from /Users/mishamarinenko/Library/Arduino15/packages/esp32/hardware/esp32/1.0.4/cores/esp32/esp32-hal.h:50:0,
                 from /Users/mishamarinenko/Library/Arduino15/packages/esp32/hardware/esp32/1.0.4/cores/esp32/Arduino.h:35,
                 from sketch/ESP32-BLECollector.ino.cpp:1:
sketch/BLE.h: In static member function 'static void BLEScanUtils::dumpStats(const char*)':
BLE.h:1100:9: error: 'SelfCacheHit' was not declared in this scope
         SelfCacheHit,
         ^
/Users/mishamarinenko/Library/Arduino15/packages/esp32/hardware/esp32/1.0.4/cores/esp32/esp32-hal-log.h:97:72: note: in definition of macro 'log_i'
 #define log_i(format, ...) log_printf(ARDUHAL_LOG_FORMAT(I, format), ##__VA_ARGS__)
                                                                        ^
Несколько библиотек найдено для "WiFiClient.h"
 Используется: /Users/mishamarinenko/Library/Arduino15/packages/esp32/hardware/esp32/1.0.4/libraries/WiFi
Не используется: /Applications/Arduino.app/Contents/Java/libraries/WiFi
Несколько библиотек найдено для "SD.h"
 Используется: /Users/mishamarinenko/Library/Arduino15/packages/esp32/hardware/esp32/1.0.4/libraries/SD
Не используется: /Applications/Arduino.app/Contents/Java/libraries/SD
Несколько библиотек найдено для "M5Stack.h"
 Используется: /Users/mishamarinenko/Documents/Arduino/libraries/M5Stack-master
Не используется: /Users/mishamarinenko/Documents/Arduino/libraries/ESP32-Chimera-Core-master
Несколько библиотек найдено для "BLEDevice.h"
 Используется: /Users/mishamarinenko/Documents/Arduino/libraries/BLE
Не используется: /Users/mishamarinenko/Library/Arduino15/packages/esp32/hardware/esp32/1.0.4/libraries/BLE
exit status 1
no matching function for call to 'M5Stack::begin(bool, bool, bool, bool, bool)'

'RGBColor' has not been declared

void setupScrollArea(uint16_t TFA, uint16_t BFA, RGBColor colorstart, RGBColor colorend, bool clear = false) {

line 73 in ScrollPanel.h | ScrollPanel.h:73

M5Stack Core, Arduino IDE 1.8.11, Latest Libraries

M5Stack-fire Compile Error

ESP32-Chimera-Core : 1.4.6
ESP32 Development Board : 2.0.3
device: M5Stack-fire

error log: `Arduino:1.8.19 (Windows 10), Development Board:"M5Stack-FIRE, Enabled, Default (2 x 6.5 MB app, 3.6 MB SPIFFS), 921600, Warn"

In file included from C:\Users\Administrator\Documents\Arduino\libraries\ESP32-Chimera-Core\src/ESP32-Chimera-Core-Config.h:1,

                 from C:\Users\Administrator\Desktop\ESP32-BLECollector-master\ESP32-BLECollector\Display.h:1,

                 from C:\Users\Administrator\Desktop\ESP32-BLECollector-master\ESP32-BLECollector\Settings.h:199,

                 from C:\Users\Administrator\Desktop\ESP32-BLECollector-master\ESP32-BLECollector\ESP32-BLECollector.ino:50:

C:\Users\Administrator\Documents\Arduino\libraries\ESP32-Chimera-Core\src/Config.h:55:21: note: #pragma message: ESP32 Arduino 2.0.3 (0x142fceb8) detected

     #pragma message "ESP32 Arduino 2.0.3 (0x142fceb8) detected"

                     ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

In file included from C:\Users\Administrator\Desktop\ESP32-BLECollector-master\ESP32-BLECollector\Settings.h:265,

                 from C:\Users\Administrator\Desktop\ESP32-BLECollector-master\ESP32-BLECollector\ESP32-BLECollector.ino:50:

C:\Users\Administrator\Desktop\ESP32-BLECollector-master\ESP32-BLECollector\UI.h: In static member function 'static void UIUtils::screenShot()':

UI.h:430:21: error: request for member 'snap' in 'M5.ChimeraCore::ECCKernel::ScreenShot', which is of pointer type 'ScreenShotService*' (maybe you meant to use '->' ?)

       M5.ScreenShot.snap("BLECollector", false); // filename prefix, show image after capture

                     ^~~~

In file included from C:\Users\Administrator\Desktop\ESP32-BLECollector-master\ESP32-BLECollector\Settings.h:268,

                 from C:\Users\Administrator\Desktop\ESP32-BLECollector-master\ESP32-BLECollector\ESP32-BLECollector.ino:50:

C:\Users\Administrator\Desktop\ESP32-BLECollector-master\ESP32-BLECollector\BLE.h: In static member function 'static void BLEScanUtils::screenShotTask(void*)':

BLE.h:904:23: error: request for member 'init' in 'M5.ChimeraCore::ECCKernel::ScreenShot', which is of pointer type 'ScreenShotService*' (maybe you meant to use '->' ?)

         M5.ScreenShot.init( &M5.Lcd, BLE_FS );

                       ^~~~

BLE.h:905:27: error: request for member 'begin' in 'M5.ChimeraCore::ECCKernel::ScreenShot', which is of pointer type 'ScreenShotService*' (maybe you meant to use '->' ?)

         if( M5.ScreenShot.begin() ) {

                           ^~~~~

C:\Users\Administrator\Desktop\ESP32-BLECollector-master\ESP32-BLECollector\BLE.h: In static member function 'static void BLEScanUtils::scanInit()':

BLE.h:1200:17: error: 'class NimBLEScan' has no member named 'setAdvertisedDeviceCallbacks'

       pBLEScan->setAdvertisedDeviceCallbacks( FoundDeviceCallback );

                 ^~~~~~~~~~~~~~~~~~~~~~~~~~~~

exit status 1

request for member 'snap' in 'M5.ChimeraCore::ECCKernel::ScreenShot', which is of pointer type 'ScreenShotService*' (maybe you meant to use '->' ?)

WROVER SD Card

Did you use the SD Card on the WROVER Kit? If so, how did you get both the LCD and SD Card to work properly? I desoldered R167 and I'm able to get the LCD to display with a card inserted; however, the SD fails to initialize if I initialize the LCD first (and vice versa).

My code is straightforward:

SPI.begin(14, 2, 15, 13);
  if (!SD.begin(13)) {
   ESP_LOGE(LOG_TAG, "<< Failed. LocalStorage is not available.");
}

I saw in your code you were using MMC. Maybe that's what I need to do? Thanks!

Compilation error due to Time Library

Dear,

I have this error during the compilation process:
src/ESP32-BLECollector.ino:50: src/DateTime.h: In function 'void dumpTime(const char*, tm*)': src/DateTime.h:173:9: error: invalid use of incomplete type 'struct tm' info->tm_year + 1900,

I install all libraries:

Random crashes under heavy load

I can't get the multi core version to work properly, it seems to fail on a xSemaphoreTake(), most often with a stack trace like this one :

image

Since it's my first project using tasks there's a strong possibility I'm not doing things right, help !

Task resources:

  • SPI Ram
  • SD Card (accessed by sqlite3 for oui/vendor lookup and saving scan data)
  • TFT (displaying BLE Cards, statistics and heap graph history)
  • RTC via I2C

Task scenario:

  1. BLE.h starts scanTask, a duty cycle that runs differents functions:
    • BLE scan
    • Store scan results (using the callbakc of the BLE Scan)
    • populate (oui lookup and vendor lookup in a sqlite3 DB located on the SD card)
    • render BLE Card on the TFT
    • propagate (increment counter hits or save entry on SD/sqlite 3)

  1. UI.h starts a task that will register a mux and create two tasks:
    • heapGraph, a duty cycle of rendering the heap history via the TFT
    • clockSync, a duty cycle of refreshing a string with time extracted from the RTC I2C module

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.