HuskyLens / HUSKYLENSArduino

74 stars 49 forks source link

not working with esp32 #6

Open Adrianahwjsgsj opened 3 years ago

Adrianahwjsgsj commented 3 years ago

im using object tracking code from examples and geting thit error: In file included from C:\Users\marti\AppData\Local\Temp\arduino_modified_sketch_33040\sketch_aug17a.ino:23:0: C:\Users\marti\Documents\Arduino\libraries\HUSKYLENS/HUSKYLENS.h:16:28: fatal error: SoftwareSerial.h: No such file or directory compilation terminated. exit status 1 Nastala chyba při kompilaci u desky ESP32 Dev Module.

Adrianahwjsgsj commented 3 years ago

i tried add softwareserial library to arduino libraries and im geting another error

In file included from C:\Users\marti\AppData\Local\Temp\arduino_modified_sketch_319669\sketch_aug17a.ino:23:0: C:\Users\marti\Documents\Arduino\libraries\HUSKYLENS/HUSKYLENS.h: In member function 'bool HUSKYLENS::processReturn()': C:\Users\marti\Documents\Arduino\libraries\HUSKYLENS/HUSKYLENS.h:171:90: error: no matching function for call to 'max(int16_t&, int)' protocolPtr = (Protocol_t) realloc(protocolPtr, max(protocolInfo.protocolSize, 1) sizeof(Protocol_t)); ^ In file included from c:\users\marti\documents\arduinodata\packages\esp32\tools\xtensa-esp32-elf-gcc\1.22.0-80-g6c4433a-5.2.0\xtensa-esp32-elf\include\c++\5.2.0\algorithm:62:0, from C:\Users\marti\Documents\ArduinoData\packages\esp32\hardware\esp32\1.0.4\cores\esp32/Arduino.h:142, from sketch\sketch_aug17a.ino.cpp:1: c:\users\marti\documents\arduinodata\packages\esp32\tools\xtensa-esp32-elf-gcc\1.22.0-80-g6c4433a-5.2.0\xtensa-esp32-elf\include\c++\5.2.0\bits\stl_algo.h:3463:5: note: candidate: template<class _Tp, class _Compare> _Tp std::max(std::initializer_list<_Tp>, _Compare) max(initializer_list<_Tp> l, _Compare __comp) ^ c:\users\marti\documents\arduinodata\packages\esp32\tools\xtensa-esp32-elf-gcc\1.22.0-80-g6c4433a-5.2.0\xtensa-esp32-elf\include\c++\5.2.0\bits\stl_algo.h:3463:5: note: template argument deduction/substitution failed: In file included from C:\Users\marti\AppData\Local\Temp\arduino_modified_sketch_319669\sketch_aug17a.ino:23:0: C:\Users\marti\Documents\Arduino\libraries\HUSKYLENS/HUSKYLENS.h:171:90: note: mismatched types 'std::initializer_list<_Tp>' and 'short int' protocolPtr = (Protocol_t) realloc(protocolPtr, max(protocolInfo.protocolSize, 1) sizeof(Protocol_t)); ^ In file included from c:\users\marti\documents\arduinodata\packages\esp32\tools\xtensa-esp32-elf-gcc\1.22.0-80-g6c4433a-5.2.0\xtensa-esp32-elf\include\c++\5.2.0\algorithm:62:0, from C:\Users\marti\Documents\ArduinoData\packages\esp32\hardware\esp32\1.0.4\cores\esp32/Arduino.h:142, from sketch\sketch_aug17a.ino.cpp:1: c:\users\marti\documents\arduinodata\packages\esp32\tools\xtensa-esp32-elf-gcc\1.22.0-80-g6c4433a-5.2.0\xtensa-esp32-elf\include\c++\5.2.0\bits\stl_algo.h:3457:5: note: candidate: template _Tp std::max(std::initializer_list<_Tp>) max(initializer_list<_Tp> l) ^ c:\users\marti\documents\arduinodata\packages\esp32\tools\xtensa-esp32-elf-gcc\1.22.0-80-g6c4433a-5.2.0\xtensa-esp32-elf\include\c++\5.2.0\bits\stl_algo.h:3457:5: note: template argument deduction/substitution failed: In file included from C:\Users\marti\AppData\Local\Temp\arduino_modified_sketch_319669\sketch_aug17a.ino:23:0: C:\Users\marti\Documents\Arduino\libraries\HUSKYLENS/HUSKYLENS.h:171:90: note: mismatched types 'std::initializer_list<_Tp>' and 'short int' protocolPtr = (Protocol_t) realloc(protocolPtr, max(protocolInfo.protocolSize, 1) sizeof(Protocol_t)); ^ In file included from c:\users\marti\documents\arduinodata\packages\esp32\tools\xtensa-esp32-elf-gcc\1.22.0-80-g6c4433a-5.2.0\xtensa-esp32-elf\include\c++\5.2.0\algorithm:61:0, from C:\Users\marti\Documents\ArduinoData\packages\esp32\hardware\esp32\1.0.4\cores\esp32/Arduino.h:142, from sketch\sketch_aug17a.ino.cpp:1: c:\users\marti\documents\arduinodata\packages\esp32\tools\xtensa-esp32-elf-gcc\1.22.0-80-g6c4433a-5.2.0\xtensa-esp32-elf\include\c++\5.2.0\bits\stl_algobase.h:265:5: note: candidate: template<class _Tp, class _Compare> const _Tp& std::max(const _Tp&, const _Tp&, _Compare) max(const _Tp& a, const _Tp& __b, _Compare comp) ^ c:\users\marti\documents\arduinodata\packages\esp32\tools\xtensa-esp32-elf-gcc\1.22.0-80-g6c4433a-5.2.0\xtensa-esp32-elf\include\c++\5.2.0\bits\stl_algobase.h:265:5: note: template argument deduction/substitution failed: In file included from C:\Users\marti\AppData\Local\Temp\arduino_modified_sketch_319669\sketch_aug17a.ino:23:0: C:\Users\marti\Documents\Arduino\libraries\HUSKYLENS/HUSKYLENS.h:171:90: note: deduced conflicting types for parameter 'const _Tp' ('short int' and 'int') protocolPtr = (Protocol_t) realloc(protocolPtr, max(protocolInfo.protocolSize, 1) sizeof(Protocol_t)); ^ In file included from c:\users\marti\documents\arduinodata\packages\esp32\tools\xtensa-esp32-elf-gcc\1.22.0-80-g6c4433a-5.2.0\xtensa-esp32-elf\include\c++\5.2.0\algorithm:61:0, from C:\Users\marti\Documents\ArduinoData\packages\esp32\hardware\esp32\1.0.4\cores\esp32/Arduino.h:142, from sketch\sketch_aug17a.ino.cpp:1: c:\users\marti\documents\arduinodata\packages\esp32\tools\xtensa-esp32-elf-gcc\1.22.0-80-g6c4433a-5.2.0\xtensa-esp32-elf\include\c++\5.2.0\bits\stl_algobase.h:219:5: note: candidate: template const _Tp& std::max(const _Tp&, const _Tp&) max(const _Tp& a, const _Tp& __b) ^ c:\users\marti\documents\arduinodata\packages\esp32\tools\xtensa-esp32-elf-gcc\1.22.0-80-g6c4433a-5.2.0\xtensa-esp32-elf\include\c++\5.2.0\bits\stl_algobase.h:219:5: note: template argument deduction/substitution failed: In file included from C:\Users\marti\AppData\Local\Temp\arduino_modified_sketch_319669\sketch_aug17a.ino:23:0: C:\Users\marti\Documents\Arduino\libraries\HUSKYLENS/HUSKYLENS.h:171:90: note: deduced conflicting types for parameter 'const _Tp' ('short int' and 'int') protocolPtr = (Protocol_t) realloc(protocolPtr, max(protocolInfo.protocolSize, 1) sizeof(Protocol_t)); ^ C:\Users\marti\Documents\Arduino\libraries\HUSKYLENS/HUSKYLENS.h: In member function 'int HUSKYLENS::available()': C:\Users\marti\Documents\Arduino\libraries\HUSKYLENS/HUSKYLENS.h:297:48: error: no matching function for call to 'min(int16_t&, int&)' currentIndex = min(currentIndex, result); ^ In file included from c:\users\marti\documents\arduinodata\packages\esp32\tools\xtensa-esp32-elf-gcc\1.22.0-80-g6c4433a-5.2.0\xtensa-esp32-elf\include\c++\5.2.0\algorithm:62:0, from C:\Users\marti\Documents\ArduinoData\packages\esp32\hardware\esp32\1.0.4\cores\esp32/Arduino.h:142, from sketch\sketch_aug17a.ino.cpp:1: c:\users\marti\documents\arduinodata\packages\esp32\tools\xtensa-esp32-elf-gcc\1.22.0-80-g6c4433a-5.2.0\xtensa-esp32-elf\include\c++\5.2.0\bits\stl_algo.h:3451: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\marti\documents\arduinodata\packages\esp32\tools\xtensa-esp32-elf-gcc\1.22.0-80-g6c4433a-5.2.0\xtensa-esp32-elf\include\c++\5.2.0\bits\stl_algo.h:3451:5: note: template argument deduction/substitution failed: In file included from C:\Users\marti\AppData\Local\Temp\arduino_modified_sketch_319669\sketch_aug17a.ino:23:0: C:\Users\marti\Documents\Arduino\libraries\HUSKYLENS/HUSKYLENS.h:297:48: note: mismatched types 'std::initializer_list<_Tp>' and 'short int' currentIndex = min(currentIndex, result); ^ In file included from c:\users\marti\documents\arduinodata\packages\esp32\tools\xtensa-esp32-elf-gcc\1.22.0-80-g6c4433a-5.2.0\xtensa-esp32-elf\include\c++\5.2.0\algorithm:62:0, from C:\Users\marti\Documents\ArduinoData\packages\esp32\hardware\esp32\1.0.4\cores\esp32/Arduino.h:142, from sketch\sketch_aug17a.ino.cpp:1: c:\users\marti\documents\arduinodata\packages\esp32\tools\xtensa-esp32-elf-gcc\1.22.0-80-g6c4433a-5.2.0\xtensa-esp32-elf\include\c++\5.2.0\bits\stl_algo.h:3445:5: note: candidate: template _Tp std::min(std::initializer_list<_Tp>) min(initializer_list<_Tp> l) ^ c:\users\marti\documents\arduinodata\packages\esp32\tools\xtensa-esp32-elf-gcc\1.22.0-80-g6c4433a-5.2.0\xtensa-esp32-elf\include\c++\5.2.0\bits\stl_algo.h:3445:5: note: template argument deduction/substitution failed: In file included from C:\Users\marti\AppData\Local\Temp\arduino_modified_sketch_319669\sketch_aug17a.ino:23:0: C:\Users\marti\Documents\Arduino\libraries\HUSKYLENS/HUSKYLENS.h:297:48: note: mismatched types 'std::initializer_list<_Tp>' and 'short int' currentIndex = min(currentIndex, result); ^ In file included from c:\users\marti\documents\arduinodata\packages\esp32\tools\xtensa-esp32-elf-gcc\1.22.0-80-g6c4433a-5.2.0\xtensa-esp32-elf\include\c++\5.2.0\algorithm:61:0, from C:\Users\marti\Documents\ArduinoData\packages\esp32\hardware\esp32\1.0.4\cores\esp32/Arduino.h:142, from sketch\sketch_aug17a.ino.cpp:1: c:\users\marti\documents\arduinodata\packages\esp32\tools\xtensa-esp32-elf-gcc\1.22.0-80-g6c4433a-5.2.0\xtensa-esp32-elf\include\c++\5.2.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\marti\documents\arduinodata\packages\esp32\tools\xtensa-esp32-elf-gcc\1.22.0-80-g6c4433a-5.2.0\xtensa-esp32-elf\include\c++\5.2.0\bits\stl_algobase.h:243:5: note: template argument deduction/substitution failed: In file included from C:\Users\marti\AppData\Local\Temp\arduino_modified_sketch_319669\sketch_aug17a.ino:23:0: C:\Users\marti\Documents\Arduino\libraries\HUSKYLENS/HUSKYLENS.h:297:48: note: deduced conflicting types for parameter 'const _Tp' ('short int' and 'int') currentIndex = min(currentIndex, result); ^ In file included from c:\users\marti\documents\arduinodata\packages\esp32\tools\xtensa-esp32-elf-gcc\1.22.0-80-g6c4433a-5.2.0\xtensa-esp32-elf\include\c++\5.2.0\algorithm:61:0, from C:\Users\marti\Documents\ArduinoData\packages\esp32\hardware\esp32\1.0.4\cores\esp32/Arduino.h:142, from sketch\sketch_aug17a.ino.cpp:1: c:\users\marti\documents\arduinodata\packages\esp32\tools\xtensa-esp32-elf-gcc\1.22.0-80-g6c4433a-5.2.0\xtensa-esp32-elf\include\c++\5.2.0\bits\stl_algobase.h:195:5: note: candidate: template const _Tp& std::min(const _Tp&, const _Tp&) min(const _Tp& __a, const _Tp& b) ^ c:\users\marti\documents\arduinodata\packages\esp32\tools\xtensa-esp32-elf-gcc\1.22.0-80-g6c4433a-5.2.0\xtensa-esp32-elf\include\c++\5.2.0\bits\stl_algobase.h:195:5: note: template argument deduction/substitution failed: In file included from C:\Users\marti\AppData\Local\Temp\arduino_modified_sketch_319669\sketch_aug17a.ino:23:0: C:\Users\marti\Documents\Arduino\libraries\HUSKYLENS/HUSKYLENS.h:297:48: note: deduced conflicting types for parameter 'const _Tp' ('short int' and 'int') currentIndex = min(currentIndex, result); ^ exit status 1 Nastala chyba při kompilaci u desky ESP32 Dev Module.

kypmmhoff commented 3 years ago

Modify HUSKYLENS.h line 376 by -> currentIndex = _min(currentIndex, result); line 231 by -> protocolPtr = (Protocol_t )realloc(protocolPtr, _max(protocolInfo.protocolSize, 1) sizeof(Protocol_t)); and line 707 by -> uint8_t data[7] = {length};

I've tested in NodeMCU 1.0