An experimental Jupyter kernel for micropython
- Python 3.4+
- Jupyter >= 1.0.0
- pyserial >= 2.7 (for stmhal kernel)
Make sure you have the packages under requirements installed then run the following::
$ git clone https://github.com/TDAbboud/mpkernel.git
$ cd mpkernel
$ make install
You must add micropython to the environments PATH variable:
$ export PATH="<path_to>/micropython/unix:$PATH"
You need to run some setup boilerplate code before you can run any micropython code, see the examples directory::
$ import sys!!
$ sys.path.append('<path_to>/micropython/tools')!!
$ import pyboard!!
$ pyb = pyboard.Pyboard('<tty_device>')!!
The '!!' is how you run commands with the python 3 interpreter in Jupyter/Ipython. Any commands run without '!!' will be sent to the pyboard for processing
mpkernel currently only supports running in the notebook start the notebook server::
$ jupyter notebook
select either micropython-unix or micropython-stmhal from the drop down menu
# Build the docker image
$ make docker-build
# run the docker image
$ make docker-run
run vagrant up
from within this repository to create an mpkernel development
environment, with the latest micropython build
- Fork it!
- Create your feature branch:
git checkout -b my-new-feature
- Commit your changes:
git commit -am "Add some feature"
- Push to the branch:
git push origin my-new-feature
- Submit a pull request :D
The MIT License (MIT)
Copyright (c) 2015 Tony Abboud
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.