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

WebSockets2_Generic example problem #52

Closed dirkdickler closed 1 year ago

dirkdickler commented 1 year ago

In example : https://github.com/khoih-prog/WebSockets2_Generic/tree/master/examples/Generic/Ethernet/ESP32/ESP32_Ethernet_ServerAllFunctionsDemo

I have problem with varialble: wsServer - this varialbe not define in browser I create two server.on server.on("/", - problem with varialble: wsServer (orange,red) server.on("/test" - (blue) here I replace text "new WebSocket(wsServer, ['arduino']); " by my ipadress "new WebSocket(\"ws://192.168.1.10:8080/\", ['arduino']);" -result see in attachment

A testing on WebSockets2_Generic 1.12.0 and 1.12.1 latest same result VS CODE -platformIO : espressif/toolchain-xtensa-esp32s2@ 8.4.0+2021r2-patch3 framework-arduinoespressif32 @ https://github.com/espressif/arduino-esp32.git#2.0.5

webSocket

khoih-prog commented 1 year ago

Hi @dirkdickler

I have problem with varialble: wsServer - this varialbe not define in browser

https://github.com/khoih-prog/WebSockets2_Generic/blob/093b9f83f73ba6437f104a599dfedccad1c611fa/examples/Generic/Ethernet/ESP32/ESP32_Ethernet_ServerAllFunctionsDemo/ESP32_Ethernet_ServerAllFunctionsDemo.ino#L160


Try with that unmodified example first with Arduino IDE. If OK, then your code to see. If OK, then use more complex platform later, provided you know what's you're doing and with correct settings,

The example ESP32_Ethernet_ServerAllFunctionsDemo is compiled here OK

Selection_128


Sorry if you still have issue with your code, please ask for support on Arduino Forum as I don't have time and not interested in helping with individual codes, unless there is a proven bug of the library.