← index #3621Issue #2299
Off-topic · high · value 0.398
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

Hosting webrepl from ESP8266 - feasible?

closedby cefnopened 2016-08-08updated 2016-12-05

Increasingly impressed with all the work on micropython and looking forward to incorporating it into what we do at @ShrimpingIt ! Trying to bottom out a few issues about how we should pre-flash ESP01 (1Meg) and NodeMcu v2 boards for the greatest possible accessibility for our learners.

Being able to program them standalone from a laptop, tablet or phone is really powerful. However, currently I have been visiting http://micropython.org/webrepl/ then switching Wifi network to be able to connect to the ESP8266 module. This will not be possible for all our learners and ideally having a mobile phone would be enough to be able to program or issue commands to these devices.

This suggests we should attempt to serve the webrepl.html and supporting files direct from the ESP8266. However, I am surprised not to see this configuration documented anywhere. Is there a reason this hasn't been attempted which I can't yet fathom?

Is it worth putting together a module which serves the browser interface files ( https://github.com/micropython/webrepl ) on some port or is it somehow incompatible to host a webserver on http://192.168.4.1:80 at the same time as the repl socket on ws://192.168.4.1:8266/?

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