G6EJD / DFRobot-Firebeetle-LED-Matrix

3 stars 0 forks source link

Problems with FireBeetle ESP32 #1

Closed ClemensGruber closed 2 years ago

ClemensGruber commented 2 years ago

Many thanks David for your afford to fix the old DFRobot lib see https://github.com/Chocho2017/FireBeetleLEDMatrix/issues/4 I tried as well the original code (see https://github.com/Chocho2017/FireBeetleLEDMatrix/issues/5) as also your code but got this output:

sketch_oct10b:11:26: error: 'NumPixels' was not declared in this scope
 Adafruit_NeoPixel pixels(NumPixels, PixelPin, NEO_GRB + NEO_KHZ800);
                          ^~~~~~~~~
C:\Users\mail\AppData\Local\Temp\arduino_modified_sketch_486225\sketch_oct10b.ino:11:26: note: suggested alternative: 'pixels'
 Adafruit_NeoPixel pixels(NumPixels, PixelPin, NEO_GRB + NEO_KHZ800);
                          ^~~~~~~~~
                          pixels
sketch_oct10b:11:37: error: 'PixelPin' was not declared in this scope
 Adafruit_NeoPixel pixels(NumPixels, PixelPin, NEO_GRB + NEO_KHZ800);
                                     ^~~~~~~~
C:\Users\mail\AppData\Local\Temp\arduino_modified_sketch_486225\sketch_oct10b.ino:11:37: note: suggested alternative: 'pixels'
 Adafruit_NeoPixel pixels(NumPixels, PixelPin, NEO_GRB + NEO_KHZ800);
                                     ^~~~~~~~
                                     pixels
exit status 1
'NumPixels' was not declared in this scope

Is NumPixels and PixelPin a variable I have to replace or is it definde by the other lib?

Should it work with an ESP32 like the FireBeetle ESP32 or only an ESP8266?

G6EJD commented 2 years ago

The example that’s going wrong here is for a Neopixel display not the DFRobot display this is why you’re getting an error and the library you’re using is the Adafruit variant. Neopixels are individual displays not a matrix.

G6EJD commented 2 years ago

Just delete line 11

G6EJD commented 2 years ago

To stop any confusion I’ve deleted the lines.

ClemensGruber commented 2 years ago

Line 16 pixels.begin(); // INITIALIZE NeoPixel object (REQUIRED) seems to be still a relict and needs to be delated also, but now I get with your code also this error message as reported under https://github.com/Chocho2017/FireBeetleLEDMatrix/issues/5

C:\Users\mail\Documents\Arduino\libraries\DFRobot_HT1632C\DFRobot_HT1632C.cpp: In member function 'void DFRobot_HT1632C::drawImage(const byte*, uint8_t, uint8_t, int8_t, int8_t, int)':
C:\Users\mail\Documents\Arduino\libraries\DFRobot_HT1632C\DFRobot_HT1632C.cpp:464:57: error: no matching function for call to 'min(uint8_t&, int)'
    copyInNextStep = min(copyInNextStep, (height - src_y));
                                                         ^
In file included from c:\users\mail\appdata\local\arduino15\packages\dfrobot\tools\xtensa-esp32-elf-gcc\gcc8_4_0-esp-2020r3\xtensa-esp32-elf\include\c++\8.4.0\algorithm:62,
                 from C:\Users\mail\AppData\Local\Arduino15\packages\DFRobot\hardware\esp32\0.2.1\cores\esp32/Arduino.h:145,
                 from C:\Users\mail\Documents\Arduino\libraries\DFRobot_HT1632C\DFRobot_HT1632C.h:17,
                 from C:\Users\mail\Documents\Arduino\libraries\DFRobot_HT1632C\DFRobot_HT1632C.cpp:13:
c:\users\mail\appdata\local\arduino15\packages\dfrobot\tools\xtensa-esp32-elf-gcc\gcc8_4_0-esp-2020r3\xtensa-esp32-elf\include\c++\8.4.0\bits\stl_algo.h:3456:5: note: candidate: 'template<class _Tp, class _Compare> _Tp std::min(std::initializer_list<_Tp>, _Compare)'
     min(initializer_list<_Tp> __l, _Compare __comp)
     ^~~
c:\users\mail\appdata\local\arduino15\packages\dfrobot\tools\xtensa-esp32-elf-gcc\gcc8_4_0-esp-2020r3\xtensa-esp32-elf\include\c++\8.4.0\bits\stl_algo.h:3456:5: note:   template argument deduction/substitution failed:
C:\Users\mail\Documents\Arduino\libraries\DFRobot_HT1632C\DFRobot_HT1632C.cpp:464:57: note:   mismatched types 'std::initializer_list<_Tp>' and 'unsigned char'
    copyInNextStep = min(copyInNextStep, (height - src_y));
                                                         ^
In file included from c:\users\mail\appdata\local\arduino15\packages\dfrobot\tools\xtensa-esp32-elf-gcc\gcc8_4_0-esp-2020r3\xtensa-esp32-elf\include\c++\8.4.0\algorithm:62,
                 from C:\Users\mail\AppData\Local\Arduino15\packages\DFRobot\hardware\esp32\0.2.1\cores\esp32/Arduino.h:145,
                 from C:\Users\mail\Documents\Arduino\libraries\DFRobot_HT1632C\DFRobot_HT1632C.h:17,
                 from C:\Users\mail\Documents\Arduino\libraries\DFRobot_HT1632C\DFRobot_HT1632C.cpp:13:
c:\users\mail\appdata\local\arduino15\packages\dfrobot\tools\xtensa-esp32-elf-gcc\gcc8_4_0-esp-2020r3\xtensa-esp32-elf\include\c++\8.4.0\bits\stl_algo.h:3450:5: note: candidate: 'template<class _Tp> _Tp std::min(std::initializer_list<_Tp>)'
     min(initializer_list<_Tp> __l)
     ^~~
c:\users\mail\appdata\local\arduino15\packages\dfrobot\tools\xtensa-esp32-elf-gcc\gcc8_4_0-esp-2020r3\xtensa-esp32-elf\include\c++\8.4.0\bits\stl_algo.h:3450:5: note:   template argument deduction/substitution failed:
C:\Users\mail\Documents\Arduino\libraries\DFRobot_HT1632C\DFRobot_HT1632C.cpp:464:57: note:   mismatched types 'std::initializer_list<_Tp>' and 'unsigned char'
    copyInNextStep = min(copyInNextStep, (height - src_y));
                                                         ^
In file included from c:\users\mail\appdata\local\arduino15\packages\dfrobot\tools\xtensa-esp32-elf-gcc\gcc8_4_0-esp-2020r3\xtensa-esp32-elf\include\c++\8.4.0\algorithm:61,
                 from C:\Users\mail\AppData\Local\Arduino15\packages\DFRobot\hardware\esp32\0.2.1\cores\esp32/Arduino.h:145,
                 from C:\Users\mail\Documents\Arduino\libraries\DFRobot_HT1632C\DFRobot_HT1632C.h:17,
                 from C:\Users\mail\Documents\Arduino\libraries\DFRobot_HT1632C\DFRobot_HT1632C.cpp:13:
c:\users\mail\appdata\local\arduino15\packages\dfrobot\tools\xtensa-esp32-elf-gcc\gcc8_4_0-esp-2020r3\xtensa-esp32-elf\include\c++\8.4.0\bits\stl_algobase.h:243:5: note: candidate: 'template<class _Tp, class _Compare> const _Tp& std::min(const _Tp&, const _Tp&, _Compare)'
     min(const _Tp& __a, const _Tp& __b, _Compare __comp)
     ^~~
c:\users\mail\appdata\local\arduino15\packages\dfrobot\tools\xtensa-esp32-elf-gcc\gcc8_4_0-esp-2020r3\xtensa-esp32-elf\include\c++\8.4.0\bits\stl_algobase.h:243:5: note:   template argument deduction/substitution failed:
C:\Users\mail\Documents\Arduino\libraries\DFRobot_HT1632C\DFRobot_HT1632C.cpp:464:57: note:   deduced conflicting types for parameter 'const _Tp' ('unsigned char' and 'int')
    copyInNextStep = min(copyInNextStep, (height - src_y));
                                                         ^
In file included from c:\users\mail\appdata\local\arduino15\packages\dfrobot\tools\xtensa-esp32-elf-gcc\gcc8_4_0-esp-2020r3\xtensa-esp32-elf\include\c++\8.4.0\algorithm:61,
                 from C:\Users\mail\AppData\Local\Arduino15\packages\DFRobot\hardware\esp32\0.2.1\cores\esp32/Arduino.h:145,
                 from C:\Users\mail\Documents\Arduino\libraries\DFRobot_HT1632C\DFRobot_HT1632C.h:17,
                 from C:\Users\mail\Documents\Arduino\libraries\DFRobot_HT1632C\DFRobot_HT1632C.cpp:13:
c:\users\mail\appdata\local\arduino15\packages\dfrobot\tools\xtensa-esp32-elf-gcc\gcc8_4_0-esp-2020r3\xtensa-esp32-elf\include\c++\8.4.0\bits\stl_algobase.h:195:5: note: candidate: 'template<class _Tp> const _Tp& std::min(const _Tp&, const _Tp&)'
     min(const _Tp& __a, const _Tp& __b)
     ^~~
c:\users\mail\appdata\local\arduino15\packages\dfrobot\tools\xtensa-esp32-elf-gcc\gcc8_4_0-esp-2020r3\xtensa-esp32-elf\include\c++\8.4.0\bits\stl_algobase.h:195:5: note:   template argument deduction/substitution failed:
C:\Users\mail\Documents\Arduino\libraries\DFRobot_HT1632C\DFRobot_HT1632C.cpp:464:57: note:   deduced conflicting types for parameter 'const _Tp' ('unsigned char' and 'int')
    copyInNextStep = min(copyInNextStep, (height - src_y));
                                                         ^
C:\Users\mail\Documents\Arduino\libraries\DFRobot_HT1632C\DFRobot_HT1632C.cpp: In member function 'void DFRobot_HT1632C::drawImageStr(const byte*, uint8_t, uint8_t, int8_t, int8_t, int)':
C:\Users\mail\Documents\Arduino\libraries\DFRobot_HT1632C\DFRobot_HT1632C.cpp:506:57: error: no matching function for call to 'min(uint8_t&, int)'
    copyInNextStep = min(copyInNextStep, (height - src_y));
                                                         ^
In file included from c:\users\mail\appdata\local\arduino15\packages\dfrobot\tools\xtensa-esp32-elf-gcc\gcc8_4_0-esp-2020r3\xtensa-esp32-elf\include\c++\8.4.0\algorithm:62,
                 from C:\Users\mail\AppData\Local\Arduino15\packages\DFRobot\hardware\esp32\0.2.1\cores\esp32/Arduino.h:145,
                 from C:\Users\mail\Documents\Arduino\libraries\DFRobot_HT1632C\DFRobot_HT1632C.h:17,
                 from C:\Users\mail\Documents\Arduino\libraries\DFRobot_HT1632C\DFRobot_HT1632C.cpp:13:
c:\users\mail\appdata\local\arduino15\packages\dfrobot\tools\xtensa-esp32-elf-gcc\gcc8_4_0-esp-2020r3\xtensa-esp32-elf\include\c++\8.4.0\bits\stl_algo.h:3456:5: note: candidate: 'template<class _Tp, class _Compare> _Tp std::min(std::initializer_list<_Tp>, _Compare)'
     min(initializer_list<_Tp> __l, _Compare __comp)
     ^~~
c:\users\mail\appdata\local\arduino15\packages\dfrobot\tools\xtensa-esp32-elf-gcc\gcc8_4_0-esp-2020r3\xtensa-esp32-elf\include\c++\8.4.0\bits\stl_algo.h:3456:5: note:   template argument deduction/substitution failed:
C:\Users\mail\Documents\Arduino\libraries\DFRobot_HT1632C\DFRobot_HT1632C.cpp:506:57: note:   mismatched types 'std::initializer_list<_Tp>' and 'unsigned char'
    copyInNextStep = min(copyInNextStep, (height - src_y));
                                                         ^
In file included from c:\users\mail\appdata\local\arduino15\packages\dfrobot\tools\xtensa-esp32-elf-gcc\gcc8_4_0-esp-2020r3\xtensa-esp32-elf\include\c++\8.4.0\algorithm:62,
                 from C:\Users\mail\AppData\Local\Arduino15\packages\DFRobot\hardware\esp32\0.2.1\cores\esp32/Arduino.h:145,
                 from C:\Users\mail\Documents\Arduino\libraries\DFRobot_HT1632C\DFRobot_HT1632C.h:17,
                 from C:\Users\mail\Documents\Arduino\libraries\DFRobot_HT1632C\DFRobot_HT1632C.cpp:13:
c:\users\mail\appdata\local\arduino15\packages\dfrobot\tools\xtensa-esp32-elf-gcc\gcc8_4_0-esp-2020r3\xtensa-esp32-elf\include\c++\8.4.0\bits\stl_algo.h:3450:5: note: candidate: 'template<class _Tp> _Tp std::min(std::initializer_list<_Tp>)'
     min(initializer_list<_Tp> __l)
     ^~~
c:\users\mail\appdata\local\arduino15\packages\dfrobot\tools\xtensa-esp32-elf-gcc\gcc8_4_0-esp-2020r3\xtensa-esp32-elf\include\c++\8.4.0\bits\stl_algo.h:3450:5: note:   template argument deduction/substitution failed:
C:\Users\mail\Documents\Arduino\libraries\DFRobot_HT1632C\DFRobot_HT1632C.cpp:506:57: note:   mismatched types 'std::initializer_list<_Tp>' and 'unsigned char'
    copyInNextStep = min(copyInNextStep, (height - src_y));
                                                         ^
In file included from c:\users\mail\appdata\local\arduino15\packages\dfrobot\tools\xtensa-esp32-elf-gcc\gcc8_4_0-esp-2020r3\xtensa-esp32-elf\include\c++\8.4.0\algorithm:61,
                 from C:\Users\mail\AppData\Local\Arduino15\packages\DFRobot\hardware\esp32\0.2.1\cores\esp32/Arduino.h:145,
                 from C:\Users\mail\Documents\Arduino\libraries\DFRobot_HT1632C\DFRobot_HT1632C.h:17,
                 from C:\Users\mail\Documents\Arduino\libraries\DFRobot_HT1632C\DFRobot_HT1632C.cpp:13:
c:\users\mail\appdata\local\arduino15\packages\dfrobot\tools\xtensa-esp32-elf-gcc\gcc8_4_0-esp-2020r3\xtensa-esp32-elf\include\c++\8.4.0\bits\stl_algobase.h:243:5: note: candidate: 'template<class _Tp, class _Compare> const _Tp& std::min(const _Tp&, const _Tp&, _Compare)'
     min(const _Tp& __a, const _Tp& __b, _Compare __comp)
     ^~~
c:\users\mail\appdata\local\arduino15\packages\dfrobot\tools\xtensa-esp32-elf-gcc\gcc8_4_0-esp-2020r3\xtensa-esp32-elf\include\c++\8.4.0\bits\stl_algobase.h:243:5: note:   template argument deduction/substitution failed:
C:\Users\mail\Documents\Arduino\libraries\DFRobot_HT1632C\DFRobot_HT1632C.cpp:506:57: note:   deduced conflicting types for parameter 'const _Tp' ('unsigned char' and 'int')
    copyInNextStep = min(copyInNextStep, (height - src_y));
                                                         ^
In file included from c:\users\mail\appdata\local\arduino15\packages\dfrobot\tools\xtensa-esp32-elf-gcc\gcc8_4_0-esp-2020r3\xtensa-esp32-elf\include\c++\8.4.0\algorithm:61,
                 from C:\Users\mail\AppData\Local\Arduino15\packages\DFRobot\hardware\esp32\0.2.1\cores\esp32/Arduino.h:145,
                 from C:\Users\mail\Documents\Arduino\libraries\DFRobot_HT1632C\DFRobot_HT1632C.h:17,
                 from C:\Users\mail\Documents\Arduino\libraries\DFRobot_HT1632C\DFRobot_HT1632C.cpp:13:
c:\users\mail\appdata\local\arduino15\packages\dfrobot\tools\xtensa-esp32-elf-gcc\gcc8_4_0-esp-2020r3\xtensa-esp32-elf\include\c++\8.4.0\bits\stl_algobase.h:195:5: note: candidate: 'template<class _Tp> const _Tp& std::min(const _Tp&, const _Tp&)'
     min(const _Tp& __a, const _Tp& __b)
     ^~~
c:\users\mail\appdata\local\arduino15\packages\dfrobot\tools\xtensa-esp32-elf-gcc\gcc8_4_0-esp-2020r3\xtensa-esp32-elf\include\c++\8.4.0\bits\stl_algobase.h:195:5: note:   template argument deduction/substitution failed:
C:\Users\mail\Documents\Arduino\libraries\DFRobot_HT1632C\DFRobot_HT1632C.cpp:506:57: note:   deduced conflicting types for parameter 'const _Tp' ('unsigned char' and 'int')
    copyInNextStep = min(copyInNextStep, (height - src_y));
                                                         ^
exit status 1
Fehler beim Kompilieren für das Board FireBeetle ESP32.

Switching to "ESP32 Dev Module" instead of "FireBeetle ESP32" leads to the same error message.

G6EJD commented 2 years ago

Ok I removed that line remnant. Now it looks like the latest compiler has omitted the basic function min();

try adding at the top of your code:

include

ClemensGruber commented 2 years ago

Unfortunately no success even with #include <Arduino.h> In addition I uninstalled the DFRobot boards and used the ESP32 Dev Module as board, and also no difference whith Arduino ESP32 core 1.x vs. 2.x, I thought this could be the problem.

G6EJD commented 2 years ago

I’ll fix it but a compiler issue

ClemensGruber commented 2 years ago

In the meantime I found this bug report, https://forum.arduino.cc/t/dfrobot-ht1632-library-help/1005499/ -- no solution there, but I am not alone :-)

G6EJD commented 2 years ago

I can’t do it now about 2-hours from now but just google the Arduino min function and add it to your code

G6EJD commented 2 years ago

I've added the function to the code see the top level or here: #undef min inline int min(int a, int b) { return ((a)<(b) ? (a) : (b)); }

What's strange is my system compiles normally with no need for the new definition.

You probably have something wrong with your compiler setup.

Thank you for the money.

ClemensGruber commented 2 years ago

Arduino.h is included via

https://github.com/Chocho2017/FireBeetleLEDMatrix/blob/21ef4f5089e61898b430b751858da0589d9e5b1d/DFRobot_HT1632C/DFRobot_HT1632C.h#L16-L17

#if(ARDUINO >= 100)
 #include <Arduino.h>

So no need to add it.

unfortunately the fix above is not working and leads to the same error. In the meantime I have uninstalled my working Arduino IDE 1.8.15 and updated to the latest 1.8.19. but no change. I had used the IDE for many ESP32 projects, so I think there is no general problem with it.

G6EJD commented 2 years ago

Can you copy the compilation errors here please, this is very odd behaviour by your compiler. Mine shows no error for the same code.

ClemensGruber commented 2 years ago

For the code under https://github.com/G6EJD/DFRobot-Firebeetle-LED-Matrix/blob/main/ESP32-DFROBOT-Firebeetle-Hello.ino I get:

C:\Users\mail\Documents\Arduino\libraries\DFRobot_HT1632C\DFRobot_HT1632C.cpp: In member function 'void DFRobot_HT1632C::drawImage(const byte*, uint8_t, uint8_t, int8_t, int8_t, int)':
C:\Users\mail\Documents\Arduino\libraries\DFRobot_HT1632C\DFRobot_HT1632C.cpp:464:57: error: no matching function for call to 'min(uint8_t&, int)'
    copyInNextStep = min(copyInNextStep, (height - src_y));
                                                         ^
In file included from c:\users\mail\appdata\local\arduino15\packages\dfrobot\tools\xtensa-esp32-elf-gcc\gcc8_4_0-esp-2020r3\xtensa-esp32-elf\include\c++\8.4.0\algorithm:62,
                 from C:\Users\mail\AppData\Local\Arduino15\packages\DFRobot\hardware\esp32\0.2.1\cores\esp32/Arduino.h:145,
                 from C:\Users\mail\Documents\Arduino\libraries\DFRobot_HT1632C\DFRobot_HT1632C.h:17,
                 from C:\Users\mail\Documents\Arduino\libraries\DFRobot_HT1632C\DFRobot_HT1632C.cpp:13:
c:\users\mail\appdata\local\arduino15\packages\dfrobot\tools\xtensa-esp32-elf-gcc\gcc8_4_0-esp-2020r3\xtensa-esp32-elf\include\c++\8.4.0\bits\stl_algo.h:3456:5: note: candidate: 'template<class _Tp, class _Compare> _Tp std::min(std::initializer_list<_Tp>, _Compare)'
     min(initializer_list<_Tp> __l, _Compare __comp)
     ^~~
c:\users\mail\appdata\local\arduino15\packages\dfrobot\tools\xtensa-esp32-elf-gcc\gcc8_4_0-esp-2020r3\xtensa-esp32-elf\include\c++\8.4.0\bits\stl_algo.h:3456:5: note:   template argument deduction/substitution failed:
C:\Users\mail\Documents\Arduino\libraries\DFRobot_HT1632C\DFRobot_HT1632C.cpp:464:57: note:   mismatched types 'std::initializer_list<_Tp>' and 'unsigned char'
    copyInNextStep = min(copyInNextStep, (height - src_y));
                                                         ^
In file included from c:\users\mail\appdata\local\arduino15\packages\dfrobot\tools\xtensa-esp32-elf-gcc\gcc8_4_0-esp-2020r3\xtensa-esp32-elf\include\c++\8.4.0\algorithm:62,
                 from C:\Users\mail\AppData\Local\Arduino15\packages\DFRobot\hardware\esp32\0.2.1\cores\esp32/Arduino.h:145,
                 from C:\Users\mail\Documents\Arduino\libraries\DFRobot_HT1632C\DFRobot_HT1632C.h:17,
                 from C:\Users\mail\Documents\Arduino\libraries\DFRobot_HT1632C\DFRobot_HT1632C.cpp:13:
c:\users\mail\appdata\local\arduino15\packages\dfrobot\tools\xtensa-esp32-elf-gcc\gcc8_4_0-esp-2020r3\xtensa-esp32-elf\include\c++\8.4.0\bits\stl_algo.h:3450:5: note: candidate: 'template<class _Tp> _Tp std::min(std::initializer_list<_Tp>)'
     min(initializer_list<_Tp> __l)
     ^~~
c:\users\mail\appdata\local\arduino15\packages\dfrobot\tools\xtensa-esp32-elf-gcc\gcc8_4_0-esp-2020r3\xtensa-esp32-elf\include\c++\8.4.0\bits\stl_algo.h:3450:5: note:   template argument deduction/substitution failed:
C:\Users\mail\Documents\Arduino\libraries\DFRobot_HT1632C\DFRobot_HT1632C.cpp:464:57: note:   mismatched types 'std::initializer_list<_Tp>' and 'unsigned char'
    copyInNextStep = min(copyInNextStep, (height - src_y));
                                                         ^
In file included from c:\users\mail\appdata\local\arduino15\packages\dfrobot\tools\xtensa-esp32-elf-gcc\gcc8_4_0-esp-2020r3\xtensa-esp32-elf\include\c++\8.4.0\algorithm:61,
                 from C:\Users\mail\AppData\Local\Arduino15\packages\DFRobot\hardware\esp32\0.2.1\cores\esp32/Arduino.h:145,
                 from C:\Users\mail\Documents\Arduino\libraries\DFRobot_HT1632C\DFRobot_HT1632C.h:17,
                 from C:\Users\mail\Documents\Arduino\libraries\DFRobot_HT1632C\DFRobot_HT1632C.cpp:13:
c:\users\mail\appdata\local\arduino15\packages\dfrobot\tools\xtensa-esp32-elf-gcc\gcc8_4_0-esp-2020r3\xtensa-esp32-elf\include\c++\8.4.0\bits\stl_algobase.h:243:5: note: candidate: 'template<class _Tp, class _Compare> const _Tp& std::min(const _Tp&, const _Tp&, _Compare)'
     min(const _Tp& __a, const _Tp& __b, _Compare __comp)
     ^~~
c:\users\mail\appdata\local\arduino15\packages\dfrobot\tools\xtensa-esp32-elf-gcc\gcc8_4_0-esp-2020r3\xtensa-esp32-elf\include\c++\8.4.0\bits\stl_algobase.h:243:5: note:   template argument deduction/substitution failed:
C:\Users\mail\Documents\Arduino\libraries\DFRobot_HT1632C\DFRobot_HT1632C.cpp:464:57: note:   deduced conflicting types for parameter 'const _Tp' ('unsigned char' and 'int')
    copyInNextStep = min(copyInNextStep, (height - src_y));
                                                         ^
In file included from c:\users\mail\appdata\local\arduino15\packages\dfrobot\tools\xtensa-esp32-elf-gcc\gcc8_4_0-esp-2020r3\xtensa-esp32-elf\include\c++\8.4.0\algorithm:61,
                 from C:\Users\mail\AppData\Local\Arduino15\packages\DFRobot\hardware\esp32\0.2.1\cores\esp32/Arduino.h:145,
                 from C:\Users\mail\Documents\Arduino\libraries\DFRobot_HT1632C\DFRobot_HT1632C.h:17,
                 from C:\Users\mail\Documents\Arduino\libraries\DFRobot_HT1632C\DFRobot_HT1632C.cpp:13:
c:\users\mail\appdata\local\arduino15\packages\dfrobot\tools\xtensa-esp32-elf-gcc\gcc8_4_0-esp-2020r3\xtensa-esp32-elf\include\c++\8.4.0\bits\stl_algobase.h:195:5: note: candidate: 'template<class _Tp> const _Tp& std::min(const _Tp&, const _Tp&)'
     min(const _Tp& __a, const _Tp& __b)
     ^~~
c:\users\mail\appdata\local\arduino15\packages\dfrobot\tools\xtensa-esp32-elf-gcc\gcc8_4_0-esp-2020r3\xtensa-esp32-elf\include\c++\8.4.0\bits\stl_algobase.h:195:5: note:   template argument deduction/substitution failed:
C:\Users\mail\Documents\Arduino\libraries\DFRobot_HT1632C\DFRobot_HT1632C.cpp:464:57: note:   deduced conflicting types for parameter 'const _Tp' ('unsigned char' and 'int')
    copyInNextStep = min(copyInNextStep, (height - src_y));
                                                         ^
C:\Users\mail\Documents\Arduino\libraries\DFRobot_HT1632C\DFRobot_HT1632C.cpp: In member function 'void DFRobot_HT1632C::drawImageStr(const byte*, uint8_t, uint8_t, int8_t, int8_t, int)':
C:\Users\mail\Documents\Arduino\libraries\DFRobot_HT1632C\DFRobot_HT1632C.cpp:506:57: error: no matching function for call to 'min(uint8_t&, int)'
    copyInNextStep = min(copyInNextStep, (height - src_y));
                                                         ^
In file included from c:\users\mail\appdata\local\arduino15\packages\dfrobot\tools\xtensa-esp32-elf-gcc\gcc8_4_0-esp-2020r3\xtensa-esp32-elf\include\c++\8.4.0\algorithm:62,
                 from C:\Users\mail\AppData\Local\Arduino15\packages\DFRobot\hardware\esp32\0.2.1\cores\esp32/Arduino.h:145,
                 from C:\Users\mail\Documents\Arduino\libraries\DFRobot_HT1632C\DFRobot_HT1632C.h:17,
                 from C:\Users\mail\Documents\Arduino\libraries\DFRobot_HT1632C\DFRobot_HT1632C.cpp:13:
c:\users\mail\appdata\local\arduino15\packages\dfrobot\tools\xtensa-esp32-elf-gcc\gcc8_4_0-esp-2020r3\xtensa-esp32-elf\include\c++\8.4.0\bits\stl_algo.h:3456:5: note: candidate: 'template<class _Tp, class _Compare> _Tp std::min(std::initializer_list<_Tp>, _Compare)'
     min(initializer_list<_Tp> __l, _Compare __comp)
     ^~~
c:\users\mail\appdata\local\arduino15\packages\dfrobot\tools\xtensa-esp32-elf-gcc\gcc8_4_0-esp-2020r3\xtensa-esp32-elf\include\c++\8.4.0\bits\stl_algo.h:3456:5: note:   template argument deduction/substitution failed:
C:\Users\mail\Documents\Arduino\libraries\DFRobot_HT1632C\DFRobot_HT1632C.cpp:506:57: note:   mismatched types 'std::initializer_list<_Tp>' and 'unsigned char'
    copyInNextStep = min(copyInNextStep, (height - src_y));
                                                         ^
In file included from c:\users\mail\appdata\local\arduino15\packages\dfrobot\tools\xtensa-esp32-elf-gcc\gcc8_4_0-esp-2020r3\xtensa-esp32-elf\include\c++\8.4.0\algorithm:62,
                 from C:\Users\mail\AppData\Local\Arduino15\packages\DFRobot\hardware\esp32\0.2.1\cores\esp32/Arduino.h:145,
                 from C:\Users\mail\Documents\Arduino\libraries\DFRobot_HT1632C\DFRobot_HT1632C.h:17,
                 from C:\Users\mail\Documents\Arduino\libraries\DFRobot_HT1632C\DFRobot_HT1632C.cpp:13:
c:\users\mail\appdata\local\arduino15\packages\dfrobot\tools\xtensa-esp32-elf-gcc\gcc8_4_0-esp-2020r3\xtensa-esp32-elf\include\c++\8.4.0\bits\stl_algo.h:3450:5: note: candidate: 'template<class _Tp> _Tp std::min(std::initializer_list<_Tp>)'
     min(initializer_list<_Tp> __l)
     ^~~
c:\users\mail\appdata\local\arduino15\packages\dfrobot\tools\xtensa-esp32-elf-gcc\gcc8_4_0-esp-2020r3\xtensa-esp32-elf\include\c++\8.4.0\bits\stl_algo.h:3450:5: note:   template argument deduction/substitution failed:
C:\Users\mail\Documents\Arduino\libraries\DFRobot_HT1632C\DFRobot_HT1632C.cpp:506:57: note:   mismatched types 'std::initializer_list<_Tp>' and 'unsigned char'
    copyInNextStep = min(copyInNextStep, (height - src_y));
                                                         ^
In file included from c:\users\mail\appdata\local\arduino15\packages\dfrobot\tools\xtensa-esp32-elf-gcc\gcc8_4_0-esp-2020r3\xtensa-esp32-elf\include\c++\8.4.0\algorithm:61,
                 from C:\Users\mail\AppData\Local\Arduino15\packages\DFRobot\hardware\esp32\0.2.1\cores\esp32/Arduino.h:145,
                 from C:\Users\mail\Documents\Arduino\libraries\DFRobot_HT1632C\DFRobot_HT1632C.h:17,
                 from C:\Users\mail\Documents\Arduino\libraries\DFRobot_HT1632C\DFRobot_HT1632C.cpp:13:
c:\users\mail\appdata\local\arduino15\packages\dfrobot\tools\xtensa-esp32-elf-gcc\gcc8_4_0-esp-2020r3\xtensa-esp32-elf\include\c++\8.4.0\bits\stl_algobase.h:243:5: note: candidate: 'template<class _Tp, class _Compare> const _Tp& std::min(const _Tp&, const _Tp&, _Compare)'
     min(const _Tp& __a, const _Tp& __b, _Compare __comp)
     ^~~
c:\users\mail\appdata\local\arduino15\packages\dfrobot\tools\xtensa-esp32-elf-gcc\gcc8_4_0-esp-2020r3\xtensa-esp32-elf\include\c++\8.4.0\bits\stl_algobase.h:243:5: note:   template argument deduction/substitution failed:
C:\Users\mail\Documents\Arduino\libraries\DFRobot_HT1632C\DFRobot_HT1632C.cpp:506:57: note:   deduced conflicting types for parameter 'const _Tp' ('unsigned char' and 'int')
    copyInNextStep = min(copyInNextStep, (height - src_y));
                                                         ^
In file included from c:\users\mail\appdata\local\arduino15\packages\dfrobot\tools\xtensa-esp32-elf-gcc\gcc8_4_0-esp-2020r3\xtensa-esp32-elf\include\c++\8.4.0\algorithm:61,
                 from C:\Users\mail\AppData\Local\Arduino15\packages\DFRobot\hardware\esp32\0.2.1\cores\esp32/Arduino.h:145,
                 from C:\Users\mail\Documents\Arduino\libraries\DFRobot_HT1632C\DFRobot_HT1632C.h:17,
                 from C:\Users\mail\Documents\Arduino\libraries\DFRobot_HT1632C\DFRobot_HT1632C.cpp:13:
c:\users\mail\appdata\local\arduino15\packages\dfrobot\tools\xtensa-esp32-elf-gcc\gcc8_4_0-esp-2020r3\xtensa-esp32-elf\include\c++\8.4.0\bits\stl_algobase.h:195:5: note: candidate: 'template<class _Tp> const _Tp& std::min(const _Tp&, const _Tp&)'
     min(const _Tp& __a, const _Tp& __b)
     ^~~
c:\users\mail\appdata\local\arduino15\packages\dfrobot\tools\xtensa-esp32-elf-gcc\gcc8_4_0-esp-2020r3\xtensa-esp32-elf\include\c++\8.4.0\bits\stl_algobase.h:195:5: note:   template argument deduction/substitution failed:
C:\Users\mail\Documents\Arduino\libraries\DFRobot_HT1632C\DFRobot_HT1632C.cpp:506:57: note:   deduced conflicting types for parameter 'const _Tp' ('unsigned char' and 'int')
    copyInNextStep = min(copyInNextStep, (height - src_y));
                                                         ^
exit status 1
Fehler beim Kompilieren für das Board FireBeetle ESP32.
G6EJD commented 2 years ago

There is something very odd with your installation, it says it’s located at: C:\Users\mail\Documents\Arduino\libraries\DFRobot_HT1632C\DFRobot_HT1632C.cpp:506:57: note:

Which is inside your mail and documents folder and in other places appdata local,

this is why it’s not compiling correctly your installation is totally wrong, I’ll see if I can find a installation help sheet for you

ClemensGruber commented 2 years ago

I found some default pathes under https://support.arduino.cc/hc/en-us/articles/4415103213714-Find-sketches-libraries-board-cores-and-other-files-on-your-computer

Libs are installed in Windows under: C:\Users\{username}\Documents\Arduino, the local user on my machine is mail so C:\Users\mail\Documents\Arduino\libraries\ seems correct. The only thing or difference is that in the doc is written "installed with the Library Manager"

Libraries installed with the Library Manager are stored inside a Sketchbook subfolder:

But I installed it -- as usual for in the Arduino lib-manager not existing libs --via copying the extracted zip file from https://github.com/Chocho2017/FireBeetleLEDMatrix/archive/refs/heads/master.zip to this dir.

Along the doc are libraries included in board packages under C:\Users\{username}\AppData\Local\Arduino15 so there should be nothing wrong withc:\users\mail\appdata\local\

[edit] For testing I moved the DFRobot_HT1632C lib from C:\Users\mail\Documents\Arduino\libraries\ to C:\Users\mail\AppData\Local\Arduino15\packages\DFRobot\hardware\esp32\0.2.1\libraries but same issue and error messages.

G6EJD commented 2 years ago

These problems are all a function of the installation and the Arduino IDE not being able to find all the files it needs. You really need to go to the Arduino web site, download the Arduino 2.0 IDE ZIP file, not the installer variant, then go to your Documents folder (not at the c: level) which is located in your profile, so don’t steer the installation to some odd place, then create a folder called ArduinoIDE, then unzip the 2.0 folder to this new one. When finished the Arduino.exe will start the compiler. Select the Firebeetle board and the new version should find all the libraries needed, then it will compile correctly

ClemensGruber commented 2 years ago

I downloaded the latest 2.0 Arduino IDE as ZIP and unpacked it on a data partition on my computer. btw. after starting the IDE the used library directory is still

C:\Users\{username}\AppData\Local\Arduino15

as documented on the Arduino support page: https://support.arduino.cc/hc/en-us/articles/4415103213714-Find-sketches-libraries-board-cores-and-other-files-on-your-computer

So the error is still the same!!

Now I installed Arduino on a Raspberry4 in addition the needed boards (ESP32 and Firebeetle) and the DFRobot_HT1632C lib. Same issue: After running the code I got the same compiler error as under Windows!

Just to clarify: My installation is not totally wrong, it is a standard installation under Windows and the pathes are the standard pathes for an Arduino IDE under Windows, so nothing special! The same compiling error under Linux - totally other machine, other OS, fresh installation leads to my conclusion that something is odd with the code. :-) So do I need an addition library - any math related stuff or modification? Or ist my setup, newest IDE, newest Arduino ESP32 core, not compatible with the 5 year old code?

You have mentioned Adafruit_NeoPixel, should I try this, is the hardware compatible with this lib or any other lib?

Unfortunatelly I bought some other "covers" from DFRobot for the Firebeetle, OLED display, e-paper-display, and the Audio-"Covers", the Audio does also not compile without errors. So it is a pity that DFRobot does not maintain the code, just put it out one time and no further support. So many thanks for you support here.

G6EJD commented 2 years ago

OK, let's recap: I take the code and compile it using ESP32 core 2.0.5 or 1.0.6 and the code compiles without an error, but yours does not. Looking at your error codes you get an esp32 extension error, my compiler is passing the error:

mismatched types 'std::initializer_list<_Tp>' and 'unsigned char' copyInNextStep = min(copyInNextStep, (height - src_y));

by correctly allowing e.g., copyInNextStep as the type 'uint8_t' instead of byte or int, as your compiler says 'mismatched types'

So, I've created a new .cpp file uploaded here, try replacing your version with this revised one.

G6EJD commented 2 years ago

Or try adding this on the first line of your code:

int min(int a, int b) { return ((a)<(b) ? (a) : (b)); }

Or: byte min(byte a, byte b) { return ((a)<(b) ? (a) : (b)); }

G6EJD commented 2 years ago

I’ve just loaded a new IDE onto my laptop (zip version) and taken the source code here, it compiles without any issues. So I’m not sure what’s causing your issues unless it’s a language problem. The library folder was empty until I added the display driver.

ClemensGruber commented 2 years ago

That's all a bit scary, and I fear my virtual invitation to a cup of tea or coffee is eaten up a long time ago and we have to think about a lunch invitation so much time as you have spent. Many thanks for that! In case the problem is not interesting for you or eats too much time don't hasitate to make other things, don't wont to block anyone.

Indeed your new code did not solve the problem. I think we should investigate the / my installation. I run many projects with my Arduino installation so it is working but something is a problem with the FireBeetle stuff I fear.

Now I have deleted my complete Arduino IDE and I have installed version 2.0.

What board definition are you using for the FireBeetle? I can install the ESP32 / espressif board packages only, e.g. via https://raw.githubusercontent.com/espressif/arduino-esp32/gh-pages/package_esp32_index.json and there is the FireBeetle included already. But I can also install the DFRobot FireBeetle boards (via http://download.dfrobot.top/FireBeetle/package_esp32_index.json) and use the FireBeetle from there.

On some sketches I get different debug outputs, so it could be a reason for my problem.

And you can use the stable ESP32 core or the dev, what is working on your side?

stable: https://raw.githubusercontent.com/espressif/arduino-esp32/gh-pages/package_esp32_index.json
dev:    https://raw.githubusercontent.com/espressif/arduino-esp32/gh-pages/package_esp32_dev_index.json
G6EJD commented 2 years ago

https://raw.githubusercontent.com/espressif/arduino-esp32/gh-pages/package_esp32_index.json

It is definitely your compiler setup causing these problems, something you are doing to set it up. The new Arduino 2 IDE comes with the ESP32 setup as part of the package. Perhaps try that.

I'm keen for you to get the code working.

ClemensGruber commented 2 years ago

Just to be sure, you are using the FireBeetle ESP32? Not the ESP8266?? The sketch compiles for the FireBeetle ESP8266 also on my machine but not for the ESP32.

G6EJD commented 2 years ago

I only use the ESP32 I have not tried compiling for the ESP8266. The missing min function is a basic Arduino function suggesting the ESP32 integration with the IDE is faulty. You can tell it’s an installation error as it fails at the ESP32 level, with no errors at the code level. The missing min() function error has been around for many years. Also when the min() is defined in the source code it should not fail because the compiler knows what the min() function is. And that’s where I think for some reason during installation the Arduino IDE is picking up some registry errors leading to compiler errors.

ClemensGruber commented 2 years ago

I installed -- after problems on my machine -- the Arduino IDE on a Raspberry Pi with the same result / error message, as described above. Your successfull compiling on your side leads me to an error search on my IDE setting but I still got stuck. My final try was the occupation of my wife's computer. It has never seen an Arduino IDE before and no registry, no left over configuration files could mess up the installation. And ... it was the same mess and problem, the same error message. So it is an problem based on whatever changed in de IDE in the last years.

The fix is relatively easy. You have to make slight changes in the library. In DFRobot_HT1632C.cpp you have to replace min with _min and max with _max, see https://github.com/ClemensGruber/FireBeetleLEDMatrix/commit/d74dadb6a25bf44e2a759619ba4d218d30487eec after that change the code is compiling and running on the FireBeetle! Heureka!

G6EJD commented 2 years ago

Very strange, I have never seen that before but I’m pleased you have it running now, good luck with your project.