Are you (re)starting Pd when this happens? I remember, a long time ago, I had a start script for Pd and MIDI connections which relied on sleeping a couple seconds after starting Pd otherwise the MIDI ports don't appear to ALSA when calling connect after,

On Nov 3, 2024, at 6:09 PM, pd-list-request@lists.iem.at wrote:

Message: 1
Date: Sat, 2 Nov 2024 11:49:45 +0100
From: Alberto Novello <albynovello@gmail.com>
Subject: [PD] Re: Problems reconnecting MIDI device on RPi
To: IOhannes m zmölnig <zmoelnig@iem.at>
Cc: pd-list@lists.iem.at
Message-ID:
<CAP9RyhP3URNXaiKwkynSEH6JuPuMQgOKEF5v7HkQs6bDQTFxxw@mail.gmail.com>
Content-Type: multipart/related;
boundary="0000000000000e4f840625ebd0c3"

Hi thanks for your answer Iohannes!! I tried but could not find a way. I
attach my terminal attempts that report the error. I got better at the end
but still cannot see Pure Data for some reason. What could it be?

--------
Dan Wilcox
danomatika.com
robotcowboy.com