Quick Start Guide

Get your first IoT device connected in under 5 minutes โšก

Welcome! This guide will walk you through setting up Mir and connecting your first virtual device. By the end, you'll understand how to stream telemetry, send commands, and manage device configurations.

๐Ÿ“‹ Prerequisites

Before we begin, ensure you have:

  • Docker installed and running
  • Terminal or command prompt access
  • 5 minutes of your time

๐Ÿš€ Installation

Step 1: Download Mir

Download the latest release of Mir from the releases page. From the download, extract the binary. Add it to your path for easier usage.

You can also install the binary via Go (as it is a private repository, follow the access guide):

go install github.com/maxthom/mir/cmds/mir@latest

Step 2: Verify Installation

mir --version

Success! You should see the Mir version information.

๐ŸŽฎ Start Your IoT Platform

Let's bring up your personal IoT platform in two simple commands:

Terminal 1: Infrastructure

mir infra up

This starts the supporting services.

Terminal 2: Mir Server

mir serve

This launches the Mir server that manages all your devices.

Congratulations! Your IoT platform is now running!

Access Your Dashboard

Open your browser and navigate to:

  • URL: http://localhost:3000
  • Username: admin
  • Password: mir-operator

You now have access to pre-configured Grafana dashboards for monitoring your devices.

Find list of running services here.

๐Ÿค– Create Your First Virtual Device

Let's create a virtual device using the Swarm to see Mir in action:

Terminal 3: Virtual Device

mir swarm --ids power

This creates a virtual "power monitoring" device that simulates:

  • Temperature readings
  • Power consumption data
  • HVAC control capabilities

๐Ÿ” Explore Your Device

Terminal 4: View Connected Devices

mir device list

Output:

NAME/NAMESPACE    DEVICE_ID    STATUS    LAST_HEARTBEAT    LABELS
power/default     power        online    Just now

Inspect Device Details

mir device ls power

This displays the device's digital twin - a complete virtual representation including:

  • Metadata (name, namespace, labels)
  • Configuration (desired and reported properties)
  • Status (online state, schema info)

๐Ÿ’ฌ Communicate with Your Device

Telemetry - Stream Real-time Data

Device sending data to the server in a fire-and-forget manner.

View incoming sensor data:

mir tlm list power

Output:

power/default
โ”œโ”€ EnvironmentTlm (temperature, humidity) โ†’ View in Grafana
โ””โ”€ PowerConsumption (watts, voltage) โ†’ View in Grafana

Click the Grafana links to see live data visualization!

Commands - Control Your Device

Commands are sent from the server to the device as a request-reply.

See available commands:

mir cmd send power

Send a command to activate HVAC:

# See command payload
mir command send power/default -n swarm.v1.ActivateHVAC -j
# Send command with modified payload
mir command send power/default -n swarm.v1.ActivateHVAC -p '{"durationSec": 5}'
# Quickly edit and send a command
mir command send power/default -n swarm.v1.ActivateHVAC -e

Output:

Command sent successfully!
Response: {"success": true}

Configuration - Manage Device State

Configuration is divided into desired properties and reported properties. Contrary to commands, properties use an asynchronous messaging model and are written to storage. They are meant to represent the desired and current state of the device.

View current configuration option:

mir cfg send power/default

Update device configuration:

# See current config
mir config send power/default -n swarm.v1.DataRateProp -c
# See config template payload
mir config send power/default -n swarm.v1.DataRateProp -j
# Send config with modified payload
mir config send power/default -n swarm.v1.DataRateProp -p '{"sec": 5}'
# Quickly edit and send a config
mir config send power/default -n swarm.v1.DataRateProp -e

The device will:

  1. Receive the new desired configuration
  2. Apply the changes
  3. Report back the updated state

๐ŸŽฏ What Just Happened?

In just a few minutes, you've:

  • โœ… Deployed a complete IoT platform
  • โœ… Connected a virtual device
  • โœ… Streamed real-time telemetry data
  • โœ… Sent commands to control the device
  • โœ… Updated device configuration
  • โœ… Visualized data in Grafana dashboards

๐Ÿงน Clean Up

When you're done experimenting:

# Stop the virtual device (Ctrl+C in Terminal 3)
# Stop Mir server (Ctrl+C in Terminal 2)
# Stop infrastructure
mir infra down

๐Ÿšฆ Next Steps

Now that you've experienced Mir's capabilities:

๐Ÿ”ง Build Real Devices

โ†’ Learn how to integrate your hardware with the Device SDK

๐Ÿ“ˆ Scale Your Deployment

โ†’ Deploy Mir in production with our Deployment Guide

๐ŸŽจ Customize Your Platform

โ†’ Extend Mir with custom modules using the Module SDK

๐Ÿ’ก Explore Advanced Features

โ†’ Master the CLI with our Complete CLI Guide


๐ŸŽ‰ Welcome to the Mir community! You're now ready to build amazing IoT solutions. If you have questions, check our FAQ or join our community.