CWS: Part 1

One thing that always seems to come up during the C# labs at Masters is Crestron Web Scripting (CWS). I never think about adding this to my own projects, but it is a good way to provide some level of advanced configuration (or even remote control) of the running program. I’m watching the Intermediate C# videos this morning and see that the first lab dives right into using CWS. So in the spirit of Masters, let me try to incorporate some of their teachings into my day-to-day programming.

I’m hoping in this series of posts to build out a CWS program that can:

  • Work on 3-series and 4-series processors
  • Configure a room system
  • Provide a REST API for external control

Let’s begin!

Continue reading “CWS: Part 1”

Community Support

Like most mornings, I started today by reading through the Crestron Groups.io daily digest. It’s the spiritual successor to the old Yahoo message group. Reading through those posts really helped me out when I first started programming Crestron in SIMPL. I was already familiar with control systems (I’d been immersed in AMX for a couple years by that point), but coming to SIMPL from any other imperative programming language requires some different thinking. Lucky for me, there was a thriving community of professionals who were willing to share their knowledge and experience.

Continue reading “Community Support”

VC-4: Websocket-Sharp

The first version of my web console bastardized the Control Concepts module. Since we’re targeting the VC-4, we have unrestricted access to standard libraries that fall outside the Crestron sandbox. In this part, I’ll swap out WebsocketServer.dll for a NuGet package containing a WebsocketServer class instead.

Continue reading “VC-4: Websocket-Sharp”

VC-4: RHEL 8

The last time I wrote about VC-4, it was still based on Ubuntu 16.04. Crestron released an update around December 2020 that switched to Red Hat Enterprise Linux (RHEL) 8. I cut my teeth on Red Hat Linux 5, and once we had faster DSL Internet at home, I tried out a number of other Linux distros like Slackware, Debian, Gentoo, and finally Ubuntu. CentOS is a freely available version of RHEL, and the VC-4 installer claims to support either. So, in late December I decided I would create a new CentOS VM and try out the new version of VC-4.

Continue reading “VC-4: RHEL 8”

Merging .pacnew Files

I have a couple Linodes running. My mail server is powered by Arch Linux, and I always forget to check if new configuration updates need to be applied. I’m not a professional IT admin, so when things are working, I tend to leave well enough alone.

A quick way to locate configuration updates that were never applied is:

$ sudo find /etc -name '*.pacnew'

I throw a sudo on there because some folders in /etc are protected from prying eyes. This tells me I have several updates to Postfix I missed:

/etc/postfix/main.cf.pacnew
/etc/postfix/master.cf.pacnew
/etc/postfix/access.pacnew

Once I’ve found a file I want to inspect further, I can use vimdiff to interactively merge them:

$ sudo vimdiff /etc/postfix/main.cf{,pacnew}

This shell expansion will open up vim and compare the original (on the left) and the update (on the right). You can quickly move between differences using ]c (for next) or [c (for previous). To quickly copy the current change over, use do (diff obtain). I prefer to manually type in the updates if I spot any I need.

Now maintain those servers!

Does CH5 Need Webpack?

In the last post, I messed around with Webpack a little. Webpack is a tool that solves an inherent problem in JavaScript: modularity. Web developers have had to deal with finding ways to create large, complex applications using a language designed for quick, simple scripting.

In this post, I want to look at what Webpack does for CH5 development and do we actually need it.

Continue reading “Does CH5 Need Webpack?”

A Quick Guide to Webpack

Webpack is the build system for your CH5 project. Think of it like a compiler for web apps. It’s a really flexible tool, so there’s a lot of complexity to it. I was having some difficulty separating out only the pieces I needed to make a very bare-bones configuration. I’m sure I’ll have to revisit this topic later once I’ve gathered a bit more experience playing with it.

Continue reading “A Quick Guide to Webpack”