← index #3621Issue #2336
Off-topic · high · value 0.515
QUERY · ISSUE

webrepl crash - ESP8266

openby ds2k5opened 2018-02-16updated 2026-03-26
port-esp8266proposed-close

Hello,

Board: ESP8266 NodeMcu v3

wanna run the webrepl, but it crash if I open the URL with Bowser.


WebREPL daemon started on ws://0.0.0.0:8266
Started webrepl in normal mode
connecting to network...
Network configuration: ('192.168.1.246', '255.255.255.0', '192.168.1.1', '1.2.3.4')
WebREPL daemon started on ws://192.168.1.246:8266
Started webrepl in normal mode

MicroPython v1.9.3-8-g63826ac5c on 2017-11-01; ESP module with ESP8266
Type "help()" for more information.
>>> 
WebREPL connection from: ('192.168.1.114', 58848)
Traceback (most recent call last):
  File "webrepl.py", line 42, in accept_conn
  File "websocket_helper.py", line 34, in server_handshake
OSError: Not a websocket request

Here is the code: **


import machine
import socket
import webrepl

def do_connect():
    import network

    SSID = 'MyWIFI'
    PASSWORD = 'MyWiFIPassword'

    sta_if = network.WLAN(network.STA_IF)
    ap_if = network.WLAN(network.AP_IF)
    if ap_if.active():
        ap_if.active(False)
    if not sta_if.isconnected():
        print('connecting to network...')
        sta_if.active(True)
        sta_if.connect(SSID, PASSWORD)
        while not sta_if.isconnected():
            pass
    print('Network configuration:', sta_if.ifconfig())

do_connect()

webrepl.start()
sudo ampy --port /dev/ttyUSB0 ls
boot.py
webrepl_cfg.py
main.py  ** there is the CODE

sudo ampy --port /dev/ttyUSB0 get webrepl_cfg.py

show the password I set with: import webrepl_setup

What did I wrong ?

Thanks

CANDIDATE · ISSUE

WebREPL not running

closedby switchtrueopened 2016-08-21updated 2016-08-22

On the WebREPL docs for the ESP8266 (here) it mentions connecting to the chips WiFi access point and then going to the WebREPL webpage.

I found that the WebREPL wasn't actually started on my board and the documentation didn't seem to indicate how to start it. This should be added to the documentation to avoid confusion.

Keyboard

j / / n
next pair
k / / p
previous pair
1 / / h
show query pane
2 / / l
show candidate pane
c
copy suggested comment
r
toggle reasoning
g i
go to index
?
show this help
esc
close overlays

press ? or esc to close

copied