DIY WiFi/MIDI Remote control box for X-AIR: WORKING!

  1. #1 by Vernon Graner on 01-27-2018
    Vernon Graner's Avatar
    Posts: 48

    DIY WiFi/MIDI Remote control box for X-AIR: WORKING!

    Tl;DR - I've built a portable WiFi/MIDI mixer control box that allows MIDI or completely wireless operation of an XR18 mixer. typical uses include talkback routing, "Cough box" on the talent table or a way to quickly route/reroute signals

    Based on the Adafruit HUZZAH32, this unit can run on a USB cable connected to a small USB "brick" or it can also run on a LiPo battery. Signal output is a combination of MIDI and WiFi. At the moment, the WiFi info (SSID/Pass) and the IP address of the target Mixer is hard-coded in the source before downloading to the chip.

    So, you can plug in the USB cable and charge brick for long term use, and the MIDI cable for sure-fire control, or you can run on batteries and use WiFi to be completely portable! In wireless mode on batteries, it is REALLY fun!

    This is really a V1.0 "proof of concept" design. I built it in a leftover project box and the unit is cumbersome to reprogram. I plan to add an OLED display to allow the WiFi / IP info to be input from the front panel, and also to allow button functions to be programmed.

    Here are some pictures:


    The first prototype on the breadboard


    Closeup of the case


    Closeup of the microcontroller (HUZZAH32)


    All Buttoned Up!


    Rear panel


    Unit in operation

    And lastly, I have a video of the unit controlling my XR18:

    https://youtu.be/CI1OQnQrRa4

    I'm happy to answer any questions and welcome ideas on how to improve the design. Thanks to all the forum members that helped steer me in the right direction!

    --
    Vern
  2. #2 by Ted Rippert on 01-27-2018
    Ted Rippert's Avatar
    Posts: 75
    Hey Vern,

    NICE! I love the part in the video where you unplug the cables and it keeps working.

    -Ted
  3. #3 by John Baker on 01-28-2018
    John Baker's Avatar
    Posts: 802
    Nice work! Thanks for sharing...
  4. #4 by Steve Walker on 01-28-2018
    Steve Walker's Avatar
    Posts: 222
    - Vernon Graner wrote View Post
    Tl;DR - I've built a portable WiFi/MIDI mixer control box that allows MIDI or completely wireless operation of an XR18 mixer. typical uses include talkback routing, "Cough box" on the talent table or a way to quickly route/reroute signals
    This is exactly what I need as a wireless foot-switch on floor to simply control an effects "mute group". Mute effects when speaking to audience and unmute effects when singing. I would use it wireless as a foot-switch running on the battery.

    Do you plan to eventually sell these units?

    Thanks,
    Steve Walker
  5. #5 by Vernon Graner on 01-28-2018
    Vernon Graner's Avatar
    Posts: 48
    - Steve Walker wrote View Post
    This is exactly what I need as a wireless foot-switch on floor to simply control an effects "mute group". Mute effects when speaking to audience and unmute effects when singing. I would use it wireless as a foot-switch running on the battery.
    I think it would be perfect for that kind of function. I would have to modify the code so the buttons are push-on / push-off rather than press and hold for the action. I've been working on cleaning up the code and this is something I probably should add as an option for each button. Good idea!

    Do you plan to eventually sell these units?
    I hadn't really considered it. I don't want to be in the "manufacturing" business and I believe someone else on the forum may already be building units for sale built I'm not sure. I am in favor of sharing knowledge so that everyone can make cool things. For example, I plan to share the source code for this unit in my next post on this thread.

    That said, I would be happy to help you build one or I might be talked into making a one-off for you if you can't find any other solution.

    Last edited by Vernon Graner; 01-28-2018 at 11:44 PM.
    --
    Vern
  6. #6 by Vernon Graner on 01-28-2018
    Vernon Graner's Avatar
    Posts: 48

    Source code for Arduino HUZZAH32 for WiFI/MIDI Mixer Control box

    I've been working on this code to clean it up over the last few days. Its not perfect, but its more readable and a lot of redundant stuff was removed. It still suffers from some shortcomings I am hoping to address- specifically:
    • The WiFi SSID and Password are hard-coded in the source
    • The IP address of the X-AIR Mixer is hard-coded in the source
    • The WiFi connection code is blocking- so if it cant connect the box won't "boot"
    • Button functions are hard-coded in the source

    To address the WiFI issues, I have found a bit of source code that should let me set the WiFi info using a smartphone app. I haven't really played with it yet but it looks promising. I also plan to add a timeout for the WiFi conneciton so if it can't find the specified WiFi AP, it will just drop into MIDI mode.

    As for the target IP of the mixer, I'm not sure how to handle that. I am considering trying to enable DNS so that a name for the mixer can be hard coded rather than an IP in the hopes that the mixer can be addressed via domain name resolution.

    Another possible angle would be to have the unit present a web page where you could enter all the details such as the target mixer IP address and the commands for each button. Not sure how much work that would be but it seems like good practice and would make a nice V2.0 for this hardware.

    As always, I am happy to answer questions about this unit. So without further ado, here's the source code:


    Or .. that *would* have been the source code if that hadn't happened. So it seems maybe the source is too big..? I'll try and post it in its own message next.

    Last edited by Vernon Graner; 01-28-2018 at 10:21 PM.
    --
    Vern
  7. #7 by Vernon Graner on 01-28-2018
    Vernon Graner's Avatar
    Posts: 48

    Source code for Arduino HUZZAH32 for WiFI/MIDI Mixer Control box

    So, it seems the forum won't take a direct post of the source code so I have provided a link to the code on my site here:

    http://www.notepad.org/TAE/posts/WiF...rol_Source.txt

    Hope this works..

    --
    Vern
  8. #8 by Rex Beckett on 01-29-2018
    Rex Beckett's Avatar
    Posts: 577
    Vernon, I've used Arduino boards for a number of projects where I needed to be able to configure various parameters during installation. I include a simple (non-blocking) command interpreter on the serial port to let me inspect and change the parameters - which are stored in on-chip EEPROM. You already have the USB port available so you could use that.

    I use Termite to configure from a PC and UsbTerminal for Android phones and tablets (via an OTG adaptor cable).

    I believe your board also has a Bluetooth port. I have had great success using Serial Bluetooth Terminal to provide a terminal connection from Android phones and tablets. This works without the need to pair the devices so is simple to use. When using a Bluetooth connection, I employ a password access control for the command interpreter - just in case.

    Last edited by Rex Beckett; 01-29-2018 at 05:14 AM.
  9. #9 by Vernon Graner on 01-29-2018
    Vernon Graner's Avatar
    Posts: 48
    - Rex Beckett wrote View Post
    Vernon, I've used Arduino boards for a number of projects where I needed to be able to configure various parameters during installation. I include a simple (non-blocking) command interpreter on the serial port to let me inspect and change the parameters - which are stored in on-chip EEPROM. You already have the USB port available so you could use that.

    I use Termite to configure from a PC and UsbTerminal for Android phones and tablets (via an OTG adaptor cable).

    I believe your board also has a Bluetooth port. I have had great success using Serial Bluetooth Terminal to provide a terminal connection from Android phones and tablets. This works without the need to pair the devices so is simple to use. When using a Bluetooth connection, I employ a password access control for the command interpreter - just in case.
    Thanks Rex! Those are really great ideas! Do you have any example source code I could get a look at? I'd like to see how you accomplished the serial terminal setup.

    I've been puzzling over how to make changes to the operation of the box without connecting to the IDE and re-writing the EEPROM. The approach you describe makes a lot of sense.. In fact, I had really overlooked the built-in bluetooth! I didn't know it could be used as a serial interface- especially without having to pair a device. That's really cool!

    I had been researching how to setup the ESP32 using external sources and found this interesting demo:

    http://www.iotsharing.com/2017/05/ho...-on-esp32.html

    The example there uses an app on your Android phone to connect to and configure the WiFi on an ESP32/ESP8266 unit. I've also been playing with the idea of having the ESP32 operate as a web server and present a web page with options. I was looking at this as a starting point:

    https://randomnerdtutorials.com/esp3...r-arduino-ide/

    I'm not sure which of these approaches would be simplest but they certainly give me a lot of ideas for a V2.0 and V3.0 version of the device. Thanks for the info!

    --
    Vern
  10. #10 by Rex Beckett on 01-29-2018
    Rex Beckett's Avatar
    Posts: 577
    - Vernon Graner wrote View Post
    Do you have any example source code I could get a look at? I'd like to see how you accomplished the serial terminal setup.
    If you PM me your email address, Vernon, I will send you a sketch which includes a serial command interface with password protection. I use it with both USB and Bluetooth connections.