Active Channel Number

I've built a lighthack for my Nomad and it's working really well. It would be really useful to be able to display the active channel number too - does anyone know if this would be possible?

Parents
  • On a channel selection EOS send /eos/out/active/chan 
    which contains a string with the channel selection and the value of the first selected channel. see manual 3.2.1 page 653

  • Hi sstaub

    Thank you, and I did that far on my own, but I don't know how to parse that specific value in the Arduino sketch? It would appear that the sketch only receives the /eos/out/ info after it has sent a query initiated by an encoder? 

  • Which sketch did you use, the original or some sketch from my GitHub library https://github.com/sstaub/eOS

  • I'm using your sketch © 2019 with a version number of "lighthack box2B"

  • Maybe this works, attached a new file as an starting point. Have also a look to the comment
    - added a new String chanMessage
    - added a new filter rule to initEOS()
    - added a parser to parseOSCMessage()
    Things you have todo:
    - you must proceed the message to fit on a display
    - in displayStatus() you must handle the output to the LCD

    How do want display the data? With a larger LCD display(4x20)

    box2C.zip

  • Wow, thank you! Your commitment to the project is SO appreciated! :)

    I'll have a play with this tomorrow and let you know how I get on!

  • Well... that almost worked!

    If a channel is unpatched or is patched as a generic "Dimmer" or with a Type of "Fresnel" or "Profile" or "Parcan" then "/eos/out/active/chan" is the channel number and is displayed on the Lighthack display as a string of numerals. However, if the Type is anything more complex or the channel has a Label then two strange symbols are displayed on the Lighthack display even though "/eos/out/active/chan" is shown correctly in the Diagnostics Tab.

    I eventually tracked this behaviour down to the size of the chanMessageRaw array. The array is too small at 32 if the Type and Label combined are greater that 32 characters. Everything seemed to work correctly with the array at 96, so I erred on the side of caution and made it 128. I assigned chanMessageRaw to a new string variable, chanMessageFullString, and then set chanMessage as a 4 character substring 'cause Nomad will never use more than a 4 digit channel number.

    I hope this might be useful for someone else - but I could NEVER have got there without your initial work on this, so a big thank you!

    Here's my modified code: 

    Global Variables

    String chanMessage; // for the channel message
    String chanMessageFullString;
    parseMsg = "/eos/out/active/chan";
    if (msg.indexOf(parseMsg) != -1) {
    char chanMessageRaw [128]; // size is max 32 chars
    oscmsg.getString(0, chanMessageRaw, 128); // size is max 32 chars
    chanMessageFullString = String();
    chanMessageFullString = chanMessageRaw;
    chanMessage = String();
    chanMessage = chanMessageFullString.substring(0,3);
    connectedToEos = true;
    updateDisplay = true;
    parseMsg = String();
    return;
    }
Reply
  • Well... that almost worked!

    If a channel is unpatched or is patched as a generic "Dimmer" or with a Type of "Fresnel" or "Profile" or "Parcan" then "/eos/out/active/chan" is the channel number and is displayed on the Lighthack display as a string of numerals. However, if the Type is anything more complex or the channel has a Label then two strange symbols are displayed on the Lighthack display even though "/eos/out/active/chan" is shown correctly in the Diagnostics Tab.

    I eventually tracked this behaviour down to the size of the chanMessageRaw array. The array is too small at 32 if the Type and Label combined are greater that 32 characters. Everything seemed to work correctly with the array at 96, so I erred on the side of caution and made it 128. I assigned chanMessageRaw to a new string variable, chanMessageFullString, and then set chanMessage as a 4 character substring 'cause Nomad will never use more than a 4 digit channel number.

    I hope this might be useful for someone else - but I could NEVER have got there without your initial work on this, so a big thank you!

    Here's my modified code: 

    Global Variables

    String chanMessage; // for the channel message
    String chanMessageFullString;
    parseMsg = "/eos/out/active/chan";
    if (msg.indexOf(parseMsg) != -1) {
    char chanMessageRaw [128]; // size is max 32 chars
    oscmsg.getString(0, chanMessageRaw, 128); // size is max 32 chars
    chanMessageFullString = String();
    chanMessageFullString = chanMessageRaw;
    chanMessage = String();
    chanMessage = chanMessageFullString.substring(0,3);
    connectedToEos = true;
    updateDisplay = true;
    parseMsg = String();
    return;
    }
Children