How do upload code to the board with Thonny

General discussions and questions abound development of code with MicroPython that is not hardware specific.
Target audience: MicroPython Users.
Post Reply
MangoDelight
Posts: 3
Joined: Tue Mar 08, 2022 8:41 am

How do upload code to the board with Thonny

Post by MangoDelight » Tue Mar 08, 2022 8:50 am

Hi everyone. I am new to MicroPython. I have been using Arduino for awhile, and I know how to upload sketches to the board.

I have no idea how to upload code to my ESP8266 based board. I have installed the updated firmware, and that went fine. When I log in with a serial terminal I get the >>> prompt. It seems to work fine, but I want to use Thonny and start developing some ideas for my watering system for my large veggie garden. I know you upload a boot.py and a main.py, can someone point me to a guide where this process is explained, as I dont really want to type in walls of text into the >>>> prompt. I am really looking forward to what MicroPython can do. :)

Thanks.

OutoftheBOTS_
Posts: 847
Joined: Mon Nov 20, 2017 10:18 am

Re: How do upload code to the board with Thonny

Post by OutoftheBOTS_ » Tue Mar 08, 2022 8:49 pm

If the board is plugged in when thornny starts up then it usually detects the board and will switch to using the python interrupter on the board. If it doesn't detect then go to tools>Options>interrupter and select the board your using.

MangoDelight
Posts: 3
Joined: Tue Mar 08, 2022 8:41 am

Re: How do upload code to the board with Thonny

Post by MangoDelight » Wed Mar 09, 2022 1:34 am

Thank you for your answer. I am very impressed by how MicroPython works with these dev boards. I have been using Arduino for some time, and I do understand how the bootloader writes to the onboard flash. I would like to know what these MicroPython dev boards do for saving your code to the device. This is the device is now standalone powered up but no computer attached to it, After is got code uploaded to it.?

Thanks

OutoftheBOTS_
Posts: 847
Joined: Mon Nov 20, 2017 10:18 am

Re: How do upload code to the board with Thonny

Post by OutoftheBOTS_ » Wed Mar 09, 2022 9:14 am

So ardunio has a eprom library that allows you to store data to the flash of the MCU. With micropython the remaining flash left after the firmware is uploaded is formatted to a fat32 or spiffs format for storage of your python scripts or any other data you want to write to the flash

gleria
Posts: 3
Joined: Fri Apr 09, 2021 1:28 pm

Re: How do upload code to the board with Thonny

Post by gleria » Wed Mar 16, 2022 12:14 pm

Thanks for this interesting information!

User avatar
ebolisa
Posts: 55
Joined: Thu Feb 21, 2019 11:43 am
Location: Madrid, Spain

Re: How do upload code to the board with Thonny

Post by ebolisa » Mon Apr 04, 2022 5:39 pm

OutoftheBOTS_ wrote:
Wed Mar 09, 2022 9:14 am
So ardunio has a eprom library that allows you to store data to the flash of the MCU. With micropython the remaining flash left after the firmware is uploaded is formatted to a fat32 or spiffs format for storage of your python scripts or any other data you want to write to the flash
See viewtopic.php?t=7820&p=44645

User avatar
karfas
Posts: 193
Joined: Sat Jan 16, 2021 12:53 pm
Location: Vienna, Austria

Re: How do upload code to the board with Thonny

Post by karfas » Mon Apr 04, 2022 6:19 pm

I don't think there is support for the SPIFFS file system in micropython.
The supported filesystems are FAT and LittleFS (see https://github.com/littlefs-project/littlefs)
A few hours of debugging might save you from minutes of reading the documentation! :D
My repositories: https://github.com/karfas

Post Reply