Compiled binary of micropython

All ESP32 boards running MicroPython.
Target audience: MicroPython users with an ESP32 board.
Post Reply
sujoymisc@gmail.com
Posts: 4
Joined: Sat Sep 21, 2019 4:33 pm

Compiled binary of micropython

Post by sujoymisc@gmail.com » Mon Jul 26, 2021 5:49 pm

How to compile the micropython .py file into a binary file and later import it to main.py?

User avatar
OlivierLenoir
Posts: 126
Joined: Fri Dec 13, 2019 7:10 pm
Location: Picardie, FR

Re: Compiled binary of micropython

Post by OlivierLenoir » Tue Jul 27, 2021 5:30 am

Look for mpy-cross, documentation is available here

sujoymisc@gmail.com
Posts: 4
Joined: Sat Sep 21, 2019 4:33 pm

Re: Compiled binary of micropython

Post by sujoymisc@gmail.com » Fri Aug 06, 2021 3:33 pm

Thanks for the solution, I have created .mpy file in host computer, how to copy it to ESP32 board? Thonny only supports .py file to upload.

JennaSys
Posts: 33
Joined: Tue Jul 15, 2014 8:29 am
Location: Southern California, US
Contact:

Re: Compiled binary of micropython

Post by JennaSys » Fri Aug 06, 2021 9:52 pm

I've copied files other than .py with Thonny before. Using the file panel on the left, right-click the file you want to copy on the local drive at the top of the panel then and select Upload to / (or whatever the cwd of the device is).

Alternatively you can use WebREPL or the new mpremote CLI tool:

Code: Select all

mpremote cp myfile.mpy :
John Sheehan

sujoymisc@gmail.com
Posts: 4
Joined: Sat Sep 21, 2019 4:33 pm

Re: Compiled binary of micropython

Post by sujoymisc@gmail.com » Sat Aug 07, 2021 4:12 am

how to add esp32 board micropython custom function with the micropython firmware (.bin)? How can we build custom micropython firmware?


Post Reply