Raspberry Pi 3 を使って、「Raspberry Pi の Azure Iot Hub への接続 (Node.js)」のドキュメントのチュートリアルを実施すると、「サンプル アプリケーションの実行」の「sudo node index.js 'YOUR Azure Iot HUB DEVICE CONNECTION STRING>' 」を実行時に、以下のエラーが発生する場合があります。
----------
Unable to determine hardware version. I see: Hardware : BCM2835
,
- expecting BCM2708 or BCM2709. Please report this to [email protected]
----------
エラーメッセージの内容は、ハードウェア バージョンが、期待される BCM2708 または BCM2709 でないことを意味します。これは最新バージョンの Raspbian における Wiring-Pi に関する既知の問題に該当します。
-
- Problems with wiringPi #15
この場合、以下の対策を行うことで、エラーを解消できます。
下記の手順ではファイルの編集が必要になります。ここではエディタとしてnano を使用します。
(1) package.json を編集します。
~/iot-hub-node-raspberrypi-client-app のディレクトリで以下を実行します。
nano package.json
"wiring-pi" の行を以下に変更します。
"wiringpi-node": ">=2.4.4"
変更しましたら、Ctrl + O キー、Enter キー、Ctrl + X キーの順に押し、保存して終了します。
(2) sudo npm install を実行します。
(3) index.js を編集します。
nano index.js を実行します。
require('wiring-pi'); を以下に変更します。
require('wiringpi-node');
(4) sudo node index.js 'YOUR AZURE Iot Hub DEVICE CONNECTION STRING>' を実行します。
「YOUR AZURE IOT HUB DEVICE CONNECTION STRING>」の部分は、同ドキュメントの「デバイスの IoT ハブにデバイスを登録する」セクションの手順 6 「接続文字列の主キーをメモします。」の以下の画像のConnection string - primary key にあるコピーボタンでコピーしていただいた内容に、置き換えます。
https://docs.microsoft.com/ja-jp/azure/iot-hub/iot-hub-raspberry-pi-kit-node-get-started#register-a-device-in-the-iot-hub-for-your-device
上記の内容がお役に立てば幸いです。
Azure IoT 開発サポートチーム 津田
This post first appeared on MSDN Blogs | Get The Latest Information, Insights, Announcements, And News From Microsoft Experts And Developers In The MSDN Blogs., please read the originial post: here