micro:bit kernel

308 views
Skip to first unread message

Thomas Kluyver

unread,
Mar 24, 2016, 7:55:22 AM3/24/16
to Project Jupyter
Hi all,

I'd like to introduce a Jupyter kernel for controlling the BBC micro:bit:
https://github.com/takluyver/ubit_kernel

The micro:bit is a single-board computer with various accessories built in - a 5x5 pixel LED grid, two buttons, pins, an accelerometer and a compass. It's being distributed to every year 7 student (age ~11) in the UK, to foster an interest in programming.

Thanks to the hard work of other people, especially Damien George in Cambridge, the micro:bit can run MicroPython, a Python 3 dialect for microcontrollers. The MicroPython port on the micro:bit offers convenient high level functions like scrolling text across the LED display, and calculating gestures from the accelerometer.

Fernando and Nicholas Tollervey met at EdFoo and started working on a Jupyter kernel for the micro:bit (http://ntoll.org/article/edfoo ). I've built on the code from that using our wrapper kernel machinery. ubit_kernel runs on your local computer, sending code to the microbit over a serial port and reading the results back. It's early days, and there's plenty to improve, but if you can beg, borrow or steal a micro:bit from somewhere, you can start playing with it from a notebook.

Best wishes,
Thomas

Dave Willmer

unread,
Mar 24, 2016, 8:15:54 AM3/24/16
to Project Jupyter
This is awesome, thanks Thomas! :)

Fernando Perez

unread,
Mar 24, 2016, 4:04:43 PM3/24/16
to Project Jupyter

On Thu, Mar 24, 2016 at 5:15 AM, Dave Willmer <dave.w...@gmail.com> wrote:
This is awesome, thanks Thomas! :)

+1!

I got really excited talking to Nicholas, who did all the initial hard work.  It's a bit of a weird setup, b/c the microbit does run python, but can't run a full kernel by itself (this is why the kernel_wrapper machinery makes sense in this case, despite the device running python natively). The result is sort of a "two headed python":


I now look forward to our next million Jupyter contributors coming from the UK :)

Cheers

f


--
Fernando Perez (@fperez_org; http://fperez.org)
fperez.net-at-gmail: mailing lists only (I ignore this when swamped!)
fernando.perez-at-berkeley: contact me here for any direct mail

Denis Akhiyarov

unread,
Mar 24, 2016, 10:06:56 PM3/24/16
to Project Jupyter
This is great for teachers and students in UK! Any way this 2-headed snake from jupyter world could work with generic uPy without BBC microbit for those who own PyBoard or other similar boards?

Thomas Kluyver

unread,
Mar 25, 2016, 6:00:17 AM3/25/16
to Project Jupyter

Hi Denis,

There's no reason it couldn't work with other boards running micropython, but I don't have any to check. Can you connect to it as a serial device and get a REPL? If so, it should be just a question of tweaking the code that identifies the device and opens the serial connection.

Thomas

On 25 Mar 2016 02:06, "Denis Akhiyarov" <denis.a...@gmail.com> wrote:
This is great for teachers and students in UK! Any way this 2-headed snake from jupyter world could work with generic uPy without BBC microbit for those who own PyBoard or other similar boards?

--
You received this message because you are subscribed to the Google Groups "Project Jupyter" group.
To unsubscribe from this group and stop receiving emails from it, send an email to jupyter+u...@googlegroups.com.
To post to this group, send email to jup...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/jupyter/6b79795f-0a5b-4b2e-a914-b15265bb95b9%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Sylvain Corlay

unread,
Mar 25, 2016, 7:09:06 AM3/25/16
to jup...@googlegroups.com
I am curious, what prevents micro python to run ipykernel? Can it run ipython itself?

Thomas Kluyver

unread,
Mar 25, 2016, 7:41:56 AM3/25/16
to Project Jupyter

It's running without an operating system, so there are many things missing. On the micro:bit at least, there's no networking capability that I'm aware of. I don't think there's even a filesystem. I'm pretty sure that running IPython on it directly would be either impossible or very hard.

Thomas

Robin Cole

unread,
Apr 29, 2017, 3:07:50 AM4/29/17
to Project Jupyter
Great work, just what I wanted from the micropython platform!

Thomas Kluyver

unread,
May 2, 2017, 8:25:25 AM5/2/17
to Project Jupyter
To follow up on an earlier question (from Denis), Jens Nie made a variant of the kernel for the NodeMCU board:
https://github.com/jneines/nodemcu_kernel/

He has told me that this was as simple as changing the USB PID & VID it looks for. So we might look at merging them into a single micropython kernel which checks for a range of boards.

Thomas

On 29 April 2017 at 08:07, Robin Cole <robma...@gmail.com> wrote:
Great work, just what I wanted from the micropython platform!

--
You received this message because you are subscribed to the Google Groups "Project Jupyter" group.
To unsubscribe from this group and stop receiving emails from it, send an email to jupyter+unsubscribe@googlegroups.com.

To post to this group, send email to jup...@googlegroups.com.

Roy Volkwyn

unread,
Jan 16, 2020, 12:25:16 PM1/16/20
to Project Jupyter
Hi Thomas,

Has any other work been done on  Jupyter for micro:bit apart from your work on Github?

I am new to this Group. Bought some Jupyter courses on Udemy just over a year ago but did not start using them. Paid for Juno Pro so I could run Jupyter on my iPad. Installed Carnets so I can run Jupyter Notebook natively on my iPad.

I am gearing up to give Micro:bit courses. One module will be for Micropython. It will teach Python/Micropython to children, teachers, laypersons.  I would like to introduce Jupyter too, if it can be easily installed and simply used.


Roy



On Tuesday, May 2, 2017 at 2:25:25 PM UTC+2, takowl wrote:
To follow up on an earlier question (from Denis), Jens Nie made a variant of the kernel for the NodeMCU board:
https://github.com/jneines/nodemcu_kernel/

He has told me that this was as simple as changing the USB PID & VID it looks for. So we might look at merging them into a single micropython kernel which checks for a range of boards.

Thomas
On 29 April 2017 at 08:07, Robin Cole <robma...@gmail.com> wrote:
Great work, just what I wanted from the micropython platform!

--
You received this message because you are subscribed to the Google Groups "Project Jupyter" group.
To unsubscribe from this group and stop receiving emails from it, send an email to jup...@googlegroups.com.

To post to this group, send email to jup...@googlegroups.com.
Reply all
Reply to author
Forward
0 new messages