NOTE: Local Network Triggers are only supported on Windows PCs.
Introduction
Have a third-party sensor, peripheral, or software package and wish to use that device/service to trigger actions in Intuiface? If so, use the Local Network Trigger.
This trigger - known as "Message is received" and accessible through an interface asset - listens for messages sent from external devices and services like motion detectors, RFID readers, and bar code scanners. The contents of the message can be used to determine whether actions should be taken and/or how to configure those actions.
This trigger is a complement to remote actions. Remote actions enable one Intuiface experience to triggers actions in another experience. With local network triggers, the trigger source is a third-party device or service.
NOTE: This article concerns scenarios in which Intuiface Player is either located on the same device as a peripheral/software or in an environment with no Internet access. If Internet access is available, use Intuiface's Web Triggers API instead as it is more flexible.
How it works
The local network trigger mechanism is based on the HTTP protocol and the ability of Intuiface Player to operate as a simple web server.
- Step One: Have your service/device send a GET or POST request using the IP address or hostname of the device running Player (depending on your network configuration) and port 8000. This request can contain up to four values. The message will look like this:
http://[IP_Address_of_PC_Running_Player]:8000/intuiface/sendMessage?message=xxxx¶meter1=yyyy¶meter2=zzzz¶meter3=aaaa
. -
All four parameters - message, parameter1, parameter2, parameter3 - are optional.
Examples:- Send a detected RFID tag ID to Player running on the same device used by the RFID/NFC reader:
http://127.0.0.1:8000/intuiface/sendMessage?message=tagDetected¶meter1=1234
- Sending a detected gesture to a device located on the same local network:
http://192.168.1.2:8000/intuiface/sendMessage?message=gestureDetected¶meter1=swipeLeft
- Send a detected RFID tag ID to Player running on the same device used by the RFID/NFC reader:
- Step Two: On the Intuiface side, add the "Local Network Triggers" interface asset to your experience.
Then add the trigger "Message is received" associated with the Local Network Triggers interface asset.
For that interface asset, in the parameters section of the Message is received trigger, specify the scene scope - either an individual scene, a set of scenes, or the entire experience. (For information about experience-level triggers, see here.)
The Message is received trigger has one "Message" parameter and - accessible via binding (see below) - three read-only parameters: "Parameter 1", "Parameter 2", "Parameter 3". You can use conditional triggers based on the values of these parameters to further constrain when this trigger will be raised.
In the following image, both "TagReceived" and "123" must be received for the trigger to be raised:
By leaving the "Message" field blank and applying no conditionals, you're stating the trigger should be raised for all values received by this "Message is received" trigger.
Accessing parameter values
Received trigger parameter values are accessible via binding. In the following example, we're assigning the value of "Parameter 1" to a conditional for the "Message is received" trigger. This binding can also be used elsewhere in the experience. For example, a parameter value could be assigned to a Text Asset.
NOTE: If you don't set up a conditional, the "Message is received" trigger will occur for all possible parameter values. This rule also applies to messages with no parameter values if your "Message is received" trigger does not use conditionals.
Sending messages
The Local Network Triggers mechanism can also be used to send messages to other Players located on the local network. With this ability, you can
- test your use of the 'Message is received' trigger by sending messages from an experience built just to generate messages
- coordinate actions between multiple experiences in a live deployment
NOTE: This ability to send messages is only available in Player on Windows and in Composer.
The "Send message" action
The "Send message" action is the one and only action exposed by the Local Network Triggers interface asset:
- Device Name / IP Address Enter either the name or IP address of the device running the targeted Player. A port of 8000 will be assumed. If a different port is required, add it to the device name or IP address reference.
- Message / Parameter 1 / Parameter 2 / Parameter 3 Optional parameters
NOTE: For reversed functionality of Local Network Triggers, you can use Call URL actions to communicate with any third-party application. For more details check the Call URL dedicated article.
Comments
0 comments
Article is closed for comments.