khoih-prog / WebSockets2_Generic

A WebSocket Server and Client library for Arduino, based on RFC6455, for writing modern Websockets applications. Now support ESP8266, ESP32 (including ESP32-S2 Saola, AI-Thinker ESP-12K, WT32_ETH01, etc.), nRF52, SAMD21, SAMD51, SAM DUE, STM32F/L/H/G/WB/MP1, Teensy, RP2040-based, etc. boards, with WiFiNINA, Teensy 4.1 NativeEthernet/QNEthernet, Ethernet W5x00 / ENC28J60 / LAN8742A / LAN8720, ESP8266 / ESP32-AT modules/shields, as well as SINRIC / Alexa / Google Home
GNU General Public License v3.0
81 stars 30 forks source link

Loop function hangs even without the poll function #26

Closed jackmerrill closed 3 years ago

jackmerrill commented 3 years ago

Hi it's me again haha. When I run my code on the board, it only seems to run the loop function once, but if I remove / comment out any of the Websocket code, it works completely fine (lines 162 and 194).

Code: https://github.com/jackmerrill/FriendshipLamp/blob/main/Friendship_Lamp.ino

Here's how I know it doesn't loop:

23:11:39.759 -> Connnection Opened
23:11:39.759 -> Connected!
23:11:39.759 -> available
23:11:39.759 -> on
23:11:39.759 -> number of button pushes: 1
23:11:39.759 -> color

available and beyond should be printing more than just once.

Any and all help is appreciated, thanks!

khoih-prog commented 3 years ago

Sorry I have no time to help debug your complex use case.

I suggest you start with the SAMD-Client example, then add more features gradually and see where / when the new code breaks.

I certainly won't have time to spend here unless you prove there is a reproducible bug of this library.

Good Luck,