r/crestron • • Feb 14 '20

Programming PepperDash Essentials

In the interest of full disclosure: I am a PepperDash employee.

That being said, PepperDash has now made our Essentials S#Pro Framework open-source. You can find the source code at https://github.com/PepperDash/Essentials. If you want to download a .cpz and go, see https://github.com/PepperDash/Essentials-Builds.

Essentials allows for loading plugins, which can greatly extend and modify the behavior of the root system. There is an example plugin at https://github.com/PepperDash/PanasonicDisplay.EPI.

For documentation, see the wiki: https://github.com/PepperDash/Essentials/wiki

Please check it out if you have a chance.

35 Upvotes

25 comments sorted by

5

u/tr0tsky CCMP | CTS Feb 14 '20

As someone who hasn't really dove into S#Pro (have some C# experience, and have done some S# things into S+), I have a feeling I'm going to try and check this out and have my head explode...but it sounds very useful.

1

u/[deleted] Feb 14 '20

And, there is a tool in the works for our Portal website that allows you to generate configs without necessarily having to dive into JSON editing and possibly miss keys or have the wrong values.

5

u/geauxtig3rs Dopephish was on the grassy knoll Feb 14 '20

That's the beauty of essentials - You literally have to have ZERO s#Pro experience to gain benefit from it. It's there to extend, and it can be used as a vehicle for plugins, but out of the box, it does a TON, and all you have to do is write a config file for it.

You need a DM chassis? Config it, no code needed.

You need some occ sensors? Add them to the config!

You need some communications channels? Add them to the config!!!!

It's amazing even if you have ZERO experience!

10

u/geauxtig3rs Dopephish was on the grassy knoll Feb 14 '20

In the interest of full disclosure - I too am a PepperDash employee.

I've been using Essentials as a bolt-on to my SIMPL projects for over a year now.

For me, it just started as a good way for me to get some devices (usually DM) into my program without having to define them in SIMPL. We all know how tedious that can be.

I dove in and started playing - asking for features - getting them delivered for my projects....I had need of GLS-OCT-C-CN occ sensors - Boom, here you go...our development team had it turned around for me in a few hours.

I discovered that I could set up arbitrary communications channels and transmit things across EISC directly from a socket - Alright, remove all connection logic from simpl and transfer data across the EISC directly to devices - I'm eliminating the need for unique code written in simpl just to access a comport on a Pro3 vs a RMC3. Now my Devices talk directly to communications channels spun up in Essentials.

I get to a project that has a 64 x 64 - That's not supported in essentials. I ask if someone can write it - but they were elbow deep in trying to make this suitable for public consumption and documenting. I got my hands dirty and over the course of about 3 days, I extended essentials to include large DM frames. We do a PR and boom, now that's a part of essentials.

Then I start hearing about plugins for essentials....I have no idea what they are or how they work, but I just hear that they are amazing. We didn't have any inbuilt documentation for them, so unless you "knew" you couldn't know....I cornered someone one day a few weeks ago and made them explain it to me and it was instantaneously one of the biggest paradigm shifts for me in Crestron coding since 3 series came out....

Even with all the other stuff Essentials provides, plugins take the cake, IMHO. As a project lead, it makes it possible for me to develop silo'd S#Pro libraries that have a defined API across an EISC and release them to junior developers that have no idea how s# works...and it gives them the power to dynamically instantiate hundreds of devices just through config files - transfer control sigs for those devices to anywhere. We have plugins for Samsung MDC, plugins for Biamp Tesira, Plugins for NVX - sky is the limit. I just got back from an onsite and I wrote 4 plugins while I sat there in front of the system.

Developing a plugin allows you to write completely arbitrary code and have it run within pro and spit it out to Simpl across an EISC. The essentials-backed plugin architecture does lots of the heavy lifting for you so that you don't have to.....Need to spin up a communications channel? No big deal, make sure your class implements IBasicCommunication and inherits from Device and let it do the hard work for you...doesn't matter if it's a comport or ssh, you don't have to change a thing but your configuration file....

Do you need a bunch of configurable data for your plugin? No big deal, the entire jason you built is accessible for you to pull properties from. You don't have to build any file management logic or anything, it's just done.

You need a heartbeat for a device to make sure it stays online? Remember IBasicCommunication and Device? There's a built in communications monitor that handles all of that.

All the fiddly bits involved in creating an EISC from Pro to Simpl are handled as well as long as you implement IBridge in your plugin.

Did you create a plugin for a device that you need access to in a dozen programs? No big deal. Link it up to as many eisc bridges as you want, and all it takes is some config edits.

And here's another great thing about plugins.....development cycle is the bees knees.....Think about what you need to do when doing a standard S# clz....Write your s# code, write the s+ wrapper, put it in simpl. Ok, you're debugging it now. Any bugs? Of course there are....Now you have to edit your s# and compile it and make sure it's in the same directory as your s+ which you then compile, then you compile your simpl if there were changes in the s+ and then you load it all again. Yeah, if you're just editing the CLZ you can stop your slot, drop in the DLL, and restart, but then you have to deal with the startup of your program again....

With a plugin, I write the plugin, I drop the cplz in the plugins folder for the essentials program, and restart the essentials program....Bug? Edit the plugin, compile, drop it in the folder, and restart essentials, which starts up completely in typically 30 seconds or less depending on how much stuff you have in there. Your simpl is still trucking, you don't have to wait for it to start up, you don't have to navigate back to the page you were testing from...as far as it's concerned, nothing has changed.....It's a major game changer not only because you've released yourself from the yoke of S+ and can use a much more powerful language.

Essentials has drastically changed the way that I architect projects....top to bottom. It's an absolute game changer.

1

u/thurstylark Kludge Artist Feb 15 '20

A couple questions that I came across when trying to wrap my head around this project:

  1. It's mentioned that a config can be created manually, but I'm not seeing a lot of information about how to do so. Is there a list (or can one be generated) of valid properties and parameters? I realize this was designed to be used with the Portal, but if one desired to create their own configs, I see very little help in the wiki or otherwise.

  2. Looking at SIMPLBridgeExample_configurationFile.json, I see template.devices[4].properties.devices[0].joinStart == 3001, which I assume means that the EISC joins for the device in question starts at [dig | an | serial]-[i | o]3001, and stop wherever the device runs out of joins. Do these map directly to the device's corresponding SIMPL Windows symbol join numbering, or is that defined elsewhere? How do I figure this out or define it?

  • Additionally, the Wiki doesn't currently cover anything about how this works, and only provides some use-cases and general "why would I do this?" type of info.

  1. What console commands are available, and does a list of them exist? Never mind on this one. The list is in the wiki on the Debugging page.

I realize the documentation isn't very fleshed out yet, so I totally understand if the answer is simply "that's not documented yet". At the very least, my questions point out a few sticking points for me when attempting to understand the project for use in my own environment.

Also, if these questions would work better as GH issues, I can move them there.

3

u/[deleted] Feb 15 '20

We will work to get some better documentation for configurations in the wiki. For now, a device object has to have the following properties at it's top level:

  • group: usually a category like display or touch panel

  • key: unique key that allows other devices to find this one in the Device Manager collection

  • type: type name, for instance samsungmdc

  • properties: an object that contains the unique properties for the device. this is also where communication properties are defined.

The control object has some required properties, but what's required depends on the control method. The path for the control object is properties.control. Properties are:

  • method: type of control: "none", "com", "ipid", "ipidtcp", "ir", "ssh", "tcpip", "telnet", "cresnet", "cec", "udp"

  • tcpSshProperties; required when method is ssh, tcpip, telnet, or udp. This is an object with properties address (required), port (required), username (required for ssh), password (required for ssh), autoReconnect, autoReconnectIntervalInMs, and bufferSize.

  • comParams: required when method is com. This is an object with properties protocol, baudRate, stopBits, parity, dataBits, softwareHandshake, hardwareHandshake, and pacing. Only pacing is optional.

  • controlPortDevKey, used with com and cec methods. Key of the device that provides the com port or the HDMI port.

  • controlPortNumber: used for com method. Defines port number for device. For instance on an RMC3, there is a single com port, so 1 is the only valid option. For a DIN-AP3, 1 or 2 would work. This also allows for linking to devices like DM Receivers

  • controlPortName: used for cec method. Defines HDMI port name. Depends on device for naming. For example on a DM-RMC-SCALER-C, the output port would be hdmiOut

  • irFile: used for ir method. Just needs to be the name of the file, not the path.

  • ipid: used for both ipid and ipidtcp

  • cresnetId: used for cresnet

Other properties in the properties object will depend on the device. Hope that helps some.

3

u/geauxtig3rs Dopephish was on the grassy knoll Feb 15 '20

1 - this is a big one for me in documentation right now. I will say that as far as devices are concerned, the hardest configs are for a DM chassis. I'll try to get some simple ones built and posted here....the biggest things to look for are "type" and "group" then the properties.control objects. Most of it is super straight forward. I'm on mo ile, but next time I'm at a machine I'll put something quick to get her to explain.

2 - Every device in essentials has a JoinMap file that defines how things are laid out as far as joins are concerned. You are correct in assuming that the joinstsrt in the bridge is an offset for when you link a device to a bridge. Those files are in PepperDashEssentials.Bridges.JoinMaps

3 - each method can be called with parameters using the Json structure. Additionally you can set properties within the classes.

Documentation is being worked on, and feedback like this helps us flesh things out.

2

u/CanadubVR6 Feb 15 '20 edited Feb 15 '20

This is good feedback. I’ll be adding additional documentation and detail about how the SIMPL bridging an join maps work. Part of the reason for not flushing it out now is that what we released day one is what I call JoinMap1.0. I’ve already built JoinMap2.0 which completely supersedes the original mechanism and is self documenting (you can use console commands to print out what will be mapped on your EISC, in detail).

It’s gonna take some work to implement this and wholesale replace the existing join maps while maintaining backwards compatibility.

Also, tonight I added another repo which contains an example SIMPL program that works with the example Essentials SIMPLBridge config. I’ve updated the documentation to show how to do this and test. You can load that program to slot 2 and Essentials to slot 1 and it will be much clearer how the mapping works.

2

u/geauxtig3rs Dopephish was on the grassy knoll Feb 15 '20

Just so you are aware /u/CanadubVR6 is one of the primary contributors and maintainers for this repo. ive contributed, but leaned super heavily on him (and still do, which I think makes him ornery at me sometimes).

He's recently edged out Bill Shatner as my favorite Canadian.

1

u/CanadubVR6 Feb 15 '20

Regarding the example devjson commands, it might help to better understand the mechanism.

The devjson command allows you to call any public method on any Device class in the DeviceManager. You use the JSON formatted object to specify the name of the method you want to call and the arguments (if any) that method requires.

You use the Devmethods command to determine what methods are available on a given device as well as what arguments are required.

This mechanism uses reflection at runtime to look up and call the available methods.

The best part is that this works on any new Devices you might define in a plugin or in the core framework, without you having to to anything.

1

u/CanadubVR6 Feb 15 '20

And yes, whenever possible making this GH issues is preferable as we can track them and provide answers in the issue comments for the benefit of everyone 👍

2

u/thurstylark Kludge Artist Feb 17 '20

Awesome, in that case I'll transpose them over when I get the chance

Since my understanding of the project is still new, the only substantive contribution I can really make right now is to point out holes in the docs that keep me from further understanding. I hope that this comes across as helping instead of just criticism, because I am super happy to see an open source project of this magnitude for Crestron controllers. Essentials is exactly the type of bridge we need between the power of the equipment and the difficulty of programming it, so I am thoroughly excited for it to be useful to me and many, many others!

2

u/sumtastic Feb 17 '20

It is definitely helpful. We're all pretty close to it within PepperDash so outside review of documentation is definitely helpful to help us flesh it out. We're early in the process so any and all feedback is appreciated right now. I suspect that some of the feedback we'll get from people will be due to lack of familiarity with C# or OO Code, but even that will be somewhat helpful at this point so we can gauge what the audience is.

2

u/thurstylark Kludge Artist Feb 14 '20

Hoooooly crap, this is amazing!

Something like this is what I intended to build internally once I got far enough along with SIMPL# Pro, but it looks like I might not even need to go that far.

A large number of the systems we support are cookie-cutter classrooms that are based on a contractually-mandated template with modifications (very similar to the wiki's description of the EssentialsHuddleSpaceRoom). Keeping track of programs for these systems is an absolute nightmare, but keeping track of configs instead would be a fuckin GODSEND.

Thanks for this. I'm definitely going to see if I can get my employer to look at PepperDash Portal as well.

3

u/geauxtig3rs Dopephish was on the grassy knoll Feb 14 '20

THinking of it as a purely S#Pro platform ignores a huge portion of it, which is leveraging the dynamic nature of S#Pro and getting that capability into a simpl program, where you have a deeper pool of developers to draw from.

You can just use Essentials as a way to get all your hardware resources instantiated for your code, and just build everything for a Pro3 or RMC3 and be done with trying to maintain different codebases for different processor types...this includes DMPS units as well (they are supported in Essentials)

1

u/thurstylark Kludge Artist Feb 14 '20

Wow. Yeah, there's lots more documentation for me to read.

I can't believe something like this for Crestron systems is open source, but I'm thoroughly grateful that it is. Pass my thanks on to the devs!

2

u/CanadubVR6 Feb 17 '20

Any help pointing out gaps in documentation goes to helping more people understand the framework and hopefully using it and growing it. 👍

1

u/BassMasterJDL Feb 14 '20

Is that you Jason ? This seems like something you built

2

u/geauxtig3rs Dopephish was on the grassy knoll Feb 14 '20

Nope! We have a couple Jason's on staff. Both have contributed, but neither is the primary contributor and neither of them are on Reddit to the best of my knowledge!

1

u/BassMasterJDL Feb 14 '20

Gotcha , used to work with one of them for a bit

1

u/CanadubVR6 Feb 15 '20

I lurk.... from the Great White North, but rarely contribute, Trevor 😉

2

u/geauxtig3rs Dopephish was on the grassy knoll Feb 15 '20

Wouldn't that be some shit if I banned you for doxxing me ;)

1

u/Thoranus CCMP-G, CTS-I, CTS-D, CCNA Feb 15 '20

I’m reporting.

1

u/[deleted] Feb 21 '20

Thanks for sharing this.

1

u/Link_Tesla_6231 MTA,SCT-R/C,DCT-R/C,TCT-R/C,DMC-D-4K,DMC-E-4K,CORE,AUD, & FLEX Oct 04 '23

Sorry for resurrecting a OLD post, the only 3 questions I have is:

- If you use essentials, does the example VT Project work for your custom config files or only the sample config files. If not for your custom config files I assume you need to create your own VT Project. I guess this is what the Joins are for (to and from program)

-If you use PD Portal or any other paid addon, does it create VT Projects or would you still be stuck with creating your own VT Project, or can you use the example VT Project.

-In a video the guy mentions using PD Portal or "Another Config Tool" are there other config tools or are the only 2 options to manually create a config file or use PD Protal