Category Archives: Software

Using NPM packages from RunSmart microservices

The RunSmart workflow environment uses node.js for it’s microservice system, and in addition to the built-in libraries it’s possible to install and use Node Package Manager (NPM) packages. This is incredibly handy, and this post briefly shows how to install these packages and consume them from RunSmart workflow scripts.

Note: It is of course possible pull down the code for npm modules and maintain native RunSmart libraries, and gives tighter control of the code running on your system. In practice however, this becomes a large task with anything than non-trivial npm packages due to the number of package references they tend to use.

Installing NPM Packages

To install npm packages, you’ll need to remote onto the server hosting your Windows Workflow Services installation. From this computer, open a node.js command prompt, and navigate to your installation directory for RunSmart (usually c:\Program Files (x86)\BASELAYER). This is the directory that will be used as the search path for node_modules, and if you look at the contents of this directory you may already have this directory present. If you don’t, no worries as it’ll be created when you install your first package.

To install a package, you can usually just run npm install <package name>. In the screenshot below I’m installing the TeslaJS package, which I use for monitoring my car.

Installing an NPM package to be consumed by RunSmart Workflow microservices

Using NPM Packages in your RunSmart Microservices

From your RunSmart microservice scripts, you can use the normal node.js require statement to bring in your libraries. The library loader will first look for a local (in database) script matching the require statement, and will afterwards search the node_modules directory.

Importing the npm module ‘teslajs’ (line 5 of the microservice script)

That’s all there is to it!

Building a Camera Tally Controller for Spyder

Over this past weekend I set out to create a camera tally device for the Spyder video processor.  Specifically, I wanted to try to use my relatively new Raspberry Pi 2 board running the Windows 10 IoT Core operating system to make something useful.  If you’ve read through my older blog posts, you’ve likely noticed that the Spyder is still my go-to target platform for playing with new technologies.  Let’s face it – when you’re playing with shiny new toys, it helps to mate it up with something you know very well so you don’t feel completely lost.  Before I get into the details, check out this brief video showing a working tally controller in action:

The whole process of building this device was simply fantastic.  The barrier to entry for people making hardware devices has gotten incredibly low over the past couple years, both from a cost and ease of development perspective.  The whole build process was very quick, and I had such a great time with it that I went ahead and put together a full 30 minute hardware and software video walk-thru for the project (more on this below).

Getting Started Making your own

To get started making your own, here are a couple links for the main hardware used on this project, as well as the wiring diagram for your reference.

Raspberry Pi 2 Kit ($70):  Amazon Link
8-Channel Relay Board ($9):  Amazon Link

Tally Wiring Diagram

Hardware Wiring Diagram for our Tally Controller

Links to the full source code, documentation resources, and a full YouTube walk-thru video are below.  This video has a ton of valuable information in there, covering the hardware specifics, Spyder implementation details, and the full process of creating our software application.  This is the first time I’ve gone through and made something this elaborate (and narrated the video), and I’ll be very interested to know what you think of it (so leave me a comment below if you’re so inclined).

GitHub Project (Source Code and Documentation):  Click Here

Next Steps

The tally controller we’ve created is certainly functional. but in it’s initial form the server IP address and tally source lists are hard-coded.  In the next stage of this project, we’re going to build a desktop application that can connect to the device remotely over the network and view/configure these properties.  We’ll also explore creating a user interface to run on the Pi’s HDMI output, which could be useful for monitoring and troubleshooting the device.

Until next time, take a look through those walk-thru video and the resources in the Github repository, and try to make one yourself.  I hope you enjoy going through this content as much as I enjoyed making it.

Spyder Client for Windows 8.1 – Live Control

One of my favorite areas working on in the Spyder Client for Windows 8.1 was the live view, which not only shows a real-time visualization of the Spyder server’s PixelSpaces, but allows for live interaction and command key creation. While it’s not necessarily new, I thought it would be fun to create a Camtasia video showcasing the live control available from the Spyder Client.  I certainly enjoyed making it, and I hope you enjoy watching it (and using it).

Under the Hood – Leveraging Spyder’s External Control

Internally, the Spyder Client uses the Spyder server’s publicly accessible external control protocol for all control actions performed by the application.  This is for a few reasons, one of the more notable of which is that Windows Store applications do not support .Net Remoting (which is how the Vista Advanced client communicates to Spyder).   If your curious how the Spyder Client is doing something you can simply check out the Spyder server’s logs to see what commands are being executed (see screenshot below).  Just make sure to set the server tracing level to information or success so that the command logs actually appear.  Of course, if you have a specific question, feel free to leave a comment under this blog post.  I’m always happy to help out a fellow coder.

Viewing remote server logs in Vista Advanced

Viewing remote server logs in Vista Advanced

Just in case you don’t already know, the external control protocol documentation is included with the installation of the Vista Advanced client software. If you have Advanced installed, then the external control protocol PDF document is already available from your start menu.

First App in the Windows Store (Yes it’s another Spyder Client)

Historically, when I’m taking a new platform or development tool out for a spin, I end up creating a control client for Spyder.  It’s nice to be able to work against a well-known and well-understood platform, so you can focus on the new and exciting stuff.  In this case, which is no exception, I fired up a Windows Store application targeting the Windows 8.1 platform.  In all truth, I think I started this about 5 months ago, however the project didn’t make real traction until the week of Christmas this year (which I took off from work).  I put forth a hard goal of getting the application into the store by the end of that week, in hopes that I wouldn’t aimlessly squander away my week at home.  At the end of the week, a new application had indeed been introduced to the store, and while it’s pretty ‘fresh’ I’m proud of the results so far.

Check out the app’s official page on this site here

Check out the app and download it from the Windows Store here

Feature Set on Day One (What’s there and what isn’t)

Getting something into the store on a compressed timeline is tricky, and there are always a lot of features that get dropped.  I’ve been reading The Lean Startup, and one of the concepts reiterated regularly is the concept of getting something out there early to collect feedback to iterate against.  Waiting too long for something to be perfect (which isn’t a real thing) means that you can spend an inordinate amount of time working on features that people don’t care about.  This is pure waste, and in a project like this where all development is happening in my free time, there simply isn’t time for waste.  All that being said, here are the features as they exist on day one, and my current view of where they could go in the future.

Note that this is my list, and I’m providing it to you in hopes of hearing some of your feedback.  Tell me what is and isn’t important to you, and together we’ll be able to make this app better.

Main Screen

 

Home Screen

The main screen is the landing page for the application when opened, and displays all servers available on the network, each with a thumbnail sized live view and launch buttons to command keys, function keys, and still image pages.  The functionality is pretty straight forward, so I won’t list out what is there in more detail here, but there are a few things that I would really like to see go into a near future version of the application:

Planned Main Screen / General App Features

  • View of system health / user diagnostics (with launch button to a health screen)
  • Ability to select any of the buttons and open their associated pages in a new window, allowing multiple views to be displayed simultaneously.  This could be a big deal for multi-monitor users, and opens up more complex control and monitoring scenarios for even single monitor users.
  • Sources view / list, showing thumbnails and tally status.  Used in combination with the previous feature bullet, this could allow for drag-drop support onto the live view

Live View

Spyder Client - Live View

This is effectively a display simulator view, designed to give a real-time view of the system’s PixelSpaces and layers using thumbnails pre-configured in Spyder.  Creating a full-featured simulator brings a number of complexities, and this control is very primitive by the standards of the simulator in Vista Advanced.  The live view control will undoubtedly be the benefactor or the majority of near future development work as a result, and to get the most bang for the buck I’ve re-used this same control to provide thumbnail visualizations for command keys and the thumbnail view on the main page.

Live View Features on Day One

  • Preview / Program PixelSpaces
  • Solid Color Borders with bezel luminance offsets
  • Thumbnails for PixelSpaces and Layers
  • Smooth motion views of layers and background transitions

Planned Live View Features

  • Full bitmap borders and shadows
  • PixelSpace Stackups (different view configurations for PixelSpaces)
  • Layer number indicators
  • Interactive control (layer pinch resize, reposition support)
  • Drag/Drop support for sources / stills

Command Keys View

Command Keys

The live thumbnail view within the command keys page is (in my humble opinion) the most interesting feature within the application.  This works extremely well at showing what-if scenarios for recalling relative command keys, but is very limited today by the general render capabilities of the live view control used to generate thumbnails.  I don’t think I can understate this; the renderer is pretty feature light and falls down quickly when showing more than the most basic of looks.  As stated previously though, this will gain all the development benefit of work applied to the live view, and so I think it’s only a matter of time for this to get flushed out.

Command Key Features on Day One

  • Displays user defined register colors for command keys
  • Groups buttons by existing user defined pages
  • Live generated preview of ‘Program’ (Cue 1) look for command key
  • Absolute / Relative Indicator
  • Preview / Program tally indicators

Planned Command Keys Features

  • PixelSpace stackup switching
  • Ability to turn off live view integration with thumbnail previews.  Not sure if anyone would actually want this feature – seems to me like once you have a feature like this you would never want to turn it off (would love your feedback)
  • Option for different button sizes to condense more command keys onto the screen
  • Pinch zoom support to jump between pages quickly
  • 320 pixel wide snap view support
  • Link to a full script grid view showing all command key cues with individual thumbnail previews.  I have a lot of thought into this, and will probably need a blog post all it’s own to describe further.

Stills View

Stills Viewer

The stills view came about early on as a side effect of needing to validate the image file processor / transport software, but was handy enough to keep around.  The Advanced client has the ability to obtain thumbnails from the server in a round about way (once you’ve seen them in the simulator they are cached locally in the ‘C:\Spyder\Images’ folder on your PC).

Stills View Features on Day One

  • View all Still images defined in the Still registers list on the Spyder server in thumbnail form
  • View a full screen view of all images by clicking a thumbnail
  • Ability to save image files locally via the app bar
  • Ability to share one or more selected images using the ‘Share’ charm in windows

Planned Stills View Features

  • Native shape file viewer (custom bitmap border shapes)
  • Native shape file creator, with the ability to simply draw a shape on screen and have it saved onto the Spyder server as a shape file.  This would have the ability to load an image into the background to be used as a stencil, and additionally preview the resulting shape at a number of different source aspect ratios.
  • Different thumbnail sizes to show more thumbnails on the screen at once

Function Keys View

Function Keys

I think the Function Keys view is off to a good start; it works (which helps), and it’s approach of showing a very brief text description of it’s execution action makes it easy to see what the button will do before you actually press it.  An interesting note about function keys:  the Spyder data model actually has support for custom register colors for function keys, but this is not brought forward into the Vista Advanced interface.  The Spyder client has support for displaying custom register colors as it does in the command keys view, and so this will auto-magically start working if this becomes implemented in Advanced in the future.

Function Key View Features on Day One

  • Display of Function key names
  • Display of the type of command key
  • Short text describing the action which will be performed when the key is executed (limited to one line of text, may be clipped depending on things like the number of layers affected)

Planned Function Key View Features

  • A pseudo-tally feature which would evaluate the state of the system and show a red tally indicator if the function key appeared to be in it’s executed state.  An assign source function key, for example, would show a program tally indicator if it’s associated source was already assigned to it’s target layer(s)
  • Relative layer recall support.  Function keys with relative layer/device assignments require the layer/device IDs to be specified at the time of recall, and currently there is no way to provide these when executing a relative function key from the Spyder client.
  • Option for a more compact view of buttons to display more function keys on the screen at once
  • Pinch zoom to quickly navigate between pages

Again, the planned features are on my wish list based on what I think would be great additions.  It’s entirely possible that I’m missing the boat on functionality that I’m just not thinking about, and if you think that’s the case then I’d like to hear from you.  Please leave your comments on this post, and in general let me know what you think of the app.

In a future post I’ll talk about the back-end development, project management, and source control technologies, and possible future directions for the platform.

 

Making a great desktop PC from your Surface PRO

Microsoft’s Surface PRO is a great tablet / laptop device, but for me a problem has always been transitioning away from my home desktop during travel onto a mobile device.  Compounded with the sheer number of PC/Tablet/Laptop/Ultrabook devices I have going, it’s a recipe for pain.  Well friends, there is good news; I found a  Targus USB 3.0 docking station on Amazon which allows you to connect up to 3 additional monitors to your Surface PRO (or other USB 3.0 capable ultrabook / laptop), and it works great!

Targus USB 3.0 Docking Station (ACP70USZ)
https://www.amazon.com/Targus-Docking-Station-Ultrabooks-ACP70USZ/dp/B005YR1PV2

Surface PRO Desktop

I’ve already torn down my old home PC, and moved to using this as my main home desktop PC.  It’s slick – runs faster than the AMD based desktop it replaced, adds a third touch-enabled screen to my traditional dual-monitor setup (nice development plus), and when it’s time to take it with me I just disconnect power and a single USB cable.

Some Windows 8.1 Specific Nice-ities

Natrually since it’s shiny and says Microsoft, I’m running the preview of Windows 8.1 that came out a week or two ago.  This adds some really nice benefits for this Surface desktop of scenario over previous versions of windows that I thought I’d take a minute to mention.

Note:  If your running Windows 8.1 with the Targus docking station, you’ll need to visit the displaylink.com website to download new drivers for the external displays.  Luckily they had drivers for 8.1 within a week of the preview being announced – kudos to them!

First off, it supports independent scaling ratios for each of the monitors, which is a big deal when you have a high DPI device like the Surface PRO connected with some standard 96 DPI monitors.  With all previous versions of windows, stuff would either look really small on the surface PRO or really big on the other monitors, depending on which scaling option you set for Windows.  This is nice addition to Windows, and it works really well in practice.

Secondly, and in my opinion more importantly, it expands support for more Windows store / metro style  / modern apps running concurrently on your desktop, at user definable sizes.  No more single store app with maybe one more snapped to the left or right of that app.  Now you can have multiple store apps running side by side and resize them as you like, and you can even have store apps on each of the different monitors.  Apps can even open other apps in new ‘windows’ or add additional window instances of their own app (think new windows for tabs in IE).  This is another great addition, and I think that with this the Windows Store style applications will become naturally interwoven in people’s daily desktop usage.

Overall I’m super excited about this setup, and I recommend it to everyone.  Be aware that Windows 8.1 is in preview and does have some quirks, so if your not into the pre-release scene (don’t feel bad just because I think your weird) then wait until the August RTM.