emlearn-micropython icon indicating copy to clipboard operation
emlearn-micropython copied to clipboard

More convenient install

Open jonnor opened this issue 1 year ago • 4 comments

Install currently have several steps

  • Identify correctly which architecture the board has
  • Download release archive from Github
  • Unzip release archive
  • Copy module files for correct architecture to device

While this is not particularly difficult, there is room for improvements.

jonnor avatar Dec 10 '23 07:12 jonnor

The ideal solution would be to be able to run mpremote mip install emltrees, and that this would automatically handle each step. However, mip support for native module does not seem to be actively worked on.

jonnor avatar Dec 10 '23 07:12 jonnor

A slight improvement would be if one could use mpremote cp to download directly from an URL. mpremote cp https://github.io/emlearn/emlearn-micropython/releases/$version/$arch/emltrees.py :

This would also be useful for model files (.csv), and similar cases that need some data into the device. This could be done by implementing HTTP(S) support in fs_put of https://github.com/micropython/micropython/blob/master/tools/mpremote/mpremote/transport_serial.py

We would also need to publish built files to a web server. For example using Github Actions to push to Github Pages.

jonnor avatar Dec 10 '23 07:12 jonnor

MR with support for HTTP download for mpremote is now here, https://github.com/micropython/micropython/pull/13292

jonnor avatar Dec 28 '23 20:12 jonnor

We are now pushing build binaries to Github pages. So documentation needs to be updated to reflect this

jonnor avatar May 24 '24 20:05 jonnor

The .mpy modules can be installed from http with "mip install", both on PC (Unix port) and on device (using mpremote). The examples show this now.

But even better, the emlearn package and the examples can now be installed with a one-click workflow using Viper IDE. Thanks to @vshymanskyy !!

Here is an example:

Run using ViperIDE

The complete examples all have such options now. So installation is now as convenient as it can possibly be!

jonnor avatar Oct 21 '24 22:10 jonnor