You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
WebSocket on ESP32 Fails, 'Not a websocket request'
I've been working on build a visual studio code extension for a better developing experience on ESP32, MicroPython. But without any basic knowledge for front-end development, this process is quite tough for me.
To establish a wireless connection, the first thing that came into my mind is that I should check the official tools. So I checked the source code of project [webrepl](https://github.com/micropython/webrepl), a WebREPL terminal client, which also has a coarse front-end written in Javascript.
Problem
It seemed to be simple to connect to the webrepl server running on the board, as the code in [webrepl.html](https://github.com/micropython/webrepl/blob/master/webrepl.html) showed. But when I was using the npm package ws or websocket in Typescript to connect to it, the connection was simply cannot be established. The error in the serial connection illustrated that
Traceback (most recent call last):
File "webrepl.py", line 43, in accept_conn
File "websocket_helper.py", line 39, in server_handshake
OSError: Not a websocket request
WebREPL connection from: ('192.168.137.1', 2935)
At first I thought it was just like the old problems, parameters, policies, etc. So I applied WireShark to check the different between the packets sent by webrepl and the Typescript extension written by myself.
This allows subfolders to be treated similar to / for multiple
apps within different folders.
Also, fix up the internal current working directory so it doesn't
depend on volumes.
Fixesmicropython#9045 and fixesmicropython#8409.
tannewt
added a commit
to tannewt/circuitpython
that referenced
this issue
Apr 22, 2025
This allows subfolders to be treated similar to / for multiple
apps within different folders.
Also, fix up the internal current working directory so it doesn't
depend on volumes.
Fixesmicropython#9045 and fixesmicropython#8409.
WebSocket on ESP32 Fails, 'Not a websocket request'
I've been working on build a visual studio code extension for a better developing experience on ESP32, MicroPython. But without any basic knowledge for front-end development, this process is quite tough for me.
To establish a wireless connection, the first thing that came into my mind is that I should check the official tools. So I checked the source code of project [webrepl](https://github.com/micropython/webrepl), a WebREPL terminal client, which also has a coarse front-end written in Javascript.
Problem
It seemed to be simple to connect to the webrepl server running on the board, as the code in [webrepl.html](https://github.com/micropython/webrepl/blob/master/webrepl.html) showed. But when I was using the npm package
ws
orwebsocket
in Typescript to connect to it, the connection was simply cannot be established. The error in the serial connection illustrated thatAt first I thought it was just like the old problems, parameters, policies, etc. So I applied WireShark to check the different between the packets sent by webrepl and the Typescript extension written by myself.
Using the
ws
package to connect:Using Javascript
WebSocket
to conncet:Having no idea which options to alter, I referred to the [MicroPython](https://github.com/micropython/micropython) project to find out. But the code shows that’s nothing to do with the options.
But how can
webkey == None
happen? The two packets both haveSec-WebSocket-Key
in their fields.The text was updated successfully, but these errors were encountered: