mpremote configuration

Discussion about programs, libraries and tools that work with MicroPython. Mostly these are provided by a third party.
Target audience: All users and developers of MicroPython.
Post Reply
User avatar
andypiper
Posts: 25
Joined: Wed Feb 02, 2022 12:17 pm
Location: Kingston upon Thames, UK
Contact:

mpremote configuration

Post by andypiper » Sun Apr 24, 2022 1:56 pm

I'm trying to get myself more familiar with mpremote :)

On my Macs, the "first" serial port that shows up is Bluetooth, e.g.

Code: Select all

/dev/cu.Bluetooth-Incoming-Port None 0000:0000 None None
/dev/cu.UM34C None 0000:0000 None None
/dev/cu.usbmodem11101 df618c17a781282c 2e8a:0005 MicroPython Board in FS mode
(turning off BT does not cause that device to disappear)

Is there a way to tell mpremote (via the config file?) what the "default" / "fallback" port should be, so that I can do something like mpremote repl without having to specify a port?

Additionally, is there a way to specify help text for aliases set in the config file? I see the commands themselves are pulled in to the output from mpremote --help but it could be useful to define descriptive text to be shown there as well.

:arrow: general plea for more educational material on the use of mpremote...

User avatar
andypiper
Posts: 25
Joined: Wed Feb 02, 2022 12:17 pm
Location: Kingston upon Thames, UK
Contact:

Re: mpremote configuration

Post by andypiper » Mon Apr 25, 2022 11:24 am

... my goldfish brain now rediscovered that we've actually discussed this same issue on GitHub...

User avatar
dhylands
Posts: 3821
Joined: Mon Jan 06, 2014 6:08 pm
Location: Peachland, BC, Canada
Contact:

Re: mpremote configuration

Post by dhylands » Mon Apr 25, 2022 5:46 pm

If you want something in the meantime, I wrote a little python script called find_port.py, which you can find here: https://github.com/dhylands/dotfiles/bl ... nd_port.py

If you wrap your call to mpremote up in a bash script you can use find_port.py to find your serial port. Use something like

Code: Select all

$(find_port.py --vid 2e8a)
in your bash script where you want the port filled in.

Post Reply