The Monitor Sync Section
Monitor Sync
Monitor Sync is a feature that allows the player to periodically synchronize local copies of files with their remote sources over HTTP or FTP. Typically, this feature is used to fetch small data files containing time-sensitive information such as weather or stock quote information.
The Monitor Sync section contains two tabs:
- URLs – Allows you to configure which files to synchronize. For an in-depth tutorial, see Synchronization Monitor.
- Core – Controls the global monitor sync behavior.
Note: This section is one of several under Configuration Profile Properties for players. For general information, see Configuration Profiles - Players. For edge server profiles, see Configuration Profiles - Edge Servers.
The Monitor Sync feature provides a way for operators to identify and communicate with their Broadsign Control Players using cookies.
It is possible to configure Broadsign Control Players to retrieve files from external third-party HTTP servers, for example, lotto winners or weather feeds. These servers sometimes use cookies to preserve information between calls. The Monitor Sync features allow users of external third-party HTTP servers to take advantage of this standard HTTP feature. For example, the remote source can send a cookie such as a Session Id via the Broadsign Monitor Sync protocol. The Broadsign Control Player will reuse the sent cookie in the subsequent requests.
HTTP cookies received in an HTTP response header by Monitor Sync requests will be sent with the following HTTP calls to the same domain. The path and expiry of the cookie will be respected if set.
Also note that:
- Cookies will not be sharable with HTML packages nor Web redirects
- Cookies will not be sharable with FTP remote folder syncing
Example
This section details an illustrative scenario.
- The cookie will be returned in the
Set-Cookie
header of the Monitor Sync response, with the following format: - On subsequent requests, Monitor Sync will send the
Cookie
header with the following value: - When a new session is started, the next Monitor Sync response will return the
Set-Cookie
header containing a new cookie. This new cookie should then replace the old one. - The Monitor Sync component of Broadsign receives the cookie and is the only component that requires access to the cookie.
SESSIONID=ztu968v9pw5ghESE; Path=/; Secure; HttpOnly; SameSite=Strict
SESSIONID=ztu968v9pw5ghESE
The URLs tab contains all the information about the files that are synchronized by Monitor Sync. When adding a new URL, you can specify an http or ftp source.
For an in-depth tutorial, see Synchronization Monitor.
In the URLs tab, you can toggle between basic or advanced mode:
- Basic mode – Presents a graphical user interface.
- Advanced mode – Can be useful if you want to copy and paste a complicated configuration into another without having to recreate it through the interface. See Advanced Mode.
To open the Synchronization URL dialogue box, click Add.
The following settings are available:
- Remote URL
- Destination Path
- Append Player ID to Remote URL
- Append Location Code to Remote URL
- Use URL Variables
- Synchronization Options
- Scripting Options
Remote URL
- Description – The web address of the remote server from which to retrieve information.
- Requirements – Must start with either http://, https://, or ftp://.
- Encoding Credentials – Usernames and passwords can be encoded directly in the URL.
Example: http://username:passwd@test.com/test.xml.
Destination Path
- Description – The local path on the player system where synchronized content is stored. The path can be either relative or absolute.
- Absolute Path – Ensure that the Broadsign Control Player user has read/write permissions on this folder.
- Relative Path – The content is synced into the player’s application data path, which is in one of the following locations:
- Windows 10 dedicated player – C:\ProgramData\BroadSign\bsp\share\bsp\sync
- Windows 10 non-dedicated – C:\Users\[USER_NAME]\AppData\Roaming\BroadSign\bsp\share\bsp\sync
- Windows 11 dedicated player – C:\ProgramData\BroadSign\bsp\share\bsp\sync
- Windows 11 non-dedicated – C:\Users\[USER_NAME]\AppData\Roaming\BroadSign\bsp\share\bsp\sync
- Linux – /opt/broadsign/suite/bsp/share/bsp/sync
Example: c:\something
Note: If you are using the SmartFeed feature, this path is mandatory. If no specific path is required, put the current directory (".").
Append Player ID to Remote URL
- Description – Dynamically alters the URL based on the player’s ID. This allows you to target specific players by including the player's unique ID# in the URL.
- FTP Example:
- Original FTP URL – ftp://test.com/files
- New URL – ftp://test.com/files/12345
where 12345 is the ID of the player fetching the URL
- HTTP Example:
- Original HTTP URL – http://test.com/test.xml
- New URL – http://test.com/test.xml?player_id=12345678
where 12345678 is the ID of the player fetching the URL
Append Location Code to Remote URL
- Description – Dynamically alters the URL based on the location code. This allows you to target specific screens by appending their location code to the URL.
- FTP Example (with "YUL" location code):
- Original FTP URL – ftp://test@test:wether.example.com/test
- New FTP URL – ftp://test@test:wether.example.com/test/YUL
Note: If you have enabled both Player ID and Location Code appending, Broadsign Control Player will append the location code first and then the player ID. For example: ftp://test@test:weather.example.com/test/YUL/123456/
Use URL Variables
- Description – Dynamically transforms the URL requested by Broadsign Control Player using content variables. Refer to Content Variables for a list and description of the variables available.
- Format – Variables are identified with {{variable_name}}.
- All automatic variables, as well as player and/or display unit variables, can be used and follow the same rules for inheritance.
- Variables related to the content playing are excluded (frame_id, frame_resolution, ad_copy_id, campaign_id).
- The variable replacement can happen anywhere in the URL, except the protocol.
- It is possible to have multiple variables in the same URL.
- For example, if the remote URL is http://cdn.test.com/audience/{{display_unit_id}}.csv and the player's display unit ID is 33333, the URL requested by the player will be: http://cdn.test.com/audience/33333.csv.
Synchronization Options
Protocol
In Configuration profiles v13.2+, this setting defines the protocol to use when synchronizing folders. Available protocols are FTP and HTTP/HTTPS.
The Sync behavior options differ according to the protocol selected. FTP is the default protocol value.
Warning: Exercise caution when using the Sync behavior options. Files and folders that exist in the destination path that do not exist on the remote FTP server will be deleted. For this reason, a destination path of "c:\" will effectively destroy your OS. Please be careful.
Sync Behavior
How synchronization is applied. You can select one of the following options:
- Sync file – Copies a specific remote file to the local machine.
- Sync remote folder – Copies the entire remote folder to the local machine, but without sub-directories. It also verifies file timestamps to ensure that the player avoids redownloading content.
- Sync remote folder and subfolders – Recursively syncs all child folders, as well.
- Sync using manifest – Syncs files according to the information defined in the Manifest file. This option is available for the HTTP/HTTPS protocol only.
- The path to the Manifest file is defined in the Remote URL field.
- The location on the local player system where the synchronized content will be stored is defined in the Destination path field.
Note: If you are using the Sync remote folder or Sync remote folder and subfolders option, be aware that Broadsign Control supports only the Nginx, Apache, and IIS HTTP servers with Directory Listings enabled. Broadsign Control uses native configurations, so if you modify the date format, for example, synchronization may not work properly.
For more information on the format to use for a Manifest file, see Manifest Synchronization For HTTP/HTTPS.
When using the Sync remote folder and Sync remote folder and subfolders options, the source URL must actually contain a real folder. For example, ftp://user:pass@ftp.example.com/folder/ would work, whereas ftp://user:pass@ftp.example.com/ will not.
Sync Mode
The synchronization method used. You can select one of the following options:
-
Atomic – Downloads all files from the FTP or HTTP/HTTPS remote URL to the player before making any changes to the content.
Note: When syncing files, the player will ensure atomic delivery. This ensures that the player will not get a partial copy of the remote data. All files are synced locally as .part files. When the transaction completes successfully, Broadsign reverts them to their original names.
-
Progressive – Makes changes on the player to each file as soon as it downloads.
Refresh Period
Defines how often the remote URL is synchronized locally, that is, the frequency with which the player will check the remote URL for new files. Expressed in hh:mm:ss.
Timeout Period
Controls how long the player will wait for a server timeout, that is, the length of time the player will wait before terminating hung connections. Default 30 seconds.
Scripting Options
- Enable SmartFeed – You can enable Broadsign's SmartFeed feature. See SmartFeed.
- Edit Script – Opens the Script Editor. For more information, see SmartFeed.
Expiry Period
When a monitor sync URL is associated directly with an ad copy, this option becomes available in the URLs tab of the ad copy.
The ad copy can be removed from the loop when the associated data feed becomes stale. Typically, this is enabled when the choice is made that it is preferable to display no content instead of stale content. The specified time period can elapse because either the remote server is unavailable or the remote feed contents have not changed.
Broadsign allows you to define a list of files to synchronize. This list is defined in a Manifest file.
The Manifest file can be used when the selected protocol is HTTP/HTTPS. When using such a file, the following behavior is followed:
- Files that did not change are not re-fetched.
- Folders are automatically created on the local file system as needed.
- Any folders or files that are already on the local file system that are no longer listed in the Manifest file are deleted.
Manifest File Format
If you have configured the synchronization URL to point to a manifest, you must define the Manifest file in the following format:
{
"metadata": {
"version":1,
"utc_generation_time_ms":1560801541230
},
"files": [{
"url":"https://example.com/doc/file1.png",
"utc_last_modified_time_ms":1560801541230,
"md5":"12341234234234234",
"local_path":"sync/file1.png"
},
{
"url":"https://example.com/doc/file2.png",
"utc_last_modified_time_ms":1560801541230,
"md5":"12341234234234234",
"local_path":"sync/file2.png"
},
{
"url":"https://example.com/doc/media/file1.png",
"utc_last_modified_time_ms":1560801541230,
"md5":"12341234234234234",
"local_path":"sync/media/file1.png"
},
{
"url":"https://example.com/temp/b/file1.png",
"utc_last_modified_time_ms":1560801541230,
"md5":"12341234234234234",
"local_path":"sync/media/b/file1.png"
}]
}
Manifest Parameters
The following table describes the parameters available in the Manifest file:
Parameter | Description |
---|---|
metadata | Contains the metadata of the Manifest file. |
metadata.version | Version of the target protocol. |
metadata.utc_generation_time_ms | Generation data of the Manifest file, in milliseconds, since epoch (UTC). |
files | List of file objects to synchronize. |
file.url | HTTP/HTTPS full link to the file content to synchronize. |
file.utc_last_modified_time_ms | Last modified time, in milliseconds, since epoch (UTC). |
file.md5 | Ensures that there is no file corruption in transit (optional). |
file.local_path |
Local path where the file is saved. The path is always relative to the Destination path specified in the Synchronization URL window (see Configuration Settings for more details). |
The Core tab provides a mechanism to periodically update a local file from a remote source. For more details about variables and how to use them, see Content Variables.
Content | Description |
Enabled | Controls whether the Monitor Sync mechanism is enabled on the player. |
Respect network controls | Controls whether the player will honor Network Control time spans with respect to the file synchronization feature. See Network Control. |
Append Resource ID Append Location Code Append Address |
Controls whether to append dynamic variables such as Player Resource ID, Zip code and Address to the fetched HTTP URLs to enable smart server-side logic that customizes the response document for each client. For more details, see Content Variables. |