Chapter 6: Phase 3 - Communication Protocol

弘益人間 (Hongik Ingan) · Benefit All Humanity

6.1 Purpose of Phase 3

The Phase 3 specification (PHASE-3-PROTOCOL, v1.0.0) defines network protocols, security requirements, device discovery and firmware update mechanisms for cleaning robots. Where the Chapter 5 API defines what is exchanged, Phase 3 defines over which channels, and how securely.

6.2 Supported Protocols

On the local network the specification supports four protocols.

ProtocolPurpose
HTTP/HTTPSREST API (Chapter 5)
WebSocket/WSSReal-time status updates
MQTTPublish/subscribe messaging
mDNS/BonjourDevice discovery

Other protocols (for example CoAP or gRPC) are not part of the standard. Where they are needed, they must be provided through the protocol translation middleware allowed by section 9.2 of the specification (HTTP-to-MQTT bridge, WebSocket-to-gRPC conversion, legacy protocol adapters) or as vendor extensions prefixed with x_, and they must be clearly identified as non-standard extensions.

6.3 MQTT Topic Structure

MQTT topics follow this structure:

wia/rob/{robot_id}/{category}/{subcategory}

The standard topics defined by the specification are:

wia/rob/{robot_id}/status
wia/rob/{robot_id}/battery
wia/rob/{robot_id}/position
wia/rob/{robot_id}/sensors/lidar
wia/rob/{robot_id}/sensors/camera
wia/rob/{robot_id}/map/update
wia/rob/{robot_id}/command
wia/rob/{robot_id}/event

Message payloads on these topics use the Phase 1 formats from Chapter 4: for example, RobotCommand documents are published on the command topic and RobotEvent documents on the event topic. MQTT wildcards allow a client to subscribe to all of one robot's sensors (wia/rob/{robot_id}/sensors/#) or to the status of many robots (wia/rob/+/status) at once.

QoS Levels

Message typeQoSMeaning
Status updates0At most once (fire and forget)
Commands1At least once
Critical alerts2Exactly once

Because commands are delivered with QoS 1, the same command may arrive twice. Robots should therefore remember the commandId of each RobotCommand and execute duplicates only once.

6.4 Security

TLS Requirements

Connections using TLS 1.2 or earlier are not permitted. All network communication in transit uses TLS 1.3, and cloud synchronisation uses end-to-end encryption. MQTT and WebSocket must also run over TLS (MQTTS and WSS respectively).

Authentication Methods

  1. JWT tokens (recommended)
  2. OAuth 2.0
  3. API keys (for simple integrations)

Encryption of Data at Rest

Maps and camera images reveal the layout of homes and facilities and images of people, so these requirements must be applied especially strictly to them.

6.5 Device Discovery (mDNS)

Robots advertise themselves on the network using mDNS. The service type and TXT records are:

Service Type: _wia-rob._tcp
Port: 8080
TXT Records:
  - version=1.0.0
  - manufacturer=CompanyName
  - model=ModelName
  - serial=SerialNumber
  - capabilities=slam,camera,mopping

Discovery takes five steps:

  1. The client broadcasts an mDNS query.
  2. The robot responds with its service details.
  3. The client connects to the robot's IP address and port.
  4. An authentication handshake takes place.
  5. The session is established.

6.6 Firmware Updates (OTA)

Update Process

1. Check for updates   GET /firmware/check
   Response: { "available": true, "version": "1.2.0", "size": 25600000,
               "checksum": "sha256hash", "url": "https://..." }
2. Download firmware   GET /firmware/download   (binary stream with progress)
3. Verify checksum     client-side SHA-256 verification
4. Install             POST /firmware/install
   Response: { "status": "installing", "estimatedTime": 300 }
5. Reboot              automatic after installation
6. Verify version      check the firmwareVersion field of GET /robot/status

Rollback

6.7 Cloud Synchronisation

Synchronised dataFrequency
StatusReal time (WebSocket)
Maps (encrypted)After each update
Cleaning historyDaily batch
ConfigurationOn change

As an example cloud API, the specification gives POST /robots/register, GET /robots/{robot_id}/status, PUT /robots/{robot_id}/config, GET /robots/{robot_id}/history and POST /firmware/update under https://cloud.wiastandards.com/api/v1. Note that this path scheme differs from the local API served by the robot itself (/api/v1/robot/..., Chapter 5).

6.8 Smart Home Protocol Mappings

Phase 3 also defines how cleaning robots map onto the main smart home standards. How the integrations are actually set up is covered in Chapter 7.

PlatformMapping in the specification
Matter/ThreadDevice type Robotic Vacuum Cleaner (0x0074); required clusters On/Off, Fan Control, Robot Vacuum Mode, Battery Status (the specification's informal labels)
Apple HomeKitService type Fan; characteristics On (required), Rotation Speed (suction power), Current/Target Fan State
Amazon AlexaVoice commands to start cleaning, clean a specific room and check the battery
Google HomeTraits OnOff, FanSpeed, EnergyStorage

Erratum: the Phase 3 specification document gives the Matter device type as 0x0073, which is an error. In the Matter Device Library 0x0073 is the Laundry Washer; the Robotic Vacuum Cleaner is 0x0074. The cluster names in the table above are also the specification's informal labels, not Matter cluster names; an implementation should be based on the RVC Run Mode, RVC Clean Mode, RVC Operational State and Power Source clusters.

6.9 Monitoring and Diagnostics

GET /health
Response:
{
  "status": "healthy|degraded|unhealthy",
  "checks": { "battery": "ok", "sensors": "ok", "navigation": "ok", "network": "ok" },
  "uptime": 86400
}

GET /diagnostics/logs?level=error&limit=100

Each diagnostic log entry consists of a timestamp, a level (error, warning, info or debug), a component and a message.

6.10 Connection Optimisation and Failure Handling

Section 9.3 of the specification lists these performance techniques: maintaining persistent connections, reusing TLS sessions, minimising handshake overhead, gzip compression for text data, binary protocols for sensor streams, and adaptive compression based on bandwidth.

When the connection is lost, the robot fails over in the order primary server → secondary server → local mode. The recovery procedure is:

  1. Detect the connection loss.
  2. Attempt to reconnect with increasing back-off.
  3. Switch to the backup server if one is available.
  4. Enter local-only mode if all attempts fail.
  5. Queue unsent commands for later synchronisation.

6.11 Protocol Conformance Testing

Section 10 of the specification requires the following tests for certification: TLS handshake verification, authentication flow testing, data format validation, error handling verification and performance benchmarking. Certified products must also undergo an annual security audit. These items are reflected in the checklist in Chapter 8.

Key Takeaways

Review Questions

  1. What are the four protocols supported by the Phase 3 specification, and what is each used for?
  2. Write the LiDAR data topic for a robot whose ID is R-17.
  3. What must a robot be prepared for when commands are sent with QoS 1?
  4. Explain the four TLS requirements of Phase 3.
  5. Describe the five steps of mDNS discovery.
  6. How does the A/B partition scheme protect against a failed firmware update?
  7. In what order does a robot respond when its network connection is lost?

📐 Simulator Panel 0