skaarj1989/mWebSockets

Client not working on ESP32-S3 WIFI

Closed this issue · 13 comments

Describe the bug
I'm using a ESP32-S3 DevkitC-1 in wifi mode, when I'm working as a server, it all works, but when I set it as client, it gives me this error

[  1265][E][esp32-hal-adc.c:158] __analogRead(): Pin 0 is not ADC pin!

Environment info

  • mWebSockets version/branch: master
  • IDE w/version: PlatformIO v3.3.2
  • Platform/Board: ESP32-S3 DevkitC-1
  • Network controller (shield or module): Wifi

Failure log

Connecting to tecnica
.. connected
Device IP: 192.168.10.236
[  1265][E][esp32-hal-adc.c:158] __analogRead(): Pin 0 is not ADC pin!
Connection failed!

I'm using the example codes to test

What kind of WebSocket server do you use?
Please mind that the SSL connection is not supported.

I'm using the same library with a arduino mega 2560 and a 28J60. with the arduino as a client and the esp32 as a server, it works. when I reverse, it give me the error above. the arduino as a server I can connect with a nodejs as a client. and I'm not using ssl

I'm talking about a scenerio when you have a WebSocket client (this library) uploaded into a ESP32 board.
What is your server endpoint? also this library?

open config.h and uncomment debugging defines.

I'm talking about a scenerio when you have a WebSocket client (this library) uploaded into a ESP32 board. What is your server endpoint? also this library?

Yes, in a Arduino Mega 2560

this is the console log with the uncomment debuging

Connecting to tecnica
.. connected
Device IP: 192.168.10.236
[  1264][E][esp32-hal-adc.c:158] __analogRead(): Pin 0 is not ADC pin!
[Line #0] HTTP/1.1 400 Bad Request
Error during WebSocket handshake: net::ERR_INVALID_HTTP_RESPONSE
Connection failed!

And what about a debug log of a server?

it does not receive any data, even with the debug enable

The connection was rejected way before the handshake.
Make sure that your ip and port is correct when using client.open(...)

just check again, ip and port are correct. this error only happens when the ip and port are correct, if it is wrong it only shows the connection failed, without the analogread error

  1. Is your host argument (in client.open()) in a form: xxx.xxx.xxx.xxx or ws://...?
  2. Are you able to connect to WebSocket server from any other endpoint (a browser client, or node.js)?

the host is xxx.xxx.xxx.xxx and the server connect to a nodejs client as a test

Actually it's the other way around, the client connets to a server (server can only accept/reject a client).
Anyways, I can't help you with debugging without a servers log. Looks like WiFi controller rejects a connection (I don't know why).

On a board that you have a WebSocket client, could you upload any WebServer client sketch (try a built-in example)?

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.