There seems to be an initialization issue with the WSclient_t struct of the base class (WebSocketsClient)
I found using AWSWebSocketClient as global member (also static) worked with my sketch but
When allocating the AWSWebSocketClient on the heap it crahes.
The problem is that the WSclient_t struct of the base class is only initialized from the begin() function.
But when calling the AWSWebSocketClient::connect for the first time it calls stop() and leads to WebSocketsClient::disconnect() / WebSocketsClient::clientIsConnected. And here it crashes because the access of client->tcp which was is not initialized yet.
As a solution you could offer a initialization (e.g. begin) routine or do some initialization in the constructor.
Putting
begin("",0);
at the end of the AWSWebSocketClient::AWSWebSocketClient` solved for me the problem
There seems to be an initialization issue with the WSclient_t struct of the base class (WebSocketsClient) I found using AWSWebSocketClient as global member (also static) worked with my sketch but When allocating the AWSWebSocketClient on the heap it crahes.
The problem is that the
WSclient_t
struct of the base class is only initialized from the begin() function. But when calling theAWSWebSocketClient::connect
for the first time it calls stop() and leads toWebSocketsClient::disconnect() / WebSocketsClient::clientIsConnected
. And here it crashes because the access of client->tcp which was is not initialized yet.As a solution you could offer a initialization (e.g. begin) routine or do some initialization in the constructor. Putting
begin("",0);
at the end of theAWSWebSocketClient::
AWSWebSocketClient` solved for me the problem