Client Location


Overview

In this exercise you will:

  1. Establish a secure WebSocket connection to the Mist cloud.
  2. Subscribe to WebSocket location updates for each client type.
  3. Display the client X/Y map location updates as they are received.

The following endpoint is used for all secure WebSocket connections:

  • wss://api-ws.mist.com/api-ws/v1/stream
Client Type Channel Documentation
BLE Asset /sites/:site_id/stats/maps/:map_id/discovered_assets https://api.mist.com/api/v1/docs/Site#assets
SDK Client /sites/:site_id/stats/maps/:map_id/sdkclients https://api.mist.com/api/v1/docs/Site#location
WiFi Client /sites/:site_id/stats/maps/:map_id/clients https://api.mist.com/api/v1/docs/Site#client-stats

Mist Web UI

Navigate to Location > Live View and select the map to see the location of the following clients:

  1. WiFi clients
  2. BLE assets
  3. Mist SDK mobile apps

Exercise

Run the following exercise to establish a WebSocket connection and receive location updates for each client type: