Alex MitrovicBLE & IoT app developer, Android and iOS

Wi-Fi & IoT

BLE vs Wi-Fi vs MQTT for an IoT app: which link to use, and when to combine them

BLE, local Wi-Fi or MQTT through the cloud for an IoT app? Range, speed, power, setup and offline use compared, and the combinations that work.

Short answer

Use BLE for setup and for control when the phone is near the device and battery life matters; Wi-Fi on the local network for fast, frequent control at home without the cloud; and MQTT through a cloud broker for control and state when the phone is away from home. Most successful connected products combine them: BLE for onboarding, Wi-Fi or MQTT for everyday use.

Key takeaways

  • BLE wins on power and setup, and works with no network at all; it loses on range and remote access.
  • Local Wi-Fi wins on speed and latency at home, and keeps working when the internet is down.
  • MQTT through the cloud is the only one that works from anywhere, at the cost of a backend.
  • Combining links is normal; the hard part is one device state across all of them.
  • Decide early: the choice shapes the hardware, the firmware and the app.

“Should our device use BLE or Wi-Fi?” comes up early in most hardware projects I talk to. There's no single right answer, but there are clear trade-offs, and most products end up using two links, not one. Here's the comparison from the app's side.

BLE vs Wi-Fi (local) vs MQTT (cloud) at a glance

BLEWi-Fi on the local networkMQTT through the cloud
Works away from homeNoNoYes
Works without internetYesYes (LAN only)No
Typical rangeSame room to a houseThe home networkAnywhere
Device power useVery low; runs on coin cellsHigh; usually mains or big batteriesSame as Wi-Fi, plus keeping a connection open
Speed and latencyUp to ~100+ KB/s best case, low latency nearbyFast, low latencyFast enough; latency depends on the broker and network
Setup for the userPair once, in the appNeeds provisioning firstProvisioning + account linking
Infrastructure you runNoneNoneA broker and backend, with security and accounts
App complexityBLE stack quirks per phoneDiscovery (mDNS), local permission on iOSAuth, reconnection, offline queues
Good forWearables, sensors, locks, setup of everythingSmart home devices used at homeRemote control, notifications, fleets

When BLE alone is enough

If the user is always near the device when using it (a wearable, a tool, a sensor read on demand, a lock at the door), BLE alone keeps the product simple: no backend, no accounts, no Wi-Fi setup, and long battery life. The app takes on the work of syncing data to the cloud when it has a connection.

The costs: no control from away, and Android and iOS each have their own BLE behavior to handle. That's the work the rest of this blog is about.

When Wi-Fi on the local network makes sense

Mains-powered home devices (heaters, plugs, lights, appliances) usually sit on Wi-Fi anyway. Talking to them directly on the home network is fast and keeps working when the internet is down. The app finds them with mDNS (Bonjour on iOS, NSD on Android) and talks over HTTP, WebSockets or a small TCP protocol. On iOS 14 and later, local network access needs its own permission prompt.

When you need MQTT and the cloud

As soon as users expect to control the device from work, or get a notification when something happens, the device has to reach a server. MQTT is a common choice: a light publish/subscribe protocol where the device and the app both connect to a broker. The app side needs care: authentication per user and device, reconnecting when the phone changes networks, and not trusting a stale “last known state” as the current one.

The combinations that work

PatternHow it worksTypical product
BLE setup → Wi-Fi + cloudOnboard over BLE, provision Wi-Fi, then local control at home and MQTT awayThermostats, heaters, plugs, cameras
BLE + phone as gatewayDevice talks BLE only; the app syncs its data to the cloud when it canWearables, sensors, medical-style devices
BLE + USB fallbackBLE for everyday use, USB for service, large transfers or recoveryControllers, installer tools
Wi-Fi + cloud, BLE for recoveryNormal use over the network; BLE to re-provision when Wi-Fi changesAppliances

I've built several of these: the floor-heating controller paired BLE with a USB fallback, and my ESP32-S3 device is set up over BLE and then joins Wi-Fi.

The real problem: one device state

With more than one link, the device's state can arrive from several places at different times. The classic bug: the app shows “off” from a cached cloud message while the device, reachable over BLE, is on. The rules I use:

  • One source of truth per device in the app, fed by all links.
  • Every state carries a timestamp or sequence number from the device, so newer always wins.
  • Commands are confirmed by the device, whichever link they went over.
  • The UI shows when state is stale, instead of pretending.

Matter and Thread are worth a look for smart home products; Matter uses BLE for commissioning and Wi-Fi or Thread for control. Add your view on Matter if you have hands-on experience; otherwise leave this sentence as is.

FAQ

Is BLE or Wi-Fi better for an IoT device?

BLE is better for battery-powered devices used nearby and for setup; Wi-Fi is better for mains-powered devices that need fast control at home or a cloud connection. Many products use both: BLE to set up, Wi-Fi for everyday use.

Can a BLE device be controlled remotely?

Not by itself: BLE needs the phone nearby. For remote control, either the device also connects to Wi-Fi and a cloud service, or a gateway (a hub or a phone at home) relays commands.

Is MQTT a replacement for BLE?

No, they solve different problems. MQTT is a protocol for talking to a server over the internet; BLE is a short-range radio link. Many apps use BLE to set up a device and MQTT to control it from anywhere afterwards.

Sources

Seeing this in your own app?

Send me the phone models and what the logs say. On a short call I'll tell you where I'd look first.

Book a free call

Free · NDA on request · reply within 1–2 working days