---
title: "Walkthrough: SDK + TrustBridge on Windows"
description: "Walkthrough: SDK + TrustBridge on Windows"
---

[Skip to content](https://portal.sandgrain.eu/knowledge-base/walkthrough-sdk-trustbridge-on-windows#main-content)

English

Show submenu for translations

![SandGrain\_Logo\_RGB\_white-bijgesneden (1)](https://portal.sandgrain.eu/hs-fs/hubfs/SandGrain_Logo_RGB_white-bijgesneden%20(1).png?width=427&height=83&name=SandGrain_Logo_RGB_white-bijgesneden%20(1).png)

Open main navigation

Close main navigation

- English
  
  Show submenu for translations
- [Contact us](https://portal.sandgrain.eu/login)

[Contact us](https://portal.sandgrain.eu/login?hsLang=en)

 How can we help you?

- There are no suggestions because the search field is empty.

1. [Knowledge Base](https://portal.sandgrain.eu/knowledge-base?hsLang=en)
2. [SDK](https://portal.sandgrain.eu/knowledge-base/sdk?hsLang=en)
3. [SandGrain SDK](https://portal.sandgrain.eu/knowledge-base/sdk?hsLang=en#sandgrain-sdk)

October 6, 2026

# Walkthrough: SDK + TrustBridge on Windows

**Who this is for:** Windows users who want the full platform, MySQL, Mosquitto broker, TrustBridge backend and frontend, and the Cloud SDK agent (all in Docker), plus the native SandGrain Device and Gateway binaries.

**What you'll accomplish:** Bring up the TrustBridge stack, launch the SDK against it, and trigger authentication from the web UI.

**Prerequisites:**

- [*Prerequisites on Windows*](https://portal.sandgrain.eu/knowledge-base/install-prerequisites-on-windows?hsLang=en) completed (Git, Node, Docker Desktop, WSL, usbipd).
- [*Get the Code & Run the Setup Script*](https://portal.sandgrain.eu/knowledge-base/get-the-code-run-the-setup-script?hsLang=en) completed, repo on [`release/v3.6.0`](https://github.com/SandGrain-CyberRock/SandGrain-TrustBridgeSDK/tree/release/v3.6.0).
- Docker Desktop running (whale icon solid).

### Confirm your branch and layout

```
git branch    # release/v3.6.0 
```

Your folder layout should match:

```
SandGrain-TrustBridgeSDK/ ├── SandGrain-SDK/ └── TrustBridge/         ├── TrustBridge-BE/         └── TrustBridge-FE/  
```

### Bring up the TrustBridge Docker stack

```
cd C:\dev\trustbridge\SandGrain-TrustBridgeSDK\TrustBridge\TrustBridge-BE .\start-all.ps1 
```

**Take note of the Laptop IP that's printed**, you'll need it for the SDK step.

> **![PowerShell output of start-all.ps1 with the laptop IP.](https://portal.sandgrain.eu/hs-fs/hubfs/image27-png.png?width=670&height=349&name=image27-png.png)**`start-all.ps1` bringing up the stack and printing the Laptop IP.

#### **What `start-all.ps1` does:**

- Verifies the Docker engine is reachable.
- Creates a shared Docker network `trustbridge-net` so containers find each other by name.
- Copies `.env.example` → `.env` in any repo missing it.
- Runs `docker compose up -d --build` in each of the three project directories (`TrustBridge-BE`, `TrustBridge-FE`, and `SandGrain-SDK/PoC_SDK_v3/sdk_cloud`).
- The backend waits for MySQL to be healthy, runs the database seed once, then starts the NestJS API.

**First run takes 5–15 minutes** (downloading base images, building images). Later runs take about 30 seconds.

### Verify the stack

```
docker ps 
```

You should see **5 containers**: `tb-be`, `sandgrain-cloud-app`, `tb-fe`, `tb-mosquitto`, and `tb-mysql` (healthy).

> **![docker ps output listing five TrustBridge containers.](https://portal.sandgrain.eu/hs-fs/hubfs/image29-png.png?width=670&height=49&name=image29-png.png)Screenshot (image29.png):** `docker ps` showing the five containers running.

Then:

- **Frontend** → open `http://localhost:5173`, you should see the TrustBridge login page.
- **Backend API + Swagger** → open `http://localhost:3000/docs`.
- **(Optional) MQTT round-trip** → `.\start-all.ps1 logs be` and look for lines like `Connected to MQTT broker at mosquitto:1883` and `Subscribed to device presence: sandgrain/v1/+/status`. Press **Ctrl+C** to stop tailing.

Install usbipd and attach the Token (if not done already)

If you haven't installed usbipd yet, see *Prerequisites on Windows* or *USB & Serial Port Setup*. The launcher in the next step will prompt you to attach the USB automatically.

### Run the SDK's setup script (once)

```
cd "D:\path\to\SandGrain-SDK" .\setup.ps1 
```

If PowerShell blocks it: `Set-ExecutionPolicy -Scope Process -ExecutionPolicy Bypass`

### Launch the Device and Gateway against the stack

Because the Cloud agent already runs inside Docker, launch the SDK with `--no-cloud` so it starts only the Gateway and Device and points MQTT at the stack's broker:

```
cd "\path\to\SandGrain-SDK" .\run_all.ps1 --no-cloud 
```

#### **What `--no-cloud` does:**

- Skips the local Python cloud agent (the TrustBridge stack provides it).
- Runs the Device in `--listen` (BE-driven) mode, so authentication can be triggered from the frontend via `cmd/run_auth` over MQTT, while the interactive menu still works in parallel.
- Binds the USB port from Windows to WSL.

**The first prompt** attaches the USB to WSL: match the BUSID. **Remaining prompts** set environment variables. Point the **MQTT host/port** at the TrustBridge broker (the Laptop IP from step 2) so the Gateway/Device talk to its Cloud agent.

**New Token?** On a first-time setup, or when a new SandGrain Token is connected for the first time, the terminal asks for the chip's credentials (**HCW/HRW**, see *Key Concepts & Glossary*).

> **![Prompt to attach the USB Token to WSL.](https://portal.sandgrain.eu/hs-fs/hubfs/image31-png.png?width=670&height=296&name=image31-png.png)**The USB attach prompt from `run_all.ps1`.

> **![Terminal asking for the board's HCW/HRW credentials.](https://portal.sandgrain.eu/hs-fs/hubfs/image32-png.png?width=670&height=431&name=image32-png.png)**First-time HCW/HRW chip credential prompts.

After a successful build, the **Device and Gateway terminals** open (they may ask for sudo).

> **![Device and gateway terminals running.](https://portal.sandgrain.eu/hs-fs/hubfs/image34-png.png?width=670&height=377&name=image34-png.png)**The Device and Gateway terminals.

### Trigger authentication from the UI

In the Device terminal you'll see:

```
[READY] Listening for TrustBridge triggers sandgrain/v1/{tid}/cmd/run_auth 
```

From TrustBridge, trigger an authentication for the enrolled device (or use the Device menu's Option 1/2/3 directly). Modes 1/2/3 map to the same fault-injection profiles as menu options 1/2/3. A successful run shows the mutual authentication result and re-prints the menu prompt.

### Next step

- Enroll devices and manage their lifecycle in the frontend (see the TrustBridge platform articles).
- Learn the day-to-day commands in [*Daily Workflow & Updating the SDK*](https://portal.sandgrain.eu/knowledge-base/daily-workflow-updating-the-sdk?hsLang=en).

- [User Documentation](https://portal.sandgrain.eu/knowledge-base/user-documentation?hsLang=en#main-content)

    - [Quick Starter Guide](https://portal.sandgrain.eu/knowledge-base/user-documentation?hsLang=en#quick-starter-guide)
    - [User Manual](https://portal.sandgrain.eu/knowledge-base/user-documentation?hsLang=en#user-manual)
    - [Whitepaper](https://portal.sandgrain.eu/knowledge-base/user-documentation?hsLang=en#whitepaper)
    - [Token Leaflet](https://portal.sandgrain.eu/knowledge-base/user-documentation?hsLang=en#token-leaflet)
    - [Claim Token Procedure](https://portal.sandgrain.eu/knowledge-base/user-documentation?hsLang=en#claim-token-procedure)
    - [Daisy Chain](https://portal.sandgrain.eu/knowledge-base/user-documentation?hsLang=en#daisy-chain)
    - [Release Note](https://portal.sandgrain.eu/knowledge-base/user-documentation?hsLang=en#release-note)
    - [Naming Convention](https://portal.sandgrain.eu/knowledge-base/user-documentation?hsLang=en#naming-convention)
    - [SandGrain SDK](https://portal.sandgrain.eu/knowledge-base/user-documentation?hsLang=en#sandgrain-sdk)
    - [TrustBridge](https://portal.sandgrain.eu/knowledge-base/user-documentation?hsLang=en#trustbridge)
- [API Documentation](https://portal.sandgrain.eu/knowledge-base/api-documentation?hsLang=en#main-content)

    - [Device API Integration](https://portal.sandgrain.eu/knowledge-base/api-documentation?hsLang=en#device-api-integration)
    - [Daisy Chain and Attestation](https://portal.sandgrain.eu/knowledge-base/api-documentation?hsLang=en#daisy-chain-and-attestation)
- [SDK](https://portal.sandgrain.eu/knowledge-base/sdk?hsLang=en#main-content)

    - [Core Functions](https://portal.sandgrain.eu/knowledge-base/sdk?hsLang=en#core-functions)
    - [SandGrain SDK](https://portal.sandgrain.eu/knowledge-base/sdk?hsLang=en#sandgrain-sdk)

[![SandGrain\_Logo\_RGB\_white-bijgesneden (1)-1](https://portal.sandgrain.eu/hs-fs/hubfs/SandGrain_Logo_RGB_white-bijgesneden%20(1)-1.png?width=427&height=83&name=SandGrain_Logo_RGB_white-bijgesneden%20(1)-1.png "SandGrain_Logo_RGB_white-bijgesneden (1)-1")](https://portal.sandgrain.eu/?hsLang=en)

<https://www.facebook.com/> <https://www.twitter.com/> <https://www.instagram.com/> <https://podcasts.apple.com/> [mailto:email@email.com](mailto:email@email.com)

Copyright © 2026, sandgrain.eu