G4lile0 / ESP32-WiFi-Hash-Monster

WiFi Hash Purple Monster, store EAPOL & PMKID packets in an SD CARD using a M5STACK / ESP32 device
MIT License
893 stars 101 forks source link

Error Class M5Display Has No Member... #20

Closed bonedaddy closed 3 years ago

bonedaddy commented 3 years ago

I'm attempting to use this project with an m5stack-core and am unable to build the code. I receive numerous errors about class M5Display not containing various members.

.pio/libdeps/m5stack-core-esp32/M5Stack-SD-Updater/src/M5StackUpdaterUI.h:110:36: error: 'class M5Display' has no member named 'textsize'
     SDUTextStyle.textsize    = tft.textsize;
                                    ^
.pio/libdeps/m5stack-core-esp32/M5Stack-SD-Updater/src/M5StackUpdaterUI.h:111:36: error: 'class M5Display' has no member named 'textdatum'
     SDUTextStyle.textdatum   = tft.textdatum;
                                    ^
.pio/libdeps/m5stack-core-esp32/M5Stack-SD-Updater/src/M5StackUpdaterUI.h:112:36: error: 'class M5Display' has no member named 'textcolor'
     SDUTextStyle.textcolor   = tft.textcolor;
                                    ^
.pio/libdeps/m5stack-core-esp32/M5Stack-SD-Updater/src/M5StackUpdaterUI.h:113:36: error: 'class M5Display' has no member named 'textbgcolor'
tobozo commented 3 years ago

hey @bonedaddy please make sure you're using the latest version of the following libraries (from the library manager):

bonedaddy commented 3 years ago

I double checked and I'm still getting the issue. I'm attempting to use PlatformIO through VSCODE so I wonder if that might be the issue?

tobozo commented 3 years ago

Platformio library page shows a version number that's not even listed in the official releases, my guess is they probably checked out from the master instead of picking up a release.

The current version should be tobozo/ESP32-Chimera-Core@1.1.3. You may try to update the version number in your platformio.ini or just set it manually using one of those:

There's a high probability other library versions are affected too, here's what I'm currently using:

LovyanGFX @ 0.2.7 ESP32-Chimera-Core @ 1.1.3 M5Stack-SD-Updater @ 1.0.2

bonedaddy commented 3 years ago

That solved the issue but now another one is happening

.pio/libdeps/m5stack-core-esp32/M5Stack-SD-Updater/src/M5StackUpdater.h:167:18: fatal error: SD.h: No such file or directory

I ran pio lib install https://github.com/tobozo/M5Stack-SD-Updater/archive/1.0.2.zip to make sure I was using the same version as you beforehand.

tobozo commented 3 years ago

can't remember why this happens but I know such platformio-specific issues are usually solved by including the "missing but installed" library from the top of the .ino file:

#include <SD.h>
bonedaddy commented 3 years ago

tried but no luck :( let me play around with this a bit to see if i can figure it out

tobozo commented 3 years ago

oh found the curlpit in the platformio.ini

;lib_ldf_mode = chain+
lib_ldf_mode = deep

[edit] here's my full platformio.ini, I had to edit other values too


; PlatformIO Project Configuration File
;
;   Build options: build flags, source filter
;   Upload options: custom upload port, speed and extra flags
;   Library options: dependencies, extra library storages
;   Advanced options: extra scripting
;
; Please visit documentation for the other options and examples
; http://docs.platformio.org/page/projectconf.html

[platformio]
src_dir = ESP32-WiFi-Hash-Monster

[env:m5stack-core-esp32]
platform = espressif32
board = m5stack-fire ;This can be one of m5stack-fire, odroid_esp32, m5stack-core-esp32 or m5stack-core2
framework = arduino
upload_speed = 921600

; lib_extra_dirs = ~/Documents/Arduino/libraries/
;lib_ldf_mode = chain+
lib_ldf_mode = deep
lib_deps =
  ESP32-Chimera-Core
  M5Stack-SD-Updater
  Wire
  SPI
  FS
  SPIFFS
  SD(esp32)
  HTTPClient
  WiFi
  WiFiClientSecure
  Update
  Preferences
  FastLED

; Warning upstream M5Stack-SD-Updater fails including SD.h when M5Stack.h is used
; Had to manually add #include <SD.h>. lib_ldf_mode = chain+ didn't help
bonedaddy commented 3 years ago

That did it, thanks.

tobozo commented 3 years ago

Followup on the root cause of this:

The library version mess is now fixed in platformio registry \o/

Due to a few errors in the library.properties files the last valid version was from June 2020, also for some reason I was locked out of my platformio profile and couldn't force any update, but the tech support solved that and the side effects are gone.

Platorfmio 5.x also solves many problems such as finding the proper SD.h library version or solving cross-dependencies more gracefully, so running "pio upgrade" and "pio update" is a good idea.