Closed steampunklolcat closed 12 months ago
This is not a known issue.
Did the code compile without modifying any miniThrottle.h settings?
If you changed any of the settings can you let me know what they were so I can try to reproduce the issue?
Alternatively given the location of the code in
I just tried on another machine as a test.
https://raw.githubusercontent.com/espressif/arduino-esp32/gh-pages/package_esp32_index.json
Added the needed libraries: keypad, esp32encoder and lcdgfx. Keypad - 3.1.1 Esp32Encoder - 0.10.1 lcdgfx - 1.1.4
Selected the Lolin D32 board.
I can compile the lcdgfx/demos/ssd1306_demo sketch without errors.
Version 0.4 downloaded from https://conferre.cf/miniThrottle/miniThrottle.zip and minithrottle.h copied from the example file produces the output below.
`In file included from c:\Users\morten\Documents\Arduino\libraries\lcdgfx\src/lcdgfx.h:30, from C:\Users\morten\Documents\Arduino\ESP32_miniThrottle\miniThrottle.h:8, from C:\Users\morten\Documents\Arduino\ESP32_miniThrottle\ESP32_miniThrottle.ino:5: c:\users\morten\appdata\local\arduino15\packages\esp32\tools\xtensa-esp32-elf-gcc\gcc8_4_0-esp-2021r2-patch3\xtensa-esp32-elf\include\c++\8.4.0\bits\stl_vector.h: In member function 'std::vector<_Tp, _Alloc>::size_type std::vector<_Tp, _Alloc>::_M_check_len(std::vector<_Tp, _Alloc>::size_type, const char*) const': c:\Users\morten\Documents\Arduino\libraries\lcdgfx\src/nano_gfx_types.h:41:19: error: expected unqualified-id before '(' token
^
c:\users\morten\appdata\local\arduino15\packages\esp32\tools\xtensa-esp32-elf-gcc\gcc8_4_0-esp-2021r2-patch3\xtensa-esp32-elf\include\c++\8.4.0\bits\stl_bvector.h: In member function 'std::vector<bool, _Alloc>::size_type std::vector<bool, _Alloc>::_M_check_len(std::vector<bool, _Alloc>::size_type, const char*) const': c:\Users\morten\Documents\Arduino\libraries\lcdgfx\src/nano_gfx_types.h:41:19: error: expected unqualified-id before '(' token
^
exit status 1
Compilation error: exit status 1`
The compiler I have hasn't been updated in some time.
I've tested compilation on Windows with: Arduino 1.8.19 (Windows Store 1.8.57.0) And on Raspberry-Pi Linux with the CLI version of Arduino
These three compile OK on my system. I may need a few days to download / test using a newer Windows or Linux graphical interface to see if I can replicate and resolve the issue.
The CLI environment shows the following library versions in use, again they are most likely not the latest. Used library Version Path lcdgfx 1.1.4 /home/enfield/Arduino/libraries/lcdgfx SPI 1.0 /home/enfield/.arduino15/packages/esp32/hardware/esp32/1.0.6/libraries/SPI Keypad 3.1.1 /home/enfield/Arduino/libraries/Keypad ESP32Encoder 0.9.1 /home/enfield/Arduino/libraries/ESP32Encoder Preferences 1.0 /home/enfield/.arduino15/packages/esp32/hardware/esp32/1.0.6/libraries/Preferences WiFi 1.0 /home/enfield/.arduino15/packages/esp32/hardware/esp32/1.0.6/libraries/WiFi ESPmDNS 1.0 /home/enfield/.arduino15/packages/esp32/hardware/esp32/1.0.6/libraries/ESPmDNS HTTPClient 1.2 /home/enfield/.arduino15/packages/esp32/hardware/esp32/1.0.6/libraries/HTTPClient WiFiClientSecure 1.0 /home/enfield/.arduino15/packages/esp32/hardware/esp32/1.0.6/libraries/WiFiClientSecure FS 1.0 /home/enfield/.arduino15/packages/esp32/hardware/esp32/1.0.6/libraries/FS SPIFFS 1.0 /home/enfield/.arduino15/packages/esp32/hardware/esp32/1.0.6/libraries/SPIFFS Wire 1.0.1 /home/enfield/.arduino15/packages/esp32/hardware/esp32/1.0.6/libraries/Wire
Used platform Version Path esp32:esp32 1.0.6 /home/enfield/.arduino15/packages/esp32/hardware/esp32/1.0.6
I got it to compile now using the same versions as you for the esp32encoder library and the esp32 platform. Afterwards I tested with upgrading the esp32 platform to version 2.0 and that broke it.
PS C:\Users\morten\Documents\Arduino> arduino-cli compile --fqbn esp32:esp32:lolin32:CPUFreq=80,PartitionScheme=min_spiffs ESP32_miniThrottle Sketch uses 1049606 bytes (53%) of program storage space. Maximum is 1966080 bytes. Global variables use 42904 bytes (13%) of dynamic memory, leaving 284776 bytes for local variables. Maximum is 327680 bytes.
Used library Version Path lcdgfx 1.1.4 C:\Users\morten\Documents\Arduino\libraries\lcdgfx SPI 1.0 C:\Users\morten\AppData\Local\Arduino15\packages\esp32\hardware\esp32\1.0.6\libraries\SPI Keypad 3.1.1 C:\Users\morten\Documents\Arduino\libraries\Keypad ESP32Encoder 0.9.1 C:\Users\morten\Documents\Arduino\libraries\ESP32Encoder Preferences 1.0 C:\Users\morten\AppData\Local\Arduino15\packages\esp32\hardware\esp32\1.0.6\libraries\Preferences WiFi 1.0 C:\Users\morten\AppData\Local\Arduino15\packages\esp32\hardware\esp32\1.0.6\libraries\WiFi ESPmDNS 1.0 C:\Users\morten\AppData\Local\Arduino15\packages\esp32\hardware\esp32\1.0.6\libraries\ESPmDNS HTTPClient 1.2 C:\Users\morten\AppData\Local\Arduino15\packages\esp32\hardware\esp32\1.0.6\libraries\HTTPClient WiFiClientSecure 1.0 C:\Users\morten\AppData\Local\Arduino15\packages\esp32\hardware\esp32\1.0.6\libraries\WiFiClientSecure FS 1.0 C:\Users\morten\AppData\Local\Arduino15\packages\esp32\hardware\esp32\1.0.6\libraries\FS SPIFFS 1.0 C:\Users\morten\AppData\Local\Arduino15\packages\esp32\hardware\esp32\1.0.6\libraries\SPIFFS Wire 1.0.1 C:\Users\morten\AppData\Local\Arduino15\packages\esp32\hardware\esp32\1.0.6\libraries\Wire
Used platform Version Path esp32:esp32 1.0.6 C:\Users\morten\AppData\Local\Arduino15\packages\esp32\hardware\esp32\1.0.6
That is interesting! After a fresh install of the environment (to exclude any previous tweaks I may have had in my system) and using platform 2.0.5 I could replicate the error. Confirming the issue is related to platform upgrade. Some further "Google-Research" later... and I the code compiled after commenting out the offending lines in
But, I've not flashed that to a test unit to check if it works. - just because it compiles doesn't mean it will work!
So what lead me to fiddle in lcdgfx's code? A quote old bugzilla posting: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=16605 (comment 5) which suggests:
Your code defines min/max as macros. The preprocessor expands this, which leaves what used to be std::max(x1, x2) as something that doesn't make much sense to the compiler any more.
Since the standard says that the names min/max are reserved, simply remove these #defines from your sources.
Probably the new platform better implements / enforces at standard that uses min and max as expansions that then renders the original code meaningless to the compiler. But I'd rather leave that determination / fix to the lcdgfx project. Until then I would recommend sticking to platform 1.0.6.
Created lcdgfx issue: https://github.com/lexus2k/lcdgfx/issues/94
The cause of this issue has been tracked to using http client with lcdgfx. In the development version there is now a "#define NOHTTPCLIENT 1" option that can be added to miniThrottle.h - this will disable the http client on the miniThrottle build: effectively you can't download config files or OTA updates to the device. It will still support the HTTP configuration server.
I keep getting the below error when trying to compile the project for a Lolin D32 esp32 board. It happens with both the 0.4 and the 0.5 versions of the throttle.
`In file included from /Users/morten/Documents/Arduino/libraries/lcdgfx/src/lcdgfx.h:30, from /Users/morten/Documents/Creative Projects/arduino/ESP32_miniThrottle/static_defs.h:9, from /Users/morten/Documents/Creative Projects/arduino/ESP32_miniThrottle/ESP32_miniThrottle.ino:6: /Users/morten/Library/Arduino15/packages/esp32/tools/xtensa-esp32-elf-gcc/gcc8_4_0-esp-2021r2-patch3/xtensa-esp32-elf/include/c++/8.4.0/bits/stl_vector.h: In member function 'std::vector<_Tp, _Alloc>::size_type std::vector<_Tp, _Alloc>::_M_check_len(std::vector<_Tp, _Alloc>::size_type, const char*) const': /Users/morten/Documents/Arduino/libraries/lcdgfx/src/nano_gfx_types.h:41:19: error: expected unqualified-id before '(' token
define max(a, b) ((a) > (b) ? (a) : (b))
/Users/morten/Library/Arduino15/packages/esp32/tools/xtensa-esp32-elf-gcc/gcc8_4_0-esp-2021r2-patch3/xtensa-esp32-elf/include/c++/8.4.0/bits/stl_bvector.h: In member function 'std::vector<bool, _Alloc>::size_type std::vector<bool, _Alloc>::_M_check_len(std::vector<bool, _Alloc>::size_type, const char*) const': /Users/morten/Documents/Arduino/libraries/lcdgfx/src/nano_gfx_types.h:41:19: error: expected unqualified-id before '(' token
define max(a, b) ((a) > (b) ? (a) : (b))
exit status 1
Compilation error: exit status 1`