Thonny IDE How To Guides - Featured Image

Posted on

by

in

How to guides in Thonny IDE using MicroPython

Introduction

This post is a collection of my Thonny IDE how-to guides when working with MicroPython. I will continually update this post for different scenarios or issues that I have encountered when working with this awesome Thonny IDE.

I have written a quick start guide on how to use Thonny IDE in MicroPython if you want a more structured tutorial.

Related Content:
MicroPython Development Using Thonny IDE

Thonny How to Guides:

How to download Thonny IDE?

Go to this URL and download the Thonny installer that is appropriate for your operating system.

How to set the MicroPython interpreter in Thonny IDE?

Click Run then Configure Interpreter

Thonny Run Configure Interpreter

Select the appropriate interpreter for your MicroPython device.

Thonny IDE Options Intepreter Tab

How to connect/re-connect with your MicroPython device in Thonny IDE?

Click the Stop/Restart backend or Ctrl + F2 at the top menu.

Thonny Stop Restart Backend

How to interrupt running MicroPython script in Thonny IDE?

Click the Run menu and then click the Interrupt Execution.

Thonny Interrupt Execution

Thonny IDE: The device is busy or does not respond

Click the interrupt execution button.

How to install MicroPython libraries or packages in Thonny IDE?

First, make sure that your MicroPython Device is connected and detected by Thonny IDE. Please check the above guide if you don’t know how to do this.

Next, interrupt the running MicroPython script. Please check the above guide if you don’t know how to do this.

Click on Tools – Manage Packages

Thonny Tools Manage Package

Search for the package that you want to install. In my case, I am looking for uTemplate and then clicking the Search on PyPi button.

When the Search Result comes back then click the package that you want to install.

Thonny Search for Package

Click the Install button and when a pop-up comes just click yes.

Thonny Install Package or Library

Your library should be installed in the lib folder of your MicroPython device

Thonny MicroPython Device Library Folder

How to uninstall MicroPython libraries/packages in Thonny IDE?

First, make sure that your MicroPython Device is connected and detected by Thonny IDE. Please check the above guide if you don’t know how to do this.

Next, interrupt the running MicroPython script. Please check the above guide if you don’t know how to do this.

Click on Tools then Manage Packages.

Thonny Tools Manage Package

Select the library or package you want to uninstall. Click the Uninstall button afterwards.

Thonny Uninstall Library

This should delete the library or package in the lib folder of your MicroPython device.

How to upload files to your MicroPython Device using Thonny IDE?

First, interrupt the currently running script in your MicroPython device. Refer to the guide above on how to perform this interrupt if you are not sure.

In your Files Explorer, select all the files that you want to upload and then right-click then select Upload to / submenu.

Thonny Upload to Device

This will upload the files to your MicroPython device.

Thonny - MicroPython Device

How to format code in Thonny IDE?

Install the latest Thonny IDE that is applicable to your operating system. Your Thonny IDE should have a version that is greater than 4.0.

Thonny Manage Plugins

In the search field, type in “thonny-black-formatter” then click it, and then click the Install button.

Thonny Plugin thonny-black-formatter

When you want to format a Python code go to Tools then Format with Black.

Thonny Format with black

How to run multiple windows or instances of Thonny IDE?

By default, Thonny IDE is configured to run only one instance or window of the application. If you need to run multiple instances or windows of the application then you can follow my post about How do you run Thonny IDE with multiple windows or instances?

Support Me!

I love sharing what I know and hopefully, I was able to help you. Writing helpful content takes so much time and research. If you think you like my work and I have managed to help you then please consider supporting my channel. I would be very grateful and would boost my confidence that what I am doing is making a big change in the world. (No Pun Intended!) 😉

Become a Patron!
If you like my post then please consider sharing this. Thanks!

13 responses to “How to guides in Thonny IDE using MicroPython”

  1. How to interface DHT11 with MicroPython? – donskytech.com

    […] First, we need to install the utemplate library or package into our MicroPython device using Thonny IDE. If you do not know how this is done then please refer to my separate post. […]

  2. Control DS18B20 using MicroPython with a Weather Station Project

    […] Next, install the uTemplate library on your MicroPython device. If you are unsure how this is done then you can follow my How to install MicroPython libraries or packages in Thonny IDE? […]

  3. How to Install MicroPython firmware on Raspberry Pi Pico?

    […] Related Content: MicroPython Development Using Thonny IDEHow to guides in Thonny IDE using MicroPython […]

  4. MicroPython: Interfacing with SSD1306 OLED display

    […] Related Content: How to install MicroPython libraries or packages in Thonny IDE? […]

  5. Raspberry Pi Pico W: BME280 Weather Station Dashboard

    […] Install the two libraries using Thonny IDE and if you are not familiar with how this is done then you can see the following How to install MicroPython libraries or packages in Thonny IDE? […]

  6. Pico W – MicroPython MQTT tutorial using umqtt.simple library

    […] Related Content: MicroPython Development Using Thonny IDEHow to guides in Thonny IDE using MicroPython […]

  7. Control RGB LED using MicroPython – donskytech.com

    […] Once downloaded then open the project in Thonny IDE. Upload all the files to the file system of your MicroPython device. If you are not sure how this is done then you can follow the How to upload files to your MicroPython Device using Thonny IDE? […]

  8. MicroDot/MicroPython – Handling dynamic content

    […] Related Content: MicroPython Development Using Thonny IDEHow to guides in Thonny IDE using MicroPython […]

  9. MicroPython – Read LDR or Photoresistor – donskytech.com

    […] Upload the project files to your MicroPython device using the Thonny IDE. If you do not know how this is done then you can follow this. […]

  10. Using WebSocket in MicroPython – A Practical Example

    […] Related Content: MicroPython Development Using Thonny IDEHow to guides in Thonny IDE using MicroPython […]

  11. Raspberry Pi Pico W – Web Server to control components

    […] If you want to run this project then you first need to install the template library in your Raspberry Pi Pico W. If you are unsure how this is done then follow this How to install MicroPython libraries or packages in Thonny IDE? […]

  12. Exploring ESP-NOW with MicroPython and WiFi – donskytech.com

    […] To test out this project we need to upload it to our ESP32/ESP8266 device. You can follow the following How to upload files to your MicroPython Device using Thonny IDE? […]

  13. How to guides in Thonny IDE using MicroPython – donskytech.com – voorheen fredzelders.nl

    […] ~ How to guides in Thonny IDE using MicroPython – donskytech.com: […]

Leave a Reply

Your email address will not be published. Required fields are marked *