MQTT: Get Data from a Scorelink

Overview

This guide explains how to consume real-time scoreboard data from Sportzcast using MQTT. You can connect to:

  • Cloud cluster (Sportzcast-managed broker)
  • ScoreConnect III (local broker)
  • Scorelink+ (local broker running on device)

All data delivery uses a publish/subscribe model. Your client subscribes to topic(s), and Sportzcast services publish scoreboard updates.

Connection modes

Mode Host MQTT WebSocket Security Credentials
Cloud cluster score.sportzcast.net 8883 8084 (/mqtt) TLS/WSS Required
Local (ScoreConnect III / Scorelink+) Device or machine IP 1883 8083 (/mqtt) Insecure (local) Not required

Notes:

  • For cloud, use MQTTS/TLS (8883) or WSS (8084).
  • Cloud insecure MQTT (1883) is legacy and should be avoided.
  • Sportzcast clients are subscribers only (publishing is not supported for customers).

Prerequisites

Cloud cluster access

Before connecting to the cloud broker, ensure:

  1. You have an active Sportzcast user account (www.sportzcast.net).
  2. You have your email and access token.
  3. Your user license is active.
  4. Required bot(s) are assigned to your account.

Cloud broker authentication uses basic credentials:

  • Username: your user email
  • Password: your access token

For local broker usage:

  1. Scorelink/ScoreConnect/client are on the same local network.
  2. MQTT server is enabled in local configuration.
  3. Connect directly to the device/application IP.

Topic structure

Use this topic format:

bot/{botNumber}/{dataType}

Examples:

  • bot/0/sbdata -> scoreboard data format
  • bot/50/json -> JSON output for bot 50
  • bot/50/raw -> raw controller data for bot 50

JSON contract documentation

If you subscribe to bot/{botNumber}/json, use the contract docs below:

All JSON contracts share the same Sport base fields and then add sport-specific fields.

QoS behavior

Sportzcast MQTT delivery uses QoS 0 (at most once).

Implications:

  • Lowest latency and overhead
  • No delivery acknowledgement/retry
  • Occasional message loss is possible

Design consumers to tolerate missed updates and process data as a real-time stream.

Quick start

  1. Pick cloud or local endpoint.
  2. Connect client using the correct port/protocol.
  3. (Cloud only) provide email/token credentials.
  4. Subscribe to bot/{botNumber}/{dataType}.
  5. Parse and process incoming payloads continuously.

Example: JavaScript (MQTT.js over WebSocket)

<script src="https://unpkg.com/mqtt/dist/mqtt.min.js"></script>
<script>
  // Cloud:
  const url = 'wss://score.sportzcast.net:8084/mqtt';

  // Local example:
  // const url = 'ws://<LOCAL_IP>:8083/mqtt';

  const client = mqtt.connect(url, {
    // Cloud only:
    username: 'your-email@domain.com',
    password: 'your-access-token'
  });

  client.on('connect', () => {
    client.subscribe('bot/0/json');
  });

  client.on('message', (topic, message) => {
    console.log(topic, message.toString());
  });
</script>

Example: C# (MQTTnet)

using MQTTnet;
using MQTTnet.Client;
using MQTTnet.Protocol;

var factory = new MqttFactory();
using var client = factory.CreateMqttClient();

var options = new MqttClientOptionsBuilder()
    .WithTcpServer("score.sportzcast.net", 8883)
    .WithCredentials("your-email@domain.com", "your-access-token")
    .WithTlsOptions(o => o.UseTls())
    .Build();

client.ApplicationMessageReceivedAsync += e =>
{
    Console.WriteLine(System.Text.Encoding.UTF8.GetString(e.ApplicationMessage.PayloadSegment));
    return Task.CompletedTask;
};

await client.ConnectAsync(options);
await client.SubscribeAsync("bot/0/json", MqttQualityOfServiceLevel.AtMostOnce);

Troubleshooting

  • Auth failures (cloud): verify email/token, license state, and bot assignment.
  • No data: confirm bot number and topic data type (json, sbdata, raw).
  • Intermittent gaps: expected with QoS 0; handle stream continuity in application logic.
  • Local connection issues: confirm same network and local MQTT service enabled.