#openbsd

27 posts
michael
@michael
Public en edited
Before: photo of ThinkPad with "linux inside" sticker
Before: photo of ThinkPad with "linux inside" sticker
After: photo of ThinkPad with OpenBSD, Raspberry Pi and Python stickers
After: photo of ThinkPad with OpenBSD, Raspberry Pi and Python stickers

Using mpremote with Raspberry Pi Pico, OpenBSD edition

The mpremote command line tool provides an integrated set of utilities to remotely interact with, manage the filesystem on, and automate a MicroPython device over a serial connection.

On my laptop, the USB serial device is found at /dev/ttyU0. Make sure that you're member of the dialer group before proceeding.

Start by installing python3 and pip3:

$ doas pkg_add python-3.14.9 py3-pip

Create virtual environment and activate it:

$ python3 -m venv .venv
$ . .venv/bin/activate

Update pip3 and install mpremote

(.venv) $ pip3 install --upgrade pip
(.venv) $ pip3 install mpremote

The device path on OpenBSD isn't among the pre-defined shortcuts. To make connections easier to establish, create a config file for mpremote similar to this:

(.venv) $ cat ~/.config/mpremote/config.py                                                                  
commands = {
    "pico": "connect /dev/ttyU0"
}

Run a demo script on the device:

(.venv) $ mpremote pico exec "import hello" 
Hello from MicroPython

#MicroPython #mpremote #RaspberryPiPico #OpenBSD

https://ifx-micropython.readthedocs.io/en/latest/reference/mpremote.html

Load older posts