MicroPython workshop – 1

This page gives information on Sensemakers-Amsterdam’s MicroPython Workshop, given by Gijs Mos on Wednesday, November 13, 2019 at the OBA. The workshop will be given in English. You can reserve your seat on meetup.

MicroPython is a Python implementation based on version 3.5 of the language intended to run on small devices like microcontrollers. There are two dialects of MicroPython. The original MicroPython was developed for the Pyboard and has been ported to many other boards and processors, Linux and Windows. Adafruit has developed their own version named CircuitPython, which is kept in sync with major releases of MicroPython. They have added a different model for support of GPIO and peripherals and provide packages to support most of their hardware.

Dialects

In the workshop we will focus on MicroPython. We do most of our work on ESP8266 and ESP32 processors. They are not supported by CircuitPython, while MicroPython runs flawlessly on them. But we have ported CircuitPython to a Sodaq Sara board. If many of you are interested in CircuitPython we could consider a follow-up workshop.

But for now MicroPython it is.

Not a Python course

The workshop is about installing, running, using the Python3 language on microcontrollers. It is not a Python language course. Fortunately the learning curve for Python is not steep at all. If you have some experience in C, C++, Arduino-C, Java, JavaScript, Pascal or the like, you should be able to follow the examples. And there are many excellent (free) learning sources on the Internet. If you are new to Python or need to refresh, please have a look at LearnPython.org and work through the Learn the Basics section. And if you like to learn from video, check out the brand new Microsoft course on Python. It also shows you to set up the vscode editor for Python.

Reference board – where to buy one

Sensemakers Amsterdam has selected a cheap ESP8266 board for MicroPython and Arduino tinkering, workshops and courses. For the specifications and sources on Aliexpress please be referred to the SMA8266A board page in our MicroPython Wiki. In there are also links to two sources on Aliexpress. Make sure you also order the optional DHT11 sensor (or get the better DHT22 on a pin-compatible daughter- board). Also secure an USB mini to A cable.

For the workshop you will need a board. Sensemakers only owns a couple, so if you do not want to team-up with others sharing Sensemakers few boards, better get one yourself. It costs between €15,00 and €17.50 . If you don’t know how to buy on Aliexpress in China, Ted van der Togt will organize a bulk order. If you join this initiative, your board will be waiting for you on the workshop on November. If you want to participate please contact Ted or Manon via meetup , or using our contact page. Please do this before October 22nd! We need to allow at least 2 weeks for shipping and customs.

It is not possible to order boards from China anymore. But we do have some extra. So If you need one, contact Manon or Ted.

You could also bring your own device. Any ESP32 or ESP8266 based board with 4M flash or up and USB-serial connection will do. As will many other supported microcontrollers. However, there are subtle differences between versions. And we may or may not have time during the workshop to overcome these. So an ESP8266 with a DHT11 or DHT22 attached will be the board of choice.

Pre-install software on your laptop

To program your board you will need a laptop. At the workshop we will have 15 laptops available from the OBA. But we may need more. So best bring your Laptop. The tools on the Laptop are supported for Macintosh, Windows 10 (for some things you will need the WSL with a Linuc installed on Windows) and Linux.

The Laptop needs to log on to the local Sensemakers WiFi, so make sure you have the administrative rights to do so (may be blocked on company laptops).

You will need the following software:

  • A suitable editor, preferably with Python syntax highlighting and indentation support. VS-code, Notepad++, Atom etc will do nicely. Do not forget to install the Python language add-ins in the editor.
  • Python3. Version 3.5 or up. Both the 32-bit or the 64-bit versions are fine. You can install it globally, for a single user, or in a virtual environment, whatever you like best. Make sure to get a version that includes pip.
  • Rshell. Version 0.0.26 or up. Install with: pip install rshell
  • Esptool. Version 2.7 or up. Install with: pip install esptool.
  • If possible we will install the toolchain to compile your own Micropython. Or you get a binary from us.

Don’t worry if you get stuck. Just bring your laptop and we’ll help to get the things set-up on the workshop.