Networking - probonopd/MiniDexed GitHub Wiki
The continuous builds of MiniDexed have experimental networking support.
The optional MiniDexed Service Utility for PC provides a convenient way to use the networking features (including syslog server, updating,...).
Ethernet and WLAN support
Circle, which MiniDexed is based on, has networking support for the following Raspberry Pi models:
| Model | Ethernet | WLAN |
|---|---|---|
| Raspberry Pi Zero 2 W | ❌ | ✔ (2.4GHz only) |
| Raspberry Pi 2 Model B | ✔ | ❌ |
| Raspberry Pi 3 Model A+ | ❌ | ✔ (2.4 and 5GHz) |
| Raspberry Pi 3 Model B | ✔ | ✔ (2.4GHz only) |
| Raspberry Pi 3 Model B+ | ✔ | ✔ (2.4 and 5GHz) |
| Raspberry Pi 4 Model B | ✔ | ✔ (2.4 and 5GHz) |
| Raspberry Pi Compute Module 3, 3+ | ❌ | ❌ |
| Raspberry Pi Compute Module 4 | ✔ (if provided by carrier board) | ✔ (if using a "WLAN" model, 2.4 and 5GHz) |
| Raspberry Pi 5 | tbc | tbc |
NOTE: Circle, which MiniDexed is built on, uses a fork of hostapd 0.7, which is affected by Hostapd CVEs and possibly also Broadcom security flaws. This makes WLAN enabled devices using Circle vulnerable. It is not recommended to use the WLAN support until this has been fixed. For details, please see https://github.com/rsta2/circle/issues/601#issuecomment-3094475939
Functionality
- rtpMIDI a.k.a. "AppleMIDI"
- UDP MIDI on port 1999
- FTP (e.g., to update without taking the microSD card out of the Pi)
- DNS-SD service discovery a.k.a. "Bonjour", "Zeroconf"
- Logging over the network to a syslog server (useful for development and testing)
Configuration
In the file minidexed.ini, edit the configuration:
# Network
NetworkEnabled=0
NetworkDHCP=1
# NetworkType ( wlan ; ethernet )
NetworkType=wlan
NetworkHostname=MiniDexed
NetworkIPAddress=0
NetworkSubnetMask=0
NetworkDefaultGateway=0
NetworkDNSServer=0
NetworkFTPEnabled=0
NetworkSyslogEnabled=0
NetworkSyslogServerIPAddress=0
UDPMIDIEnabled=0
# Destination address for udp midi data. 0.0.0.0 disables transmit.
UDPMIDIIPAddress=0.0.0.0
Set NetworkEnabled to 1 if you would like to activate any networking functionality.
Set NetworkType to either wlan for WLAN or ethernet for wired LAN.
The default configuration attempts to get an IP address and DNS server from your network via DHCP. If you prefer to use a static IP address, you can edit the values for NetworkIPAddress, NetworkSubnetMask, NetworkDefaultGateway, and NetworkDNSServer accordingly.
NOTE: If you have more than one MiniDexed device on the same network, you need to change the value for NetworkHostname to unique values in order to distinguish between them.
In the file wpa_supplicant.conf, edit the configuration:
#
# wpa_supplicant.conf
#
#country=DE
network={
ssid="my-ssid"
psk="my-password"
proto=WPA2
key_mgmt=WPA-PSK
}
Uncomment the line country= and set the correct country code for your location. Replace my-ssid with the SSID of your WLAN and replace my-password with the password of your WLAN.
NOTE: Failure to set the correct country code may result in inability to connect to certain WLANs, especially 5 GHz access points.
NOTE: ⚠️ This is very insecure and should only be used in your private network in which you are the only user. Currently anyone on your network can access your MiniDexed device. Furthermore, anyone with physical access to the microSD card in your Raspberry Pi can read the WLAN password in clear text.
If the network configuration is working, MiniDexed should show the IP address assigned to it via DHCP when booted:
You will need this IP address to connect to MiniDexed over the network.
rtpMIDI
rtpMIDI (also known as "AppleMIDI") allows you to send MIDI data from a host computer to MiniDexed. The data is sent using UDP but this is separate from the "UDP MIDI" functionality MiniDexed also supports (see below).
This allows us to send MIDI e.g., from DAWs, Dexed on the PC, or even sysex for voices from the web browser using sites like patches.fm.
It is also possible to use MiniDexed in conjunction with Dexed on a host computer. This allows you to send voices from Dexed to MiniDexed over the network, and to use Dexed as a GUI "programmer" for MiniDexed, meaning that any changes in Dexed are immediately reflected in MiniDexed.
Windows
RTP-MIDI on Windows 11 using loopMIDI and rtpMIDI works very nicely as described here. Playing MIDI from REAPER to MiniDexed over the network.
and Dexed like this
macOS
- Open Audio MIDI Setup
- In the MIDI Studio window, double-click Network
- In the MIDI Network Setup window, MiniDexed will appear after a while in "Directory". Set it up like below.
Tested with Logic Pro 9.1.8 on Mac OS X 10.6.8. Unfortunately GarageBand does not support sending MIDI data to external MIDI devices.
NOTE: If DNS-SD service discovery a.k.a. "Bonjour", "Zeroconf" is not available on your machine, you will need to enter the IP address of your MiniDexed device manually by clicking "+" under "Directory".
Linux
rtpmidid works using both auto discovery and fixed connections in /etc/rtpmidid/default.ini.
Use aconnect or equivalent gui tools to route midi data.
For example to forward from the kernel Through device to minidexed on rtpmidid:
me@linux:~$ aconnect 14:0 128:4
Here's an example output from aconect -l with vmpk sending to linux thru device which is then connected to minidexed:
me@linux:~$ aconnect -l
client 0: 'System' [type=kernel]
0 'Timer '
Connecting To: 145:0
1 'Announce '
Connecting To: 145:0, 128:3
client 14: 'Midi Through' [type=kernel]
0 'Midi Through Port-0'
Connecting To: 128:4
Connected From: 130:0
client 128: 'rtpmidid' [type=user,pid=1404460]
0 'Network Export '
1 'yamahapi '
2 'wifimidi '
4 'MiniDexed-pi2 '
Connected From: 14:0
client 129: 'MIDI In' [type=user,pid=1247728]
0 'in '
client 130: 'MIDI Out' [type=user,pid=1247728]
0 'out '
Connecting To: 14:0
client 145: 'PipeWire-System' [type=user,pid=3114]
0 'input '
Connected From: 0:1, 0:0
client 146: 'PipeWire-RT-Event' [type=user,pid=3114]
0 'input
UDP MIDI
Like rtpMIDI, UDP MIDI also allows you to send and receive MIDI data with a host computer to MiniDexed.
It listens on udp port 1999 and transmits to udp port 1999
There are 2 configuration settings in minidexed.init:
# Allow send and receive of udp midi on port 1999
UDPMIDIEnabled=0
# Destination address for udp midi data. 0.0.0.0 disables transmit.
UDPMIDIIPAddress=0.0.0.0
This can be used in conjunction with the MIDI Button Navigation functionality to simulate keys being pressed on the MiniDexed device (which is neat for e.g., test automation):
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Send MIDI messages to MiniDexed to navigate the menu.
This script is useful to automate operating the MiniDexed menu, e.g., for test automation.
"""
import sys
import socket
import time
server_address = "minidexed.local"
# This may require Apple Bonjour on Windows or Avahi on Linux to be installed to resolve the hostname
ip_address = socket.gethostbyname(server_address)
"""
minidexed.ini has
# MIDI Button Navigation
# Specify MIDI CC to act as a button (0 = ununsed, so don't use CC 0)
# NB: Off < 64 < ON
# CC channel: 0=OFF; 1-16 MIDI Ch; >16 Omni
# If MIDIButtonNotes>0 then treat MIDIButton numbers as MIDI
# Note numbers, triggered with NoteOn/NoteOff, not CC numbers.
MIDIButtonCh=17
MIDIButtonNotes=0
# Arrow left
MIDIButtonPrev=46
# Arrow right
MIDIButtonNext=47
# Arrow up
MIDIButtonBack=48
# Arrow down
MIDIButtonSelect=49
# Home button
MIDIButtonHome=50
MIDIButtonPgmUp=51
MIDIButtonPgmDown=52
MIDIButtonBankUp=53
MIDIButtonBankDown=54
MIDIButtonTGUp=55
MIDIButtonTGDown=56
"""
# Virtual buttons; needs to match values in minidexed.ini
arrow_left = 46
arrow_right = 47
arrow_up = 48
arrow_down = 49
home = 50
pgm_up = 51
pgm_down = 52
bank_up = 53
bank_down = 54
tg_up = 55
tg_down = 56
# Top level menu
# [ TG1, TG2, ..., TG8, Effects, Performance ]
# Menu for TG1, TG2, ..., TG8
# [ Voice, Bank, Volume, Pan, Reverb-Send, Detune, Cutoff, Resonance, Pitch Bend, Portamento, Poly/Mono, Modulation, Channel, Edit Voice ]
def pressButton(virtual_button=arrow_right):
sock = socket.socket(socket.AF_INET, socket.SOCK_DGRAM)
message = b'\xB0' + bytes([virtual_button]) + b'\x7F'
print("Sending MIDI message: ", message)
sock.sendto(message, (ip_address, 1999))
time.sleep(0.1)
message = b'\xB0' + bytes([virtual_button]) + b'\x00'
print("Sending MIDI message: ", message)
sock.sendto(message, (ip_address, 1999))
sock.close()
time.sleep(1) # Lower values may cause the message to be lost
if __name__ == "__main__":
pressButton(home)
pressButton(arrow_left)
pressButton(arrow_down)
pressButton(arrow_down)
pressButton(arrow_down)
print("Changing program")
pressButton(pgm_up)
time.sleep(3)
print("Restoring program")
pressButton(pgm_down)
time.sleep(1)
print("Changing TG")
pressButton(tg_up)
time.sleep(3)
print("Restoring TG")
pressButton(tg_down)
# Go to TG1 Edit Voice
pressButton(home)
pressButton(arrow_down)
pressButton(arrow_right)
# 13 times arrow right
for i in range(13):
pressButton(arrow_right)
pressButton(arrow_down)
time.sleep(1)
pressButton(home)
sys.exit(0)
FTP
Set NetworkFTPEnabled to 1 to enable FTP access.
NOTE: ⚠️ This is very insecure and should only be used in your private network in which you are the only user. FTP uses no encryption, and everyone can log into your device.
FTP allows you to access the contents of the microSD card inside the Raspberry Pi over the network (e.g., to update the firmware and/or modify voices and performances without taking the microSD card out of the Raspberry Pi).
Username: admin, password: admin.
Unfortunately, the FTP clients built into Windows 11 and macOS are known not to work with the FTP implementation currently being used in MiniDexed. The windows 11 ftp client can lock up the ftp server so don't even try.
The following FTP clients are known to work:
- MiniDexed Service Utility for PC
- Total Commander for Windows
- WinSCP for Windows
- linux ftp
BEWARE- the implementation defaults to ascii mode. If you're updating firmware manually you will need to explicitly switch to binary mode.
Sending the command BYE over FTP will reboot the system. This can be useful, e.g., to trigger a reboot after a firmware or configuration upload.
You can use updater.py provided in this repository. It will automatically download (at the choice of the user) either the latest release or the latest continuous (experiemental) build of MiniDexed, scan the network for MiniDexed devices, and upload the firmware, and (optionally) the performances, then reboot MiniDexed.
Logging over the network to a syslog server
Set NetworkSyslogEnabled to 1 to enable logging over the network and specify the IP address of the computer running the syslog server at NetworkSyslogServerIPAddress. You can run any syslog server that listens to port 8514, such as syslogserver.py provided in this repository or the MiniDexed Service Utility for PC.
Limitations
- The FTP implementation is very rudimentary and does not work with all FTP clients, especially those built natively into operating systems. A more robust (S)FTP implementation would be welcome. A pull request enabling this would be appreciated
- Fixed in #899: Originally you could only send MIDI data from the host computer to MiniDexed, not the other way around
- rtpMIDI session initiation is not implemented; MiniDexed can only be invited to be a participant in an existing session (you must create a session on a PC or other device that supports it, and invite MiniDexed to the session)
- MiniDexed can only participate in one rtpMIDI session at a time
- rtpMIDI journalling is not implemented, so it is not possible to recover from packet loss. A reliable network connection is required. If your network suffers from frequent packet loss/disconnections, this feature is probably not going to work well for you
- Edge cases to be fixed on RPi Zero 2:
- If firmware folder is missing and
wlanis configured, it hangs at boot (works if network is disabled altogether though) - If
ethernetis configured, it hangs on main screen (works if network is disabled altogether though) (RPi Zero 2 doesn't have Ethernet)
- If firmware folder is missing and