Nexmosphere manufactures a wide range of small form factor devices that either trigger, or are triggered by, external events. Trigger devices include buttons, pick-up sensors, and presence detection, while triggered devices include lighting, audio, and video players. Collectively, on Windows PCs, Nexmosphere devices - known as "elements" - can be incorporated in any Intuiface experience using the Nexmosphere Interface Asset.
This article explains the basics of Nexmosphere and how to incorporate Nexmosphere elements in your own Intuiface projects.
How Nexmosphere Works
- a Nexmosphere controller connects to a Windows PC via a USB cable
- one or more Nexmosphere elements connects to a controller
- a proprietary X-Script command language is used to communicate with, and receive messages from, an element
X-Script commands rely on a classic serial communication protocol so no custom drivers are required. As a result, controllers and elements are plug-and-play, only requiring third parties like Intuiface to open the serial port and then send/receive commands.
To do this with Intuiface, use the Nexmosphere Interface Asset
Adding the Nexmosphere Interface Asset into your experience
The Nexmosphere Interface Asset is found on GitHub. Without modification, this interface asset (IA) can be used to exchange X-Script commands with any Nexmosphere element. However, its availability on GitHub enables developers to create customized versions.
Custom modifications could include the combination of commands for several Nexmosphere elements into a single action.
NOTE: Intuiface will not provide technical support for third-party modifications of the interface asset. However, at its own discretion and without any commitment, Intuiface may release its own enhanced versions of the IA in the future.
To add the Nexmosphere Interface Asset into an Intuiface experience, follow these steps:
- Close all running instances of Intuiface Composer.
- Download the latest released package of the interface asset.
- Extract the archive, open the resulting OutputInterfaceAsset folder, and copy the Nexmosphere folder to the path "[Drive]:\Users\[UserName]\Documents\Intuiface\Interface Assets".
- Launch Intuiface Composer and open your project.
- Open the Interface Assets panel and select the Add an Interface Asset option. When you enter "Nexmosphere" (or just a portion of that word) in the search bar, you should see the Nexmosphere Interface Asset.
- Add it to your project.
Using the Nexmosphere Interface Asset
The only necessary configuration step is to specify the port used by a particular Nexmosphere controller. For each controller, and thus for each port, a separate instance of the Nexmosphere Interface Asset is required.
To determine the port name, open Windows Device Manager and look for the port connected to the Nexmosphere controller. The port name contains the letters "COM" followed by a number. In the image below, the port name is COM8. (The label "Prolific USB-to-Serial Comm Port" is a reference to the Windows driver used for the USB connection between the Windows PC and the Nexmosphere controller.)
For each IA, open the Properties panel and enter the port name in the "COM / Serial Port Name" property. Here is what it looks like in the X-Ray Panel if the targeted port name is "COM1".
Properties, Triggers, and Actions
- COM / Serial Port Name: The name of the port for the desired Nexmosphere controller.
- Auto reconnect: Toggle whether or not Intuiface should attempt to reestablish a connection between the experience and the Nexmosphere controller if the connection is lost. A disconnect could occur if the USB cable is unplugged and then reconnected, or if the controller is powered off and then back on.
- Is connected: (read-only) True/false identifier for whether there is an active connection with the controller.
- Activity log: (read-only) A time-stamped list of X-Script commands sent and received, as well as error messages if badly formatted commands are sent from Intuiface.
- X-Script Command: Listens for an incoming X-Script command over the associated port. When a command is received, its contents are available as the following read-only properties:
- X-Script Command (full line)
This is the full command, a combination of the four command elements listed above. See the X-Script Command Syntax section below.
- Connect the Nexmosphere device: Try to establish a connection with the Nexmosphere controller on the associated port if one doesn't exist.
- Disconnect the Nexmosphere device: Stop the connection to the Nexmosphere controller on the associated port.
- Send X-Script command: Send a command by independently specifying Type, Address, Format, and Command separately. (See the X-Script Command Syntax section below.) Brackets are automatically placed around the command. If the command is poorly formatted, Intuiface will not send the command, recording this failure in the Activity Log property.
- Send X-Script command line: Send a command using the complete command line. The result is no different from the use of the "Send X-Script command" action mentioned above. If the command is poorly formatted, Intuiface will not send the command, recording this failure in the Activity Log property.
X-Script Command Syntax: An Overview
X-Script commands are a proprietary language universal to all Nexmosphere elements. Commands are a structured sequence of characters with the following pattern:
TYPE ADDRESS FORMAT [COMMAND]
The following comes from the X-Script Serial API Manual:
Commands are not unique for each element. Instead, each element interprets the same commands differently. The same commands are also used to represent different messages depending on whether they are sent to or received from a Nexmosphere element.
- Command: X001A
How to specify a particular Nexmosphere element
More than one element can be connected to the same controller. Each element is connected to an independent controller "interface" and each interface has a unique address. The second field of an X-Script command contains the address, thus every command encodes which element is the target of the command.
For example, in the command X001A, the address is '001', which is the first interface on the controller.
Testing Nexmosphere devices and the X-Script command language
The Nexmosphere Interface Asset includes a default data template enabling you to work with all properties, triggers, and actions in a running Intuiface experience so you can test it out in real-time.
To add the default data template into your experience, just drag the IA from Composer's Interface Assets panel and into your experience. It will look like the following. Enter Play Mode and try it out!