Skip to content
  • There are no suggestions because the search field is empty.

UDP, TCP. REST Subscriber

Receive UDP messages from the SignMetrix app to trigger content or create events in your CMS.

The SignMetrix Subscriber functionality allows CMS platforms and device manufacturers to receive real-time events/triggers generated by the SignMetrix App and Sensors.

In this document, you will find:

  • Sensor Behaviors:
    • SmartTag
    • SmartBright
    • SmartDoor
  • How to Define Subscriber
  • Subscriber JSON Models
  • How to Set The SignMetrix App to Work in the Background

Complete these steps to gather events.

  1. SignMetrix App and sensors must be active.
  2. The SignMetrix App must be connected to the internet and running.
  3. SignMetrix Subscriber must be set to the stand your device is assigned to.
  4. REST, TCP, or UDP servers must be active to receive messages.

 

  • Sensor Behaviors

          1. SmartTag_Lift & Learn Sensor ( PNW )

As soon as a SmartTag, which is assigned to the defined stand, is picked, the PICKSTART event is sent to the defined server. When the user puts the SmartTag down, the PICKEND event is sent.

                   Motion Detection:
    • When SmartTag is lifted, the sensor sends a PICKSTART message.

    • When SmartTag is put back, the sensor sends a PICKEND message.


                      2. SmartBright _ Light Motion Sensor

The Light Motion Sensor detects both changes in light levels and motion.

                   Motion Detection:
    • When motion is detected, the sensor sends a PICKSTART message.

    • When the motion ends, the sensor sends a PICKEND message.

    • The format for these motion-related messages is the same as the SmartTag message format.


    Light Level Change Detection:

    • When a change in light level is detected, the sensor sends a message in a different JSON format, depending on the subscriber's settings.

    • An example of the light event message is as follows:

{

    "smartbox": "C42AFE000407",

    "tag": "F233FA174C7A",

    "action": "GETLIGHTMOTION",

    "lightLevel": 400

}

                     3.SmartDoor _ Door Sensor

The SmartDoor detects when the door is opened and closed.

                     Motion Detection:
    • When the door is opened, the sensor sends a PICKSTART message.

    • When the door is closed, the sensor sends a PICKEND message.

    • The format for these motion-related messages is the same as the SmartTag message format.
  • How to Define Subscriber

  1. Log in to the web panel from panel.signmetrix.com

  2. Click the Stands menu.
  3. Click on the stand you want to receive events from.
  4. Click on Actions > Manage Subscriber button.
  5. Select Message Type as ACTION_PRODUCTCODE 





There are four types of servers you can use to get events.

1) TCP Server:  Enter the TCP server address and port to the Subscriber Endpoint.

E.g.:   127.0.0.1:9001

Every message ends with \n character to separate messages.

2) UDP Server:  Enter the UDP server address and port to the Subscriber Endpoint.

E.g.:   127.0.0.1:9002

Every message ends with \n character to separate messages.

To broadcast the messages to every device in the network, 255.255.255.255:9002 can be entered. To broadcast a smaller network, a subnet local broadcast address can be used, such as 192.168.1.255:9002.

3) REST Server: Enter the Rest server address to the Subscriber Endpoint. It must be a POST method receiving text/plain content type.



4) Android Broadcast: Broadcasts a message within an Android device, which can be received by a Broadcast Receiver. 

BroadcastReceiver subscriberBroadcastReceiver = new BroadcastReceiver() {

    @Override

    public void onReceive(Context context, Intent intent) {

        if (intent != null && "com.signmetrix.SUBSCRIBER_MESSAGE_RECEIVED".equals(intent.getAction())) {

            String message = intent.getStringExtra("message");

            Log.i(TAG, "[onReceive] Received: " + message);

        }

    }

};

context.registerReceiver(subscriberBroadcastReceiver, new IntentFilter("com.signmetrix.SUBSCRIBER_MESSAGE_RECEIVED"));

          

Note: If you use more than one stand definition for your customer, please repeat the setting process for every stand you create. Alternatively, the SignMetrix support team can assist you with onboarding for mass deployments. support@signmetrix.com

 

If you select 'Security Enabled', the messages will be encrypted using the AES 256 symmetric algorithm in Base64. A 32-character security key must be given to receive encrypted messages. On the server side, the message must be decrypted before it is processed.

 

https://www.devglan.com/online-tools/aes-encryption-decryption can be a sample site for decrypting messages. Input Text is Base64, Select Mode is ECB, and Key Size is 256 bits.

 

  • Subscriber JSON Models:

There are two message types:

1) ACTION_PRODUCTCODE

2) STANDART

 

1) ACTION_PRODUCTCODE Message Type

 

We recommend using this message type for simple event triggering. 

It is not composed of an array, and it only contains the action field. The following JSON messages are sent. ( This JSON Model requires SignMetrix software version 2.27.0 or higher) 

 

"PICKSTART-PRODUCTCODE"

The Product Code in the"text string" is the same Product Code number that is defined in the SignMetrix Panel, as shown below in the yellow box.



For pick start event:  

{"action": "PICKSTART-99"}

 

For pick end event: 

{"action": "PICKEND-99"}

2) STANDART Message Type

 

The message contains a JSON string composed of an array of product info.

ProductInfo object contains these fields.

  

ProductInfo {

   String smartBox; // Identity of the smart box

   String smartTag; // Identity of the smart tag

   String action; // Action name: PICKSTART or PICKEND

   Long standId; // Id of the stand

   String stand; // Name of the stand

   Long storeId; // Id of the store

   String store; // Name of the store

   Long productId; // Id of the product

   String product; // Name of the product

   String productCode; // Product code

   String imageUrl; // Image URL of the product.

   String videoUrl; // Video URL of the product.

   String websiteUrl; // Website URL of the product.

   String salesUrl; // Sales URL of the product.

}

 

SignMetrix STANDART subscriber model sample in JSON format: 

Note: JSON messages are sent as an array. Multiple messages can be taken at once.

[{

"smartBox": "C42AFE000407",

"smartTag": "A233FA174C7A",

"action": "PICKSTART",

"standId": 4671,

"stand": "Demo Stand",

"storeId": 34235,

"store": "Demo Store",

"productId": 34123,

"product": "XT Product Line",

"productCode": "XT-Product-Line",

"imageUrl": "https://cdn.picknwatch.com/acdn1/assets/pnw/ASSET/12/PRODUCT/788/4788_4953_PicknWatch.jpeg",

"videoUrl": "https://cdn.picknwatch.com/acdn1/assets/pnw/ASSET/12/PRODUCT/788/4788_3860_PicknWatch.mp4",

"websiteUrl": "https://www.brightsign.biz/",

"salesUrl": "https://www.brightsign.biz/digital-signage-products/XT-product-line"

}]



[{

"smartBox": "C42AFE000407",

"smartTag": "A233FA174C7A",

"action": "PICKEND",

"standId": 4671,

"stand": "Demo Stand",

"storeId": 34235,

"store": "Demo Store",

"productId": 34123,

"product": "XT Product Line",

"productCode": "XT-Product-Line",

"imageUrl": "https://cdn.picknwatch.com/acdn1/assets/pnw/ASSET/12/PRODUCT/788/4788_4953_PicknWatch.jpeg",

"videoUrl": "https://cdn.picknwatch.com/acdn1/assets/pnw/ASSET/12/PRODUCT/788/4788_3860_PicknWatch.mp4",

"websiteUrl": "https://www.brightsign.biz/",

"salesUrl": "https://www.brightsign.biz/digital-signage-products/XT-product-line"

}]







  • How to Set The SignMetrix App to Work in the Background

To run the SignMetrix application in the background and send you triggers, follow the steps below:

  1. Click the Devices menu
  2. Click on the device from the grid
  3. Click on the settings button.
  4. Select "No Display Mode" 
  5. Select "Minimize On Idle" to true.
  6. Click OK.
  7. Click Update.

 

The device will get the new settings and will be started in the background in about 3 minutes.

Repeat these settings on all your devices for which you want to set the SignMetrix app to work in the background.



 ✅ It's done. When a product is picked up, the SignMetrix system will send a trigger message to the network. 

 

BrightSign - PNW SmartBox UDP Message Integration Model.

There are two ways to send UDP messages to BrightSign Players.

  1. Over Local Area Network (LAN)
  2. Over USB-C to Ethernet Connector.
1 - Over LAN Local Area Network

BrightSign Player(s) and the PNW SmartBox must be on the same LAN for UDP communication. The BrightSign player can be set up to listen for UDP messages from the PNW SmartBox. When a SmartBox is triggered, it sends a UDP to the network. The BrightSign player listens for UDP messages. Once a message is received, the BrightSign software parses the UDP. Once the message is parsed, it can be used as a trigger event in the BrightSIgn presentation.

The PNW UDP message contains more information than is needed to trigger an event. To use a specific piece of information in the UDP message, you can use a wildcard to parse the specific information you need, i.e. listen for UDP  “message_<any>" and then put the wildcard <any> information into a user variable. Use the variable to play a clip in an onDemand state. 

Please visit https://brightsign.atlassian.net/wiki/spaces/DOC/pages/370671898/UDP+Input for more wildcard information.

2 - Over USB-C to Ethernet Connector.

In cases where the BrightSign player is network connected, but the PNW SmartBox is not, you can use the BrightSIgn RJ45 to USB adapter (CBL-USBC-RJ45 RT) to connect the SmartBox to the BrightSign player. This adapter, with a software plugin, allows the SmartBox to connect to the internet through the BrightSign player’s network connection.

  1. Connect the USB adapter to the BrightSign player and the SmartBox.
  2. Add the pizza.brs plugin to the BrightAuthor presentation. This plugin enables the ethernet to USB connection.
  3. To use the UDP data from the SmartBox, follow the steps in the “Over LAN Local Area Network” section above.