Pymakr is a plugin developed by Pycom, and is useful when programming and compiling your codes using micropython. The Pymakr plugin that works great with the two popular text editors, Atom and Visual Studio. In this guide we will use the Atom editor with the Pymakr plugin to compile a ESP32 board. Please note that this guide uses the ESP32 only as an example and can be easily adapted to any device working with Micropython and the Pymakr plugin.
IMPORTANT NOTE: At the time of this articles publication the Visual Studio Text Editor was experiencing errors when uploading code onto a device. This is being fixed as time allows. You can follow-along with the progress here.
- Installation and setup of Atom with the Pymakr plugin
- Synchronize and uploading code
- Managing Micropython libraries
1. Installation and setup of Atom with the Pymakr plugin
1. To get started download and install the Atom Editor
2. Once the installation is completed, launch the Atom editor
3. Connect the board to your PC using a USB cable
4. Next, follow this step-by-step to activate the Pymakr plugin and connect your device to the Pymkr in the Atom editor
Once the board is connected you will see the message "connected" in the status:
2. Synchronize and uploading code
1. Create a new folder in your PC to manage the codes and libraries you will be working with. For simplicity our folder is titled "ESP32" but yours should be titled as you see fit.
2. Once the new folder is created, go to Atom editor, select File > Open folder..., and search for the directory "ESP32," (just created) and open it.
3. Next, create a “boot.py” file to contain the setup lines within your new folder. Right-click the "ESP32" folder and select "New File" and assign the name "boot.py" as the file name.
4. Repeat this step 3 above to create the “main.py” file titled "main.py". This file will handle the logic of your code.
5. Now synchronize the project to upload the files to the device. In the upper toolbar, select Packages > Pymakr > Synchronize project.
3. Managing Micropython libraries
1. To install the libraries that will be used, first, you must create a new folder to store the libraries. Right click on the folder "ESP32" and select "New folder", and assign "lib" as name.
2. Now, we have to add the libraries into the "lib" folder. Right click on the folder "lib" and select "New Folder" and assign a name as you desire, Our example uses the title: "umqtt".
3. Now we need to synchronize the project. In the upper toolbar, select Packages > Pymakr > Synchronize project.
4. After completing Step 3, your board is ready to be programmed to receive and send data.
To complete your device's on-boarding and integration with Ubidots, check out the below integration article to send or receive data to/from Ubidots cloud.
Other readers have found useful...