USB to WiFi+MIDI+DMX Interface

USB to WiFi+MIDI+DMX Interface with ATXmega128A4U

It interconnects USB (MIDIStream Class as well as CDC/ACM class), WiFi Ethernet and a combined MIDI/RS-232 interface. The essential communication method is data transfer from each to any else. The concept is to create a communication "triangle".

Optionally, a simple DMX512 feature is implemented, supporting max. 256 DMX channels. The command set is "home automation" oriented, which is an obvious idea when WiFi capable smartphones and tablets are spreaded widely.

picture:assembly of USB/ WiFi/MIDI Interface
Assembly of the USB / WiFi / MIDI / DMX Interface in "Eurobox" enclosure.

A detailled construction- and operation manual is provided here (PDF file).

The available modes of operation are selected by a rotary code switch:

  • Depending on the selected USB class, the transfer is organized in MIDI compatible packets or as a COM port compatible byte stream.

  • Selectable by the rotary switch, at one of the communication channels it is possible to enter binary values as ASCII text, and vice versa receive every binary byte as ASCI text. This mode is useful together with a terminal software for manual debugging or evaluation of WiFi capable applications or to communicate "binary" with simple scripts etc. which are only ASCII capable.

  • OSC (Open Sound Control) coded data packets, received via WiFi, are decoded and the binary "payload" content is retransmitted to MIDI OUT and to USB working in MIDIStream class. Vice versa, every byte received at MIDI IN or via USB is accumulated into appropriately timed OSC formatted packets and retransmitted via WiFi.
    Because OSC is not designed around a well defined set of methods (i.e. commands) - like MIDI is, some predefined methods of the most popular, well designed and documented OSC implementations are implemented, as is "Touch OSC" and "Control".
    Additionally a special set of MIDI oriented OSC methods is implemented. To provide additional flexibility, a simple compiler for user defined OSC methods is built in. This way, a big variety of OSC methods generated by 3rd party devices may be recoded to provide corresponding MIDI specific or general serial output. All OSC methods/commands are fully documented, no specific drivers are needed.

  • Additionally a set of OSC methods for DMX512 lighting control supporting up to 256 DMX channels is added.
    This control interface is designed to be applicable from a wireless tablet, e.g. for home lighting remote control. A pd (Pure Data) patcher which demonstrates the command set is shown below.

  • Another set of ASCII commands for DMX512 lighting control is implemented. DMX can be controlled simultaneously by WiFi UDP or Telnet, USB virtual COM port and RS-232.

  • Last not least the widely known MiniDMX protocol - developed by Mathias Dzionsko - is provided.
    Formally this is implemented here as ASCII command 'Z' (hex 5A). This letter is the header byte of each MiniDMX data packet. So when it gets received, the microcontroller jumps into the corresponding decoder routine and returns back to the ASCII command mode after the MiniDMX packet is processed. Fade processes, prestored lighting scenes and the chaser are not supported by the MiniDMX protocol. But instead it is compatible with the freeware DMXControl2, DMXControl3 and Freestyler software.

  • The USB to WiFi+MIDI+DMX interface can be associated wireless to an existing infrastructure network. Alternatively - or more preferably - a "soft AP" mode is supported, where the interface creates a wireless network by itself and operates as its access point. This way direct wireless communication with mobile devices like smartphones and tablets is establised with minimal overhead and latency.

  • The device is designed to operate "USB bus powered" (max 250mA). If no USB communication is needed or possible, it can be powered through the USB connector with a regulated 5V supply.
    In this case, only communication between WiFi, MIDI/COM port and DMX512 is possible.

  • At hardware level, the RN171XV and/or the DMX controller is optional, the firmware adjusts itself correspondingly. Communication between USB and MIDI/COM is possible anyway.

  • The RN171XV is pin compatible with wireless XBee transceivers. These modules can be used instead of the RN171XV modules when the rotary switch is in position 0 to 7. No special firmware is needed.
    With two of these XBee equiped modules you get a quite more simple "wireless USB to MIDI cable" or "wireless USB to DMX controller". But this is not compatible with actually known apps on smartphones and tablets.

Hardware essentials

  • For MIDI and/or RS-232 I/O, two pinheads are provided at the PCB.
    Classical 5 pin DIN connectors and/or a 9 pin SubD connector with metal flange should be mounted at the front panel of the housing. The subD connector may be male or female, depending on the intended use.
    The MIDI/COM baud rate can be adjusted to standard rates between 9600 and 230400 baud, including MIDI baud rate.
    The WiFi baud rate can be adjusted to standard baud rates too. Default is 9600 for easy setup of the RN171XV module, but for practical use 230400 is recommended (115200 for XBee modules).
    Baud rate settings are stored permanently until they get changed.

  • For the optional DMX512 output, a separate pinhead is provided.

  • The heart of the circuit is a microcontroller ATXmega128A4U clocked at 24 MHz. The 44 pin TQFP socket demands a good solder iron and some skills. An Atmel compatible programming connector is provided on the PCB.

  • The layout of the PCB is held simple with a single wire layer.

  • The proposed PCB is designed to fit well into a low-cost "Eurobox" housing. Available from Conrad or Reichelt for example.

Pure Data demonstration and test patcher

picture:pd test patcher
Nearly all OSC commands for the USB / WiFi / MIDI / DMX interface may be sent from this patcher (download see below). It is not too complicated to rebuild a similar user specific TouchOSC structure on a tablet. The right hand part emulates all controls of the TouchOSC "Mix2" layout in a slightly modified arrangement.

Pure Data demonstration and test patcher for ASCII commands via RS-232

pd ASCII test patcher
The most essential ASCII commands for DMX control may be sent from this Pure Data patcher by RS-232 or USB (download see below).
For smooth execution, input of short numeric parameters is terminated by a semicolon character (ASCII code 59), which works as a dummy command with no effect else.
For some commands (especially save a lighting scene as "preset"), direct command transfer - while the slider is moved - would cause unpleasant side effects. In these cases, command execution has to be triggered explicitly after the parameter value is adjusted by slider.
The ZIP file contains a similar patcher, which is useable to control DMX via UDP/WiFi.

The subsequently downloadable material is copyrighted (c)2015-16 by Wolfgang Schemmert
Assembly and use of the interface is permitted for free by everybody for any purpose ("freeware")
The MiniDMX firmware is provided under "Creative Commons 3.0 DE License"
All information is based on best knowledge, but without any warranty. Any responsibility is excluded.

single layer PCB layout (1:1 TIF format)

Firmware hex code for ATXmega128A4U incl .inf file for Windows virtual COM port (ZIP file - Ver.2.13, 09 March 2016)
(recommended Fuses programming: Fusebyte0:0xFF, Fusebyte1:0x77, Fusebyte2:0xFF, Fusebyte4:0xF1, Fusebyte5:0xEB)

Detailled construction- and operation manual (PDF file)

set of pd (Pure Data) demonstration and test patchers (ZIP file)

* State of information March 2016.
* Right of technical modifications reserved. Provided 'as is' - without any warranty. Any responsibility is excluded.
* This description is for information only. No product specifications are assured in juridical sense.
* Trademarks and product names cited in this text are property of their respective owners.