ESP32 MicroPython: Getting started with the uPyCraft IDE

The objective of this post is to explain how to get started with uPyCraft, a MicroPython IDE that supports the ESP32.


Introduction

The objective of this post is to explain how to get started with uPyCraft, a MicroPython IDE that supports the ESP32.

An IDE (Integrated Development Environment) is a software that typically integrates a set of tools to make the process of code development easier. On such example is the famous Arduino Development Environment, that is extensively used by the maker community.

The uPyCraft is a very simple IDE for MicroPython development on the ESP32 and the ESP8266. The interface is minimalist and it is pretty straightforward to start working with it, as we will see during this tutorial.

So, our objective for this tutorial is to connect to a board running MicroPython and send a simple “Hello World” command in the environment prompt.

You can find the uPyCraft installation link here. You just need to download and run the executable file. During the installation procedure, it may ask you to install the Monaco font, which is needed for the IDE [1].

Note that upon a successful installation, you may be asked to update the version of the IDE. In my case I installed version 0.20, but then updated to version 0.21.

You can find the GitHub page of the project here, which also has the executable files available. The link for the uPyCraft forum can be found here.

Note that uPyCraft is from DFRobot, the company that makes products such as the ESP32 FireBeetle board, the ESP-WROOM-32 module or the ESP8266 WiFi Bee board.

 

Testing the IDE

After a successful installation of the uPyCraft IDE, just run it. After connecting your board, click on Tools -> Serial and select the COM port of your ESP32 board, as shown in figure 1.

If you don’t know what is the COM port of your ESP32, just go to this menu entry with the board disconnected and check the available ports, then connect the board and go to the menu again. The new entry that appears should correspond to your device.

ESP32 MicroPython IDE select serial port.png

Figure 1 – Selecting the COM port of the ESP32.

Upon selecting this, a popup window like the one shown in figure 2 should appear. In the board dropdown, select ESP32. Assuming that you haven’t flashed the MicroPython firmware to the board before, choose yes on the erase_flash dropdown.

ESP32 uPyCraft IDE erase flash.png

Figure 2 – Burn firmware popup.

Upon clicking the “ok” button, the firmware burn procedure should start. This is accompanied by a window that shows the progress, as illustrated in figure 3.

ESP32 uPyCraft IDE burn firmware.png

Figure 3 – Burning firmware progress.

After the burning procedure is finished, just click on the button highlighted in figure 4 to establish the connection to the board.

Click connect button uPyCraft IDE.png

Figure 4 – Connecting to the board running the MicroPython firmware.

Upon a successful connection, the icon should change to the format indicated in figure 5.

ESP32 uPyCraft IDE connect to board.png

Figure 5 – Successful connection to the ESP32 board.

Note also that at the bottom of the window a command prompt will be available. There, just introduce the python command bellow and hit enter:

print("Hello World from uPyCraft")

After sending the command, you should get an output similar to the one shown in figure 6, where the result of the command execution is printed on the prompt.

ESP32 uPyCraft prompt

Figure 6 – Successful execution of the MicroPython command on the uPyCraft prompt.

To disconnect from the board prompt, just click the same button clicked before for establishing the connection. It should end the connection and the prompt should no longer be available.


Final notes

As can be seen from this tutorial, getting started with the uPyCraft is pretty straightforward.

A very positive aspect is that the IDE takes care of flashing the MicroPython firmware on the ESP32 board for us. Otherwise, we would need to download it and burn it using the esptool. Although as can be seen in this tutorial the procedure is relatively simple, it is much more convenient to have it integrated in the development environment, specially for users that are getting started and don’t feel comfortable yet to use lower level tools such as the esptool.

Other characteristic that can be noted is the simplicity of the procedures and interfaces. In a certain sense, it has a philosophy similar to the Arduino IDE, which allow us to do simple things really fast, without the need to learn how to work with a set of complicated menus.

Nonetheless, since it is a relatively recent software, there is not yet extensive documentation available. Hopefully with time it starts having a better adoption and more support from the community.


References

[1] https://www.gitbook.com/book/dfrobot/upycraft/details

69 Replies to “ESP32 MicroPython: Getting started with the uPyCraft IDE”

  1. Completely worthless tool for my setup. I connect to my ESP32 device, open a file, male changes and save the file. Disconnect from my device, then reconnect to it, open the file again and my changes are not there.

    Tried on multiple files, same. Stick to using ampy on command line, and WebRepl to view what’s happening

    1. Hi!

      Thanks for the feedback.

      Indeed that’s the behavior of the tool. I’m not sure if it is a bug or if it is actually intended to work that way, in the sense that it needs to save a temporary file in the machine before updating.

      You can always open an issue in the GitHub page of the tool, so the developers can explain if it is a bug or an intended behavior and in case it is a bug, try to solve it.

      Personally, I agree that the behavior is not very intuitive indeed, although I already got used to it.

      I use this tool a lot for simple stuff, when I just want to run some script or some commands directly in the prompt.

      Note however that calling a tool “completely worthless” just because it doesn’t fit your setup or has a possible bug (or even multiple bugs) is a bit harsh for the developers that spent their time doing it and making it available for free.

      I would say there are nicer ways of giving constructive feedback regarding the problems of the tool, but this is just my personal opinion 🙂

      Best regards,
      Nuno Santos

      1. I’m sure the tool is good enough for some people, in some situations. My comment was not trashing the software or the developers. As a developer myself, I wouldn’t do that. My comment was purely based on my setup.

        I now believe part of the issue I have is with the socket server I have running on the device.

        1. Nice to hear that 🙂

          And the feedback is always appreciated, this is how we can evolve, so thank you very much for sharing your experience with the tool!

          Regarding the issue, unfortunately I haven’t yet worked much with sockets on MicroPython.

          But please feel free to share more details, maybe I can help with some conceptual suggestion or someone else that comes across the comment may have already faced the same issue and help.

          Best regards,
          Nuno Santos

  2. Completely worthless tool for my setup. I connect to my ESP32 device, open a file, male changes and save the file. Disconnect from my device, then reconnect to it, open the file again and my changes are not there.
    Tried on multiple files, same. Stick to using ampy on command line, and WebRepl to view what’s happening

    1. Hi!
      Thanks for the feedback.
      Indeed that’s the behavior of the tool. I’m not sure if it is a bug or if it is actually intended to work that way, in the sense that it needs to save a temporary file in the machine before updating.
      You can always open an issue in the GitHub page of the tool, so the developers can explain if it is a bug or an intended behavior and in case it is a bug, try to solve it.
      Personally, I agree that the behavior is not very intuitive indeed, although I already got used to it.
      I use this tool a lot for simple stuff, when I just want to run some script or some commands directly in the prompt.
      Note however that calling a tool “completely worthless” just because it doesn’t fit your setup or has a possible bug (or even multiple bugs) is a bit harsh for the developers that spent their time doing it and making it available for free.
      I would say there are nicer ways of giving constructive feedback regarding the problems of the tool, but this is just my personal opinion 🙂
      Best regards,
      Nuno Santos

      1. I’m sure the tool is good enough for some people, in some situations. My comment was not trashing the software or the developers. As a developer myself, I wouldn’t do that. My comment was purely based on my setup.
        I now believe part of the issue I have is with the socket server I have running on the device.

        1. Nice to hear that 🙂
          And the feedback is always appreciated, this is how we can evolve, so thank you very much for sharing your experience with the tool!
          Regarding the issue, unfortunately I haven’t yet worked much with sockets on MicroPython.
          But please feel free to share more details, maybe I can help with some conceptual suggestion or someone else that comes across the comment may have already faced the same issue and help.
          Best regards,
          Nuno Santos

  3. i am facing problem like when i uploaded code to my esp32 it showing proper output but when i disconnected from my pc and providing an external power supply the device is not showing an output.it means the code is not storing in esp32.could you help me to solve regarding this issue.

Leave a Reply