---
title: "MQTT Broker for Smart City Sensors & Streetlights | ConnectMQ"
description: "Connect streetlights, parking, air-quality and waste-bin sensors to one managed MQTT broker — one topic tree for the city, per-department ACLs, retained state."
url: "https://connectmq.com/smart-city/"
language: "en"
---

Smart City

# MQTT for Smart City

Streetlights, parking sensors, air-quality stations and waste bins come from different vendors and report over different networks. Publish them all to one MQTT broker, in one topic tree, and let every city system subscribe to what it needs.

[Try it free](https://app.connectmq.com/signup) [Quickstart](https://connectmq.com/developers/)

No card required

What you can build

## Build your city operations platform on ConnectMQ

You build the applications, ConnectMQ moves the data. Lamp controllers, sensor gateways and LoRaWAN network servers publish once; the operations dashboard, citizen app, maintenance system and open-data portal each subscribe to the topics they are allowed to see — add a new vendor or a new consumer without rewiring the others.

Your city

**Streetlight controllers**city/{district}/{area}/lights/{id}/state

**Parking sensors**city/{district}/{area}/parking/{zone}

**Air-quality stations**city/{district}/{area}/air/{station}

**Waste-bin fill sensors**city/{district}/{area}/bins/{id}/fill

**ConnectMQ**

-   TLS on 8883
-   per-device ACL
-   retained messages
-   QoS 0, 1 and 2

What you build on top

**Operations dashboard**

**Citizen app**

**Maintenance system**

**Open-data portal**

What you get

## Smart City on ConnectMQ

-   One topic tree for the whole city: district, area, asset
-   Separate credentials and ACLs for every department and vendor
-   Retained last state for dashboards, citizen apps and open data
-   Commands back to the field, such as dimming a street

example topic design

```
city/downtown/congress-ave/lights/light-118/state   (retained)
city/downtown/congress-ave/lights/light-117/set
city/downtown/congress-ave/parking/zone-4/occupancy   (retained)
```

**Topic tree**

Congress Avenue dashboard subscribes to `city/downtown/congress-ave/#`

-   city/
-   └downtown/
-   └congress-ave/
-   └lights/
-   └light-118/
-   └state
-   └parking/
-   └zone-4/
-   └occupancy
-   └air/
-   └station-2/
-   └pm25
-   └rainey-st/
-   └bins/
-   └bin-0412/
-   └fill

matched by the subscription

One city namespace

## One topic tree for the whole city

Name topics after where things are — city, district, area, asset — and every system finds data by location, whichever vendor installed the sensor. One wildcard subscription gives a district dashboard everything on Congress Avenue, and ACLs keep each department and vendor to its own branch.

Real-life example

## A streetlight fails, the street stays lit

A typical city setup with MQTT: lamp controllers on the poles publish their state over LTE-M, the city operations platform subscribes to the district’s branch of the topic tree, and the same broker carries its commands back to the lights. Poles and office both connect out to ConnectMQ over TLS.

Congress Avenue · 23:41 → ConnectMQ → City operations centre. Detects that the LED driver has failed and publishes the lamp’s new state as a retained message. Subscribed to city/downtown/congress-ave/# through ConnectMQ: it opens maintenance job #2207 and raises light-117 and light-119 from 40 % to 100 %. Both controllers switch to full brightness and confirm with their new state, so the dark gap on the pavement is covered. Gets the job with the pole number and fault code. Once light-118 reports “on” again, the platform dims its neighbours back to 40 %.ConnectMQMQTT broker · TLS 8883Maintenance job #2207 openedMODA · LIGHTS118 OK118 FAULTJOB #2207117/119 40 %117/119 100 %City operations centreOperations platform · subscribed11711811940 %100 %40 %100 %Lamp faultLamp controllerCongress Avenue · 23:41Lamp controllers · LTE-M…/congress-ave/lights/light-118/state {"lamp":"fault"}…/congress-ave/lights/light-118/state {"lamp":"fault"}…/light-117/set {"dim":100}…/light-117/set {"dim":100}…/light-117/state {"dim":100}Maintenance app · nowlight-118 out — job #2207, neighbours at 100 %Congress Avenue · 23:41 → ConnectMQ → City operations centre. Detects that the LED driver has failed and publishes the lamp’s new state as a retained message. Subscribed to city/downtown/congress-ave/# through ConnectMQ: it opens maintenance job #2207 and raises light-117 and light-119 from 40 % to 100 %. Both controllers switch to full brightness and confirm with their new state, so the dark gap on the pavement is covered. Gets the job with the pole number and fault code. Once light-118 reports “on” again, the platform dims its neighbours back to 40 %.ConnectMQMQTT broker · TLS 8883Maintenance job #2207 openedMODA · LIGHTS118 OK118 FAULTJOB #2207117/119 40 %117/119 100 %City operations centreOperations platform · subscribed11711811940 %100 %40 %100 %Lamp faultLamp controllerCongress Avenue · 23:41Lamp controllers · LTE-M…/congress-ave/lights/light-118/state {"lamp":"fault"}…/congress-ave/lights/light-118/state {"lamp":"fault"}…/light-117/set {"dim":100}…/light-117/set {"dim":100}…/light-117/state {"dim":100}Maintenance app · nowlight-118 out — job #2207, neighbours at 100 %

1.  23:41 **Lamp controller on light-118**
    
    Detects that the LED driver has failed and publishes the lamp’s new state as a retained message.
    
    `city/downtown/congress-ave/lights/light-118/state → {"lamp":"fault","code":"DRIVER"}`
    
2.  23:41 **City operations platform**
    
    Subscribed to city/downtown/congress-ave/# through ConnectMQ: it opens maintenance job #2207 and raises light-117 and light-119 from 40 % to 100 %.
    
    `city/downtown/congress-ave/lights/light-117/set → {"dim":100}`
    
3.  23:41 **Neighbouring lights**
    
    Both controllers switch to full brightness and confirm with their new state, so the dark gap on the pavement is covered.
    
    `city/downtown/congress-ave/lights/light-117/state → {"lamp":"on","dim":100}`
    
4.  23:42 **Maintenance crew’s app**
    
    Gets the job with the pole number and fault code. Once light-118 reports “on” again, the platform dims its neighbours back to 40 %.
    

**If a lamp controller loses power or signal,** the broker publishes its retained Last Will `city/downtown/congress-ave/lights/light-118/status → offline` — the dashboard shows the light as unreachable instead of its last good state.

[Node.js code sample](https://connectmq.com/code-samples/nodejs/) [Python code sample](https://connectmq.com/code-samples/python/)

Platform

## Features that help with Smart City

[

### Dashboard & monitoring

Live topic cards, signals and ISA-95 workspace

Learn more](https://connectmq.com/monitoring/)[

### Rules & alerts

Threshold rules, alert log and notifications

Learn more](https://connectmq.com/rules-alerts/)[

### Connectivity

MQTT 3.1.1 and 5 over TCP, TLS, WS and WSS

Learn more](https://connectmq.com/connectivity/)

Solutions

## Other ways teams use ConnectMQ

[

### Industrial IoT & Smart Manufacturing

Machines, PLC gateways, OEE and quality data

](https://connectmq.com/industrial-iot/)[

### Smart Home

Hubs, sensors and Home Assistant setups

](https://connectmq.com/smart-home/)[

### Fleet Telematics

Vehicle tracking, telematics and cold chain

](https://connectmq.com/fleet-logistics/)[

### Smart Energy

Meters, EV chargers, solar and batteries

](https://connectmq.com/energy-utilities/)[

### Connected Products & Smart Hardware

Smart devices you ship to your own customers

](https://connectmq.com/connected-products/)[

### Connected Robots & Physical AI

Robot fleets talking to fleet managers and AI pipelines

](https://connectmq.com/robotics/)[

### Data Center Monitoring

Power, cooling and rack environment

](https://connectmq.com/data-centers/)[

### Smart Agriculture

Soil probes, weather stations and irrigation

](https://connectmq.com/smart-agriculture/)[

### Prototyping & Education

From first ESP32 to classroom labs

](https://connectmq.com/prototyping-education/)

Industries & use cases

## Where teams use Smart City

### Industries

-   [Utilities](https://connectmq.com/industries/utilities/)

### Use cases

-   [Smart Metering](https://connectmq.com/use-cases/smart-metering/)
-   [Hospital Equipment Monitoring & Tracking](https://connectmq.com/use-cases/medical-equipment-tracking/)
-   [IoT Platform for Operators](https://connectmq.com/use-cases/iot-platform-for-operators/)

Pilot

## Pilot one neighbourhood this week

Start on the Free plan with no card. Basic covers up to 100 concurrent connections — enough for the lamp controllers of a pilot street and the network servers that bring in your LoRaWAN sensors. Move to Scale when more districts go live.

[Start for free](https://app.connectmq.com/signup) [See pricing](https://connectmq.com/pricing/)

## Articles

[All articles](https://connectmq.com/blog/)

Managed MQTT Cloud

### [How to Choose an IoT MQTT Broker: 12 Criteria and the Questions to Ask Your Vendor](https://connectmq.com/blog/how-to-choose-an-iot-mqtt-broker/)

A practical 12-point checklist for choosing an IoT MQTT broker, a table of questions to ask every vendor, and a five-minute hands-on test you can run against broker.connectmq.com.

September 21, 20269 min read

MQTT Security

### [MQTT Security Best Practices: A 12-Point Checklist for IoT Teams](https://connectmq.com/blog/mqtt-security-best-practices/)

A hands-on MQTT security checklist covering TLS, credentials, client IDs, topic design, payload validation, rate limits and certificate checks, plus how ConnectMQ handles each point.

September 28, 202611 min read

MQTT Fundamentals

### [MQTT QoS Levels Explained: QoS 0, 1 and 2 with Packet Flows and Examples](https://connectmq.com/blog/mqtt-qos-levels-explained/)

A practical guide to MQTT QoS: how QoS 0, 1 and 2 work on the wire, why the delivered QoS can be lower than you asked for, how sessions queue messages and which level to choose for each use case.

August 20, 20269 min read
