Thread Device Integration via IoT Hub in Mobile App

NOVASOLUTIONS.TECHNOLOGY is engaged in the development, support and maintenance of iOS, Android, PWA mobile applications. We have extensive experience and expertise in publishing mobile applications in popular markets like Google Play, App Store, Amazon, AppGallery and others.
Development and support of all types of mobile applications:
Information and entertainment mobile applications
News apps, games, reference guides, online catalogs, weather apps, fitness and health apps, travel apps, educational apps, social networks and messengers, quizzes, blogs and podcasts, forums, aggregators
E-commerce mobile applications
Online stores, B2B apps, marketplaces, online exchanges, cashback services, exchanges, dropshipping platforms, loyalty programs, food and goods delivery, payment systems.
Business process management mobile applications
CRM systems, ERP systems, project management, sales team tools, financial management, production management, logistics and delivery management, HR management, data monitoring systems
Electronic services mobile applications
Classified ads platforms, online schools, online cinemas, electronic service platforms, cashback platforms, video hosting, thematic portals, online booking and scheduling platforms, online trading platforms

These are just some of the types of mobile applications we work with, and each of them may have its own specific features and functionality, tailored to the specific needs and goals of the client.

Showing 1 of 1 servicesAll 1735 services
Thread Device Integration via IoT Hub in Mobile App
Complex
~5 business days
FAQ
Our competencies:
Development stages
Latest works
  • image_mobile-applications_feedme_467_0.webp
    Development of a mobile application for FEEDME
    756
  • image_mobile-applications_xoomer_471_0.webp
    Development of a mobile application for XOOMER
    624
  • image_mobile-applications_rhl_428_0.webp
    Development of a mobile application for RHL
    1052
  • image_mobile-applications_zippy_411_0.webp
    Development of a mobile application for ZIPPY
    947
  • image_mobile-applications_affhome_429_0.webp
    Development of a mobile application for Affhome
    862
  • image_mobile-applications_flavors_409_0.webp
    Development of a mobile application for the FLAVORS company
    445

Thread Device Integration via IoT Hub into Mobile App

Thread — mesh protocol over IEEE 802.15.4, operating at 2.4 GHz. Phone doesn't speak directly with Thread devices: Border Router always stands between — Apple HomePod mini, Google Nest Hub 2nd gen, or custom OTBR (OpenThread Border Router) on Raspberry Pi. Mobile app controls devices through this router, using Thread over IP (TOIP) or Matter over Thread. Task — understand network topology, handle router unavailability, don't drain battery on CR2032-powered devices.

Where Things Usually Break

Border Router — point of failure and main pain point. If HomePod mini goes to firmware update at 3 AM, all Thread devices behind it become unavailable. App that can't distinguish "device offline" from "Border Router unavailable" shows meaningless error to user.

On iOS Thread Border Router interaction via NetworkExtension framework and NEAppPushManager for local notifications from devices in same network segment. For full Thread interaction via HomeKit need HMAccessory and HMCharacteristic — abstraction level that hides physical transport but adds HAP latency of 100-300 ms per command.

On Android no direct Thread support at OS level up to Android 15, where ThreadNetworkController appeared in android.net.thread. Until then — only via Matter SDK (com.google.android.gms:play-services-home) or custom OTBR with REST API. App communicates with Border Router via CoAP over UDP, requiring careful non-blocking DatagramChannel management and manual ACK timeout handling.

Integration Architecture

Working scheme for cross-platform Flutter app:

Mobile app
    ↓ Matter/Home API or REST CoAP
Border Router (OTBR)
    ↓ IEEE 802.15.4 mesh
Thread devices

On Flutter use matter_dart (unofficial) or native Platform Channels to Matter SDK. For custom OTBR — HTTP client to Border Router REST API: GET /api/v1/node/dataset/active returns Thread Network Dataset in TLV format, POST /api/v1/steering-data manages new device commissioning.

class ThreadBorderRouterClient {
  final Dio _dio;

  Future<ThreadDataset> getActiveDataset() async {
    final response = await _dio.get('/api/v1/node/dataset/active');
    return ThreadDataset.fromTlv(
      Uint8List.fromList(hex.decode(response.data['ActiveDataset'])),
    );
  }

  Future<void> commissionDevice(String eui64, String pskd) async {
    await _dio.post('/api/v1/commissioner/joiner', data: {
      'EUI64': eui64,
      'PSKd': pskd,
      'Timeout': 120,
    });
  }
}

Get mesh network state via GET /api/v1/node/router-table — list of routers with RLOC16 addresses and link quality (Link Quality In/Out). Critical for debugging: if device disappears, check router table first, not app logs.

Sleepy End Device Power Management

Thread Sleepy End Device (SED) class wakes every 240-1000 ms to check parent router message queue. Command arriving between polls — device gets it on next poll cycle. App must account for this when displaying status: "command sent" and "command executed" — different states. Store in Bloc/Cubit:

enum DeviceCommandState { idle, sent, acknowledged, failed }

class DeviceCommandCubit extends Cubit<DeviceCommandState> {
  DeviceCommandCubit() : super(DeviceCommandState.idle);

  Future<void> sendCommand(String deviceEui64, Command cmd) async {
    emit(DeviceCommandState.sent);
    try {
      await _repository.send(deviceEui64, cmd);
      // Wait for ACK from push or polling
      final ack = await _repository
          .awaitAcknowledgement(deviceEui64, timeout: const Duration(seconds: 5));
      emit(ack ? DeviceCommandState.acknowledged : DeviceCommandState.failed);
    } catch (_) {
      emit(DeviceCommandState.failed);
    }
  }
}

Commissioning and Security

Adding new device to Thread network — commissioning via DTLS tunnel. Commissioner (app or Hub) and Joiner (new device) authenticate via PSKd (Pre-Shared Key for device) — usually 8-char code on device sticker. After successful DTLS handshake, device gets Thread Network Credential: Network Key, PAN ID, Extended PAN ID, Channel.

On iOS process automated via HomeKit Accessory Setup with QR code. On Android — via Matter Commissioning API in Google Play Services: CommissioningClient.commissionDevice() takes CommissioningParams with device code.

Security important: Thread Network Key cannot store plaintext in app. If app works with custom OTBR, Border Router API must be accessible only from local network and protected with mTLS or Bearer token.

Assessment and Timeline

Volume depends on what's already on hardware side. If Border Router provided by client with ready REST API — integration into mobile app takes 2-4 weeks: communication layer design, commissioning implementation, device state handling, real hardware testing. If custom OTBR setup needed — from 6 weeks. Cost calculated after analyzing network scheme and platform requirements.