Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ESP32 is unable to connect to my Node.js socket.io Server #102

Open
shubhamGhosh-dev opened this issue Mar 24, 2023 · 3 comments
Open

ESP32 is unable to connect to my Node.js socket.io Server #102

shubhamGhosh-dev opened this issue Mar 24, 2023 · 3 comments

Comments

@shubhamGhosh-dev
Copy link

shubhamGhosh-dev commented Mar 24, 2023

I have uploaded the example code to my ESP32 board and I found an unusual behavior.

  1. When I tried to connect my esp32 to my node.js server where the Socket.Io version is 4.* at that time serial monitor printed [SIoC] Disconnected! ( means ESP32 board is unable to connect to my server.).

  2. When I tried to connect my esp32 to my node.js server where the Socket.Io version is 2.* or 3.* then also I am getting [SIoC] Disconnected!. but at this time my server is also crashing when my ESP32 board is trying to connect ( including when I press the reset button on the ESP32 board). My server is giving this below error.

events.js:352
      throw er; // Unhandled 'error' event
      ^

Error: read ECONNRESET
    at TCP.onStreamRead (internal/stream_base_commons.js:209:20)
Emitted 'error' event on Socket instance at:
    at emitErrorNT (internal/streams/destroy.js:106:8)
    at emitErrorCloseNT (internal/streams/destroy.js:74:3)
    at processTicksAndRejections (internal/process/task_queues.js:82:21) {
  errno: -4077,
  code: 'ECONNRESET',
  syscall: 'read'
}

please let me know what can i do about this or if there is any server specification that I have to take care of.

@Lautaro124
Copy link

Is the position of your node application the same as the one indicated in the example?

@MAnonInfinity
Copy link

@shubhamGhosh-dev The same problem occurs with me too, it keeps on saying disconnected. Were you able to find any other solution?
@Lautaro124 Yes, the node application is the same as in the example, yet I'm facing this issue

@Mau-MD
Copy link

Mau-MD commented Apr 14, 2024

Add allowEI03 to Socket IO Server configuration. I'm using "socket.io": "^4.7.5" in my node server

const io = new Server(server, {
  allowEIO3: true,
  cors: {
    origin: "*",
    methods: ["GET", "POST"],
  },
});

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants