Updating a MicroPython Firmware

C programming, build, interpreter/VM.
Target audience: MicroPython Developers.
Firas_Baccouri
Posts: 35
Joined: Wed Apr 27, 2022 7:22 am

Updating a MicroPython Firmware

Post by Firas_Baccouri » Wed May 25, 2022 9:24 am

Hello,
I am working with MicroPython for almost one month now , and now I want to do something to update the MicroPython firmware , I mean for example after a period of time of developing the firmware on a customer board you want to update it so your customer don´t need to give you back the board to upload the new MicroPython fimware , So I am looking on how can I do this update , Do I need another python or C firmware to do that or should I use some software , I don´t have any idea about how it could be done .
Any help will be appreciated .

Thank you in advance .

davef
Posts: 811
Joined: Thu Apr 30, 2020 1:03 am
Location: Christchurch, NZ

Re: Updating a MicroPython Firmware

Post by davef » Wed May 25, 2022 11:09 am


Firas_Baccouri
Posts: 35
Joined: Wed Apr 27, 2022 7:22 am

Re: Updating a MicroPython Firmware

Post by Firas_Baccouri » Fri Jul 29, 2022 7:51 am

davef wrote:
Wed May 25, 2022 11:09 am
Which board?
Portenta H7

davef
Posts: 811
Joined: Thu Apr 30, 2020 1:03 am
Location: Christchurch, NZ

Re: Updating a MicroPython Firmware

Post by davef » Fri Jul 29, 2022 8:12 am

Do you want to upload new firmware to a device over the internet? Way beyond my experience.

p_j
Posts: 102
Joined: Mon Aug 23, 2021 1:08 pm
Location: Sydney

Re: Updating a MicroPython Firmware

Post by p_j » Fri Jul 29, 2022 11:30 am

This is a great library for updating code over wifi.

https://github.com/mkomon/uota

Firas_Baccouri
Posts: 35
Joined: Wed Apr 27, 2022 7:22 am

Re: Updating a MicroPython Firmware

Post by Firas_Baccouri » Tue Aug 02, 2022 9:04 am

davef wrote:
Fri Jul 29, 2022 8:12 am
Do you want to upload new firmware to a device over the internet? Way beyond my experience.
Yes I want to update the firmware using the OTA provided by Portenta H7

Firas_Baccouri
Posts: 35
Joined: Wed Apr 27, 2022 7:22 am

Re: Updating a MicroPython Firmware

Post by Firas_Baccouri » Tue Aug 02, 2022 2:21 pm

p_j wrote:
Fri Jul 29, 2022 11:30 am
This is a great library for updating code over wifi.

https://github.com/mkomon/uota
Thank you for your reply , I have checked the github repo you send and it seems a great solution , but do you have any information about how can I put my firmware on a http or https server because I am newbie with this stuff and I´ve never dealt with something similar .

Thankyou.

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

Re: Updating a MicroPython Firmware

Post by karfas » Tue Aug 02, 2022 2:40 pm

Firas_Baccouri wrote:
Tue Aug 02, 2022 2:21 pm
do you have any information about how can I put my firmware on a http or https server
In my opinion way out of scope for the micropython forum.
I'm sure there are great tutorials all over the net how to configure a web server like apache, nginx or (shudder) IIS.
A few hours of debugging might save you from minutes of reading the documentation! :D
My repositories: https://github.com/karfas

p_j
Posts: 102
Joined: Mon Aug 23, 2021 1:08 pm
Location: Sydney

Re: Updating a MicroPython Firmware

Post by p_j » Tue Aug 02, 2022 2:42 pm

Firas_Baccouri wrote:
Tue Aug 02, 2022 2:21 pm
p_j wrote:
Fri Jul 29, 2022 11:30 am
This is a great library for updating code over wifi.

https://github.com/mkomon/uota
Thank you for your reply , I have checked the github repo you send and it seems a great solution , but do you have any information about how can I put my firmware on a http or https server because I am newbie with this stuff and I´ve never dealt with something similar .

Thankyou.
Do you have your own server that you can use? Are you developing on a windows or linux machine?

There are a few different ways to do it, I use a bash script that creates a tar.gz file and uploads it to my server. Here is the script I'm using for your reference.

Code: Select all

#!/bin/bash
tar --exclude='.gitignore' --exclude='Pipfile' --exclude='archive' --exclude='uota.cfg' --exclude='updates' --exclude='logs' --exclude='db' --exclude='deploy' -czf updates/firmware.tar.gz *
scp updates/firmware.tar.gz root@iot.xxxxx.com.au:/home/iot/ftp/firmware/testing/
scp latest root@iot.xxxxxxx.com.au:/home/iot/ftp/firmware/testing/

Firas_Baccouri
Posts: 35
Joined: Wed Apr 27, 2022 7:22 am

Re: Updating a MicroPython Firmware

Post by Firas_Baccouri » Wed Aug 03, 2022 6:44 am

p_j wrote:
Tue Aug 02, 2022 2:42 pm

Do you have your own server that you can use? Are you developing on a windows or linux machine?
I am developing on Windows , and I don´t have my own server .

Post Reply