goatchurchprime / jupyter_micropython_kernel

Jupyter kernel to interact with a MicroPython/ESP8266 over the serial REPL
BSD 3-Clause "New" or "Revised" License
149 stars 33 forks source link

Make a much more user friendly %connection login #19

Open goatchurchprime opened 7 years ago

goatchurchprime commented 7 years ago

Not necessary to print the following if it is recognized correct.

Hold the messages back for a second and parse them.

***Connecton broken [Connection timed out]
You may need to reconnectClosing websocket <websocket._core.WebSocket object at 0x7f679c9194e0>
Connecting to Serial /dev/ttyUSB1 baud=115200

 ** Serial connected **

Serial<id=0x7f67996c9780, open=True>(port='/dev/ttyUSB1', baudrate=115200, bytesize=8, parity='N', stopbits=1, timeout=0.5, xonxoff=False, rtscts=False, dsrdtr=False)

>>> 
>>> 
>>> 
>>> 
raw REPL; CTRL-B to exit
>
goatchurchprime commented 7 years ago

Have made an attempt to put back into paste mode when you do %disconnect

Cannot yet get reliable disconnection and connection on the ESP32 (even when picoweb shows it should be good to serially connect)

goatchurchprime commented 7 years ago

It would be great to change the appearance depending on the connection status.

Closest description is here: https://github.com/jupyter/notebook/issues/1883

goatchurchprime commented 7 years ago

This is going to involve some form of outputting HTML through the display mechanism in some way https://github.com/ipython/ipython/blob/master/IPython/core/display.py

and changing the background colour of the kernel status bit using this: from IPython.core.display import HTML kk = HTML('')