LoginSignup
0
0

More than 3 years have passed since last update.

iPhone/iPad で IoT( Inkbird iBS-TH1の温湿度をAzure IoTHubに送信)

Posted at

Send Inkbird iBS-TH1 data to Azure IoTHub

プロジェクトの概要: iPhoneを経由して、プローブ付きのセンサーデータ(温度、湿度、日時、緯度経度)をAzure IoTHubに送信する。
githubのプロジェクト

利用シナリオ: 車やトラックなどで移動するとき、温湿度及び位置情報を(ゲートウエイなしで)iPhone経由でAzure IoTHubに送信して可視化や蓄積する。
今回は温度・湿度センサー情報を送っているが、ソースコードを変更すればどんなBLE(CO2濃度センサー、ガスセンサー等々)デバイスの情報が送られる。
スマートファクトリーやスマートオフィスにはBLE対応のIoTゲートウエイの使用を推奨。

Azure PowerBIと連携すれば、ほぼリアルタイムで位置情報とセンサー情報をマップ上に可視化できる。
PowerBI

イメージ図:

イメージ図

Build

  1. git clone https://github.com/mesgar/inkbird/ inkbird
  2. cd inkbird
  3. pod install
    スクリーンショット

  4. open [inkbird.xcworkspace] with xcode and build
    上手くいかなかった場合、下記の更新期ドキュメントを参照する。
    クイック スタート:デバイスから IoT ハブへのテレメトリの送信 iOS

Settings

  1. Add [NSBluetoothAlwaysUsageDescription] [Wants to use bluetooth] to plist.info 実デバイスで許可されたらこんな感じになる スクリーンショット 2020-12-31 16.42.57.png
  2. Set your IoTHub Connection string in ViewController.swift
code
    //Put you connection string here
    private let connectionString = ""

シミュレーターで実行できないので、実デバイス(iPhone/iPad)で実行する必要がある。
Startボタンを押したら1分おきにセンサーのデータを読み込んで、Azure IoTHubに送信する。

0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0