We’ve been digging more into using Command Validation but haven’t had much success, especially with the regex side of things. Looking at the Xibo documentation: Command Functionality | Xibo Digital Signage, we could not find any working examples of how Validation works, only that it’s “used as a comparison to the Command output and if it matches then the Command is considered a success. This string can be a regular expression.”.
So with that being the only info that we have, we are looking for clarification and transparency on these callbacks. Even with debugging turned on in test mode, we don’t see any Command history, no output history. Why wouldn’t there be DEBUG info stating what the result of the Validation? (Valid? False. Expected: X, Received: Y)
We think we were able to figure out how to use basic String validation with Command output via echo or console, but regex is still a mystery. An example in the documentation would have been very helpful here…
Since there is no documentation regarding it, let’s try and work through an example together. Who knows, maybe this will end up added to the guide.
So, if we set up a command in the CMS like such:
OS: Android
Command: getprop ro.product.model
Validation: DSCS9
When we run this command against a DSCS9 (legacy) player, we know the command is a huge success because under Displays [Last command] we see a big ✓.
So what happens when we run this against a newer DSCS9X player? Do we get the ✓ as before after we run it? No, no we do not. This is because it’s looking for an exact string. Duh. Let’s go ahead and modify this Validation string. Why not use regex like it says? Let’s see the results:
Validation: DSCS9.*
Result: No match
Comment: Huh, was not expecting that…
Validation: DS.*
Result: No match
Comment: Doesn’t match DSCS9 either now…
Validation: .*
Result: No match
Comment: Okay, what? This should match everything
Validation: DS*
Result: No match
Comment: Well this isn’t exactly regex, but this is what works as a wildcard in the CMS otherwise, like dynamic groups. Worth a shot anyway…
Validation: ^(.*)$
Result: No match
Comment: Okay, we give up, we don’t know what it’s looking for.
Conclusion:
Command Validation is currently in a somewhat broken state. We can see that it’s technically working with regards to a static string validation, but that is about it. There is a lack of adequate documentation in the guides to explain otherwise how to use it. There is mention of regular expressions, but we could not get it to work. Perhaps we are missing something simple and this is where documentation would help provide the clarity needed to fix our errors.
Lastly, we were very disappointed that we could not find any logs in the CMS for when a command was issued to a player. It would be very helpful to know some basic info about commands:
DateTime, User, CommandId, Return Value, Validation Result
@dan @natasha–
If we’ve overlooked something, please correct our mistakes and teach us!
Thank you :]