Introduction
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, Nexmosphere sensors and actuators - known as "Elements" - can be incorporated in any Windows, BrightSign, or Android-based Intuiface experience using the Nexmosphere Interface Asset.
At the moment, Player Next Gen supports Nexmosphere Interface Asset on the same platforms: Windows, BrightSign, Android. The Nexmosphere IA can't be used when deplying an experience on the web.
This article explains the basics of Nexmosphere and how to incorporate Nexmosphere Elements in your own Intuiface projects.
Don't hesitate to consult the Intuiface | Nexmosphere setup guide!
You also might want to check out our Phidget Sensor article.
Marketplace Sample
If you have a Nexmosphere Demo Board DM-XN04 or DM-XC05, you can download this Explore Nexmosphere Sensors and Actuators sample from our Marketplace. The experience will work out of the box and enable to you test all the sensors & actuators of these demo boards directly in your Composer or Player.
How Nexmosphere Works
Simply put:
- a Nexmosphere controller connects to a Windows PC, BrightSign player, or Android device 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 the 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, simply add the Nexmosphere Interface Asset into your experience using Composer's Interface Assets panel.
Videos
To see how to use the sample available here in the Marketplace with demo boards you can get from Nexmosphere, you can look at this video:
To learn more about how to use the Nexmosphere Interface Asset in Composer, you can look at this one:
(Optional) Modifying the Nexmosphere Interface Asset
For most users, it is enough to use out-of-the-box capability shipped with the Nexmosphere Interface Asset. As noted above, simply add it to your experience using the Interface Assets panel.
However, the Nexmosphere Interface Asset code can be modified before adding it to your Intuiface experience.
Why modify it? Without modification, this interface asset can be used to exchange a single X-Script command with a single Nexmosphere Element. Through modification, you could have the interface asset send multiple, pre-defined commands to a single Element or a combination of commands to multiple Elements, all with a single action. simplifying the trigger/action approach in your experience.
The code for the Nexmosphere interface asset is found on GitHub. Instructions for modifying it can be found on that GitHub page.
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 a modified 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
Configuration
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. (Nexmosphere controllers can be daisy-chained, in which case only a single port will be occupied.)
To identify the port:
- Android - (Starting with Intuiface Player version 6.5.2)
- For devices with only one USB port, the port path will be /usb
- For each Nexmosphere IA that will be used in an Android-based experience, open the Properties panel and enter the port path in the "Serial Port Path (Android)" property. Here is what it looks like in the X-Ray Panel if the targeted port path is the default "/usb". (The value of the 'Serial Port Name (Windows)' property will be ignored.)
- BrightSign
- The port path will be "2"
- For each Nexmosphere IA that will be used with BrightSign devices, open the Properties panel and enter the port path in the "Serial Port Path (Android, BrightSign)" property. Here is what it should look like. (The value of "Serial Port Name (Windows)" property will be ignored.)
NOTE: On BrightSign, the Nexmosphere IA does not have the ability to detect if the controller was physically disconnected/reconnected. It is mandatory to have the Nexmosphere hub connected to any BrightSign USB port before powering up the device. Rebooting the BrightSign device after connecting the Nexmosphere hub also works.
- Windows
- Open Windows Device Manager and look in the Ports section 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.
- NOTE: The label "Prolific USB-to-Serial Comm Port" is a reference to the Windows driver used for the USB connection between a Windows PC and the Nexmosphere controller. When you first connect a Nexmosphere controller to your Windows PC, the device may not be recognized. Right-click the "Unknown device" entry, select "Update driver", and then choose the "Search automatically" option.
- NOTE: The label "Prolific USB-to-Serial Comm Port" is a reference to the Windows driver used for the USB connection between a Windows PC and the Nexmosphere controller. When you first connect a Nexmosphere controller to your Windows PC, the device may not be recognized. Right-click the "Unknown device" entry, select "Update driver", and then choose the "Search automatically" option.
- For each Nexmosphere IA that will be used in a Windows-based experience, open the Properties panel and enter the port name in the "Serial Port Name (Windows)" property. Here is what it looks like in the X-Ray Panel if the targeted port name is "COM1".
(The value of the 'Serial Port Path (Android, BrightSign)' property will be ignored.)
- Open Windows Device Manager and look in the Ports section 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.
Properties, Triggers, and Actions
Properties
- Serial Port Name (Windows) / Serial Port Path (Android, BrightSign): The name of the port on the target device for the desired Nexmosphere controller. The value of the property not applicable to the operating system of the targeted device will be ignored.
- 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. (This capability is not available on BrightSign players.)
- 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.
Triggers
- 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:
- TYPE
- ADDRESS
- FORMAT
- COMMAND
- 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.
Actions
- 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.
For example:
- Command: X001A[0]
- X-Touch Button Board
- Sent to button board -> Shut off all LED lights
- Sent from button board -> No buttons are being pressed
- X-Eye Motion
- Sent from motion detector -> No motion detected
- X-Touch Button Board
How to specify a particular Nexmosphere Element in a command
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[0], the address is '001', which is the first interface on the controller.
If using the XM-range controller, multiple controllers can be daisy-chained and thus connected to the same port. Pages 4 through 6 of the X-Script Serial API manual discusses addressing.
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!
Comments
0 comments
Article is closed for comments.