Hi,
I want to send some user and informations messages on WebREPL as soon as the connection is done, just after the message "WebREPL connected".
Is it possible ?
Thanks
Send user message after webrepl connection
Re: Send user message after webrepl connection
Code: Select all
webrepl.start()
utime.sleep(20)
print('hi there')
Re: Send user message after webrepl connection
If you look at extmod/webrepl.py, you'll see how the webrepl is set up with a callback on connection.
Since this is just python code, you can duplicate it into you're own version of the webrepl, and you won't need to recompile the firmware to modify it.
just copy extmod/webrepl.py to your own module, let's say "mywebrepl". Then you can use
Then you can modify the accept_conn to send whatever you'd to the websocket on connection after the handshake.
Since this is just python code, you can duplicate it into you're own version of the webrepl, and you won't need to recompile the firmware to modify it.
just copy extmod/webrepl.py to your own module, let's say "mywebrepl". Then you can use
Code: Select all
>>> import mywebrepl
>>> mywebrepl.start(password="whatever")
Re: Send user message after webrepl connection
Tanks, I'll try that !