ChipChop Support Forum
Log in
Log out
Join the forum
My Details
REPLIES: 5
VIEWS: 169
BACK
REPLY TO THIS POST
Riccardo
21 Aug 2024
Compilation issue
Hello,
I'm having a weird compilation issue with arduino ide and
Espressif Systems esp32 board.

The code is not compiled if using board esp32 version 3.0.0 or later.
amazingly it correctly compiles with versions esp32 ver 2.0.17 or previous

The error is as some dependency is missing .

I've tried also the provided example "smart-led.ino" just to see if it is something related to my code, but same issue.

Do you know how to fix? (Except for using legacy 2.x board version)

best regards
Riccardo
Gizmo
21 Aug 2024

Hi Riccardo,

Can you post the compilation error message you are getting (you can post a screenshot if it's easier), just something so I can see what this is all about.

I've just done some digging and found this >> https://docs.espressif.com/projects/arduino-esp32/en/latest/migration_guides/2.x_to_3.0.html

From these details on Espressif I didn't see anything that ChipChop is using that is listed as a breaking change but there could be some crap in the Arduino WebSockets library that is now not compatible. I'll update my version of Arduino IDE and see if I can also replicate the issue.

Riccardo
21 Aug 2024

This is the full log , attaching also a screenshot


In file included from d:\Arduino\libraries\WebSockets2_Generic-modified\src/Tiny_Websockets_Generic/internals/ws_common.hpp:81,
from d:\Arduino\libraries\WebSockets2_Generic-modified\src/Tiny_Websockets_Generic/internals/data_frame.hpp:35,
from d:\Arduino\libraries\WebSockets2_Generic-modified\src/Tiny_Websockets_Generic/message.hpp:38,
from d:\Arduino\libraries\WebSockets2_Generic-modified\src/WebSockets2_Generic.h:58,
from d:\Arduino\libraries\ChipChop-1.40\src\ChipChopManager.cpp:41:
d:\Arduino\libraries\WebSockets2_Generic-modified\src/Tiny_Websockets_Generic/network/esp32/esp32_tcp.hpp:51:62: error: 'WiFiClientSecure' was not declared in this scope; did you mean 'WiFiClient'?
51 | class SecuredEsp32TcpClient : public GenericEspTcpClient<WiFiClientSecure>
| ^~~~~~~~~~~~~~~~
| WiFiClient
d:\Arduino\libraries\WebSockets2_Generic-modified\src/Tiny_Websockets_Generic/network/esp32/esp32_tcp.hpp:51:78: error: template argument 1 is invalid
51 | class SecuredEsp32TcpClient : public GenericEspTcpClient<WiFiClientSecure>
| ^
d:\Arduino\libraries\WebSockets2_Generic-modified\src/Tiny_Websockets_Generic/network/esp32/esp32_tcp.hpp: In member function 'void websockets2_generic::network2_generic::SecuredEsp32TcpClient::setCACert(const char*)':
d:\Arduino\libraries\WebSockets2_Generic-modified\src/Tiny_Websockets_Generic/network/esp32/esp32_tcp.hpp:56:17: error: 'class websockets2_generic::network2_generic::SecuredEsp32TcpClient' has no member named 'client'
56 | this->client.setCACert(ca_cert);
| ^~~~~~
d:\Arduino\libraries\WebSockets2_Generic-modified\src/Tiny_Websockets_Generic/network/esp32/esp32_tcp.hpp: In member function 'void websockets2_generic::network2_generic::SecuredEsp32TcpClient::setCertificate(const char*)':
d:\Arduino\libraries\WebSockets2_Generic-modified\src/Tiny_Websockets_Generic/network/esp32/esp32_tcp.hpp:61:17: error: 'class websockets2_generic::network2_generic::SecuredEsp32TcpClient' has no member named 'client'
61 | this->client.setCertificate(client_ca);
| ^~~~~~
d:\Arduino\libraries\WebSockets2_Generic-modified\src/Tiny_Websockets_Generic/network/esp32/esp32_tcp.hpp: In member function 'void websockets2_generic::network2_generic::SecuredEsp32TcpClient::setPrivateKey(const char*)':
d:\Arduino\libraries\WebSockets2_Generic-modified\src/Tiny_Websockets_Generic/network/esp32/esp32_tcp.hpp:66:17: error: 'class websockets2_generic::network2_generic::SecuredEsp32TcpClient' has no member named 'client'
66 | this->client.setPrivateKey(private_key);
| ^~~~~~
d:\Arduino\libraries\WebSockets2_Generic-modified\src/Tiny_Websockets_Generic/network/esp32/esp32_tcp.hpp: In member function 'void websockets2_generic::network2_generic::SecuredEsp32TcpClient::setInsecure()':
d:\Arduino\libraries\WebSockets2_Generic-modified\src/Tiny_Websockets_Generic/network/esp32/esp32_tcp.hpp:71:17: error: 'class websockets2_generic::network2_generic::SecuredEsp32TcpClient' has no member named 'client'
71 | this->client.setInsecure();
| ^~~~~~
In file included from d:\Arduino\libraries\WebSockets2_Generic-modified\src/WebSockets2_Generic.h:63:
d:\Arduino\libraries\WebSockets2_Generic-modified\src/WebSockets2_Generic_Client.hpp: In member function 'void websockets2_generic::WebsocketsClient::upgradeToSecuredConnection()':
d:\Arduino\libraries\WebSockets2_Generic-modified\src/WebSockets2_Generic_Client.hpp:493:70: error: no match for 'operator=' (operand types are 'std::shared_ptr<websockets2_generic::network2_generic::TcpClient>' and 'std::shared_ptr<websockets2_generic::network2_generic::SecuredEsp32TcpClient>')
493 | this->_client = std::shared_ptr<WSDefaultSecuredTcpClient>(client);
| ^
In file included from c:\users\rrusso\appdata\local\arduino15\packages\esp32\tools\esp-x32\2302\xtensa-esp32-elf\include\c++\12.2.0\memory:77,
from C:\Users\rrusso\AppData\Local\Arduino15\packages\esp32\hardware\esp32\3.0.3\libraries\Network\src/NetworkClient.h:24,
from C:\Users\rrusso\AppData\Local\Arduino15\packages\esp32\hardware\esp32\3.0.3\libraries\Network\src/Network.h:12,
from C:\Users\rrusso\AppData\Local\Arduino15\packages\esp32\hardware\esp32\3.0.3\libraries\WiFi\src/WiFiGeneric.h:39,
from C:\Users\rrusso\AppData\Local\Arduino15\packages\esp32\hardware\esp32\3.0.3\libraries\WiFi\src/WiFiSTA.h:29,
from C:\Users\rrusso\AppData\Local\Arduino15\packages\esp32\hardware\esp32\3.0.3\libraries\WiFi\src/WiFi.h:33,
from d:\Arduino\libraries\WebSockets2_Generic-modified\src/Tiny_Websockets_Generic/network/esp32/esp32_tcp.hpp:42:
c:\users\rrusso\appdata\local\arduino15\packages\esp32\tools\esp-x32\2302\xtensa-esp32-elf\include\c++\12.2.0\bits\shared_ptr.h:418:9: note: candidate: 'template<class _Yp> std::shared_ptr<_Tp>::_Assignable<const std::shared_ptr<_Yp>&> std::shared_ptr<_Tp>::operator=(const std::shared_ptr<_Yp>&) [with _Tp = websockets2_generic::network2_generic::TcpClient]'
418 | operator=(const shared_ptr<_Yp>& __r) noexcept
| ^~~~~~~~
c:\users\rrusso\appdata\local\arduino15\packages\esp32\tools\esp-x32\2302\xtensa-esp32-elf\include\c++\12.2.0\bits\shared_ptr.h:418:9: note: template argument deduction/substitution failed:
c:\users\rrusso\appdata\local\arduino15\packages\esp32\tools\esp-x32\2302\xtensa-esp32-elf\include\c++\12.2.0\bits\shared_ptr.h: In substitution of 'template<class _Tp> template<class _Arg> using _Assignable = typename std::enable_if<std::is_assignable<std::__shared_ptr<_Tp>&, _Arg>::value, std::shared_ptr<_Tp>&>::type [with _Arg = const std::shared_ptr<websockets2_generic::network2_generic::SecuredEsp32TcpClient>&; _Tp = websockets2_generic::network2_generic::TcpClient]':
c:\users\rrusso\appdata\local\arduino15\packages\esp32\tools\esp-x32\2302\xtensa-esp32-elf\include\c++\12.2.0\bits\shared_ptr.h:418:2: required by substitution of 'template<class _Yp> std::shared_ptr<websockets2_generic::network2_generic::TcpClient>::_Assignable<const std::shared_ptr<_Tp>&> std::shared_ptr<websockets2_generic::network2_generic::TcpClient>::operator=(const std::shared_ptr<_Tp>&) [with _Yp = websockets2_generic::network2_generic::SecuredEsp32TcpClient]'
d:\Arduino\libraries\WebSockets2_Generic-modified\src/WebSockets2_Generic_Client.hpp:493:70: required from here
c:\users\rrusso\appdata\local\arduino15\packages\esp32\tools\esp-x32\2302\xtensa-esp32-elf\include\c++\12.2.0\bits\shared_ptr.h:183:15: error: no type named 'type' in 'struct std::enable_if<false, std::shared_ptr<websockets2_generic::network2_generic::TcpClient>&>'
183 | using _Assignable = typename enable_if<
| ^~~~~~~~~~~
c:\users\rrusso\appdata\local\arduino15\packages\esp32\tools\esp-x32\2302\xtensa-esp32-elf\include\c++\12.2.0\bits\shared_ptr.h:429:9: note: candidate: 'template<class _Yp> std::shared_ptr<_Tp>::_Assignable<std::auto_ptr<_Up> > std::shared_ptr<_Tp>::operator=(std::auto_ptr<_Up>&&) [with _Tp = websockets2_generic::network2_generic::TcpClient]'
429 | operator=(auto_ptr<_Yp>&& __r)
| ^~~~~~~~
c:\users\rrusso\appdata\local\arduino15\packages\esp32\tools\esp-x32\2302\xtensa-esp32-elf\include\c++\12.2.0\bits\shared_ptr.h:429:9: note: template argument deduction/substitution failed:
d:\Arduino\libraries\WebSockets2_Generic-modified\src/WebSockets2_Generic_Client.hpp:493:70: note: 'std::shared_ptr<websockets2_generic::network2_generic::SecuredEsp32TcpClient>' is not derived from 'std::auto_ptr<_Up>'
493 | this->_client = std::shared_ptr<WSDefaultSecuredTcpClient>(client);
| ^
c:\users\rrusso\appdata\local\arduino15\packages\esp32\tools\esp-x32\2302\xtensa-esp32-elf\include\c++\12.2.0\bits\shared_ptr.h:446:9: note: candidate: 'template<class _Yp> std::shared_ptr<_Tp>::_Assignable<std::shared_ptr<_Yp> > std::shared_ptr<_Tp>::operator=(std::shared_ptr<_Yp>&&) [with _Tp = websockets2_generic::network2_generic::TcpClient]'
446 | operator=(shared_ptr<_Yp>&& __r) noexcept
| ^~~~~~~~
c:\users\rrusso\appdata\local\arduino15\packages\esp32\tools\esp-x32\2302\xtensa-esp32-elf\include\c++\12.2.0\bits\shared_ptr.h:446:9: note: template argument deduction/substitution failed:
c:\users\rrusso\appdata\local\arduino15\packages\esp32\tools\esp-x32\2302\xtensa-esp32-elf\include\c++\12.2.0\bits\shared_ptr.h: In substitution of 'template<class _Tp> template<class _Arg> using _Assignable = typename std::enable_if<std::is_assignable<std::__shared_ptr<_Tp>&, _Arg>::value, std::shared_ptr<_Tp>&>::type [with _Arg = std::shared_ptr<websockets2_generic::network2_generic::SecuredEsp32TcpClient>; _Tp = websockets2_generic::network2_generic::TcpClient]':
c:\users\rr


Attached images
Gizmo
21 Aug 2024

As I thought, they've messed up their own websocket library.

Took me some digging but I think I've found a fix, they've ditched "WiFiClientSecure" and now it's "NetworkClientSecure"..grrrr!!👊🖕☠️

I've done a quick update so download this >> https://chipchop.io/downloads/WebSockets2_Generic-modified.zip
and replace it in your: <user>/Documents/Arduino/libraries

If you are not using my modified version already then you will probably have to uninstall the WebSockets2_Generic through the library manager and then copy this one manually in the Arduino/libraries folder

Let me know if it compiles now.

There could be few warning messages but those are some deprecation notes in the library and shouldn't affect anything...if it compiles and works on the device just ignore them
Riccardo
22 Aug 2024

Hi,
Thanks now with chip-chop demos is working smoothly. Testing with my project.
Gizmo
22 Aug 2024

Great! Thank you for letting me know.

I think I will have to change the Code Builder for Arduino IDE and from now on always include the modified WebSockets library.

G