Skip to content

Bharat-Pi/MicroPython

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

75 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Downloading & Installing the uPyCraft IDE – for Windows PC Instructions

There are different firmwares that you can use to program the ESP32 boards. If you want to program the ESP32 board using the MicroPython firmware, we recommend using uPyCraft IDE/Thonny IDE. uPyCraft IDE runs in any major operating system. here we’ll show you how to install the uPyCraft IDE for MicroPython on a Windows PC.

Before installing uPyCraft IDE, make sure you have the latest version of Python installed in your computer. If you don’t, follow the next instructions to install Python.

you can buy Bharat Pi boards on Bharat pi website --> https://bharatpi.net/shop/ , AND on Amazon website.

Installing Python – Windows PC

  1. Go to the Python Downloads page: www.python.org/downloads and download the installation file.

    Screenshot (2)

  2. After a few seconds, you should have a file called python-3.12.1.exe file in your computer. Double-click the file to open it.

  3. Enable the option at the bottom "Add Python 3.12 to PATH". Then, press the “Install Now” button.

  4. Wait a few seconds while the software completes the installation process....

  5. When it’s done, you should see the message "Setup was successful" then you can close that window.

Installing uPyCraft IDE – Windows PC

As mentioned before,we’ll be using uPyCraft IDE to program the ESP32 or ESP8266 boards using the MicroPython firmware. In our opinion, uPyCraft IDE is the easiest way of programming ESP based boards with MicroPython at the moment.

  1. To download uPyCraft IDE for Windows go to this link https://randomnerdtutorials.com/uPyCraftWindows.

  2. After a few seconds you should see a similar file (uPyCraft_V1.exe) in your Downloads folder Double-click that file.

  3. A new window opens with the uPyCraft IDE software, We’ll be using this software to flash our ESP based boards with MicroPython firmware as well as to program the boards.

    Screenshot (3)

Flash/Upload MicroPython Firmware to ESP32

With uPyCraft IDE installed in your computer, you can easily flash your ESP32 boards with the MicroPython firmware.

Downloading the MicroPython Firmware

  1. To download the latest version of MicroPython firmware for the ESP32, go to the MicroPython Downloads page https://micropython.org/download/ and scroll all the way down to the ESP32 section select ESP32/WROOM

    Screenshot (4)

  2. Download the ESP32.bin file – for example: esp32-20181007-v1.9.4-631-g338635ccc.bin.

    Screenshot (5)

Selecting Serial Port in uPyCraft IDE

Go to Tools > Serial and select your ESP32 COM port.

Screenshot (6)

Important: if you plug your ESP32 board to your computer, but you can’t find the ESP32 Port available in your uPyCraft IDE, it might be one of these two problems: 1. USB drivers missing OR 2. USB cable without data wires.

USB drivers for our boards

-->goto this link and dowload the drivers from here for our BharatPi boards-> https://wch-ic.com/downloads/CH341SER_ZIP.html

  1. If you don’t see your ESP’s COM port available: --> This means you don’t have the USB drivers installed. Take a closer look at the chip next to the voltage regulator on board and check its name. --> after checking the name Go to Google and search for your specific chip to find the drivers and install them in your operating system. --> After they are installed, restart the uPyCraft IDE and you should see the COM port in the Tools menu.

  2. If you have the drivers installed, but you can’t see your device, double-check that you’re using a USB cable with data wires: USB cables from powerbanks often don’t have data wires (they are charge only). So, your computer will never establish a serial communication with your ESP32. Using a proper USB cable should solve your problem.

Selecting the Board in uPyCraft IDE

Go to Tools > Board > so make sure you select the "esp32" option:

Screenshot (7)

  1. Finally, go to Tools > BurnFirmware menu to flash your ESP32 with MicroPython.

    Screenshot (8)

  2. Select all these options to flash the ESP32 board: --> board: esp32 --> burn_addr: 0x1000 --> erase_flash: yes --> com: COMX (in our case it’s COM4) --> Firmware: Select "Users" and choose the ESP32 .bin file downloads After pressing the "Choose" button, navigate to your Downloads folder and select the ESP32.binfile.

    Screenshot (9)

  3. Having all the settings selected, hold-down the "BOOT/FLASH" button in your ESP32 board.

  4. While holding down the "BOOT/FLASH", click the "ok" button in the burn firmware window.

  5. When the "EraseFlash" process begins, you can release the "BOOT/FLASH" button. After a few seconds, the firmware will be flashed into your ESP32 board.

    Screenshot (11)

Note: if the "EraseFlash" bar doesn’t move and you see an error message saying "erase false/update false", it means that your ESP32 wasn’t in flashing mode. You need to repeat all the steps described earlier and hold the "BOOT/FLASH" button again to ensure that your ESP32 goes into flashing mode.

Screenshot (10)

NOTE:if you are not able to download the PyCraft IDE(it will not support for some windows) we have alternative for that i.e Thonny IDE

THONNY IDE

Downloading & Installing the Thonny IDE – for Windows PC Instructions

If you want to program your BharathPi ESP32 board with MicroPython firmware, it’s very handy to use an IDE in this guide, we’ll introduce you to Thonny IDE. We’ve experimented with several IDEs to program the ESP32 boards using MicroPython, and Thonny seemed a good choice. Although there are some bugs, it is constantly being updated and improved. It allows you to program your ESP32 boards with MicroPython, and it is compatible with Windows, Mac and Linux.

you can buy Bharat Pi boards on Bharat pi website --> https://bharatpi.net/shop/ , AND also on Amazon website.

What is MicroPython?

MicroPython is a Python 3 programming language re-implementation targeted for microcontrollers and embedded systems. MicroPython is very similar to regular Python The most significant difference between Python and MicroPython is that MicroPython was designed to work under constrained conditions. Because of that, MicroPython does not come with the entire pack of standard libraries and few exceptions. It only includes a small subset of the Python standard libraries, but it includes modules to easily control and interact with the GPIOs, use Wi-Fi, and other communication protocols.

Installing Thonny IDE :-

To install Thonny on your Windows PC, follow the next instructions:

  1. Go to https://thonny.org

Screenshot (41)

  1. Download the latest version for Windows and wait a few seconds while it downloads.

  2. Run the .exe file.

  3. Follow the installation wizard to complete the installation process. You just need to click on Next.

  4. After completing the installation open Thonny IDE a page should open like below shown.

Screenshot (53)

How to Flash MicroPython firmware:-

MicroPython isn’t flashed into the ESP32 boards by default. The first thing you need to do is to start programming your boards with MicroPython flash/upload/burn the firmware.

There are different ways in which you can do that: Thonny IDE comes with a tool that allows you to quickly install MicroPython firmware on your board.

Downloading MicroPython Firmware :-

  1. To download the latest version of MicroPython firmware for the ESP32, go to the MicroPython Downloads page https://micropython.org/download/ and scroll all the way down to the ESP32 section.
  2. Select the type of board you’re using select ESP32/WROOM.

Screenshot (39)

You should see a similar web page (see figure below) with links to download .bin files. Download the latest release.

Screenshot (40)

The downloaded file will go to the Downloads folder, Continue reading to learn how to flash the firmware on your boards.

Flashing MicroPython Firmware using Thonny IDE :-

In this section you’ll learn how to flash MicroPython firmware on your boards using Thonny IDE, Follow the next steps:

  1. Connect your BharatPi ESP32 board to your computer.

  2. Open Thonny IDE, Go to Tools -> Options -> Interpreter.

  3. Select the interpreter you want to use accordingly to the board you’re using and select the COM port your board is connected to and Finally, click on the link Install or update firmware.

Screenshot (54)

  1. Select the port once again, select the options as shown in the picture below and finally click on Install.After a few seconds, the installation should be completed. (OR) You can click on the Browse button to open the ".bin" file with the firmware you’ve downloaded in the previous step you can browse the downloaded firmware directly no need of installing firmware in thonny ide if you browse it from your downloads.

Screenshot (55)

(OR) You can do this steps using -> configure interpreter in the bottom of the thonny ide screen as shown in the image below.

Screenshot (47)

Testing the Installation :-

Important: before testing the installation, your ESP32 board needs to be flashed with MicroPython firmware (see the above steps for flashing).

Connect the board to your computer using a USB cable. To test the installation, you need to tell Thonny IDE that you want to run MicroPython Interpreter and select the board you are using.

  1. Go to Tools > Options and select the Interpreter tab. Make sure you’ve selected the right interpreter for your board as well as the COM port. You can also select the "Try to detect automatically" option, but only if you just have one board connected to your computer at a time. Otherwise, select the specific port for the board you’re using.
  2. Thonny IDE should now be connected to your board and you should see the prompt on the Shell.
  3. Type the command help() in the Shell and see if it responds back. If it responded back, everything is working fine. Now, you can send a few more commands to test.

Screenshot (52)

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages