LoginSignup
1
0

More than 3 years have passed since last update.

Ubuntu 20.10 で Azure IOT Hub を使う

Last updated at Posted at 2021-01-14

mosquitto のクライアントのインストール

sudo apt install mosquitto-clients

azure-cli のインストール

curl -sL https://aka.ms/InstallAzureCLIDeb | sudo bash

インストールされたことを確認

$ az --version
azure-cli                         2.17.1

core                              2.17.1
telemetry                          1.0.6

Python location '/opt/az/bin/python3'
Extensions directory '/home/uchida/.azure/cliextensions'

Python (Linux) 3.6.10 (default, Dec 31 2020, 08:28:31) 
[GCC 10.2.0]

Legal docs and information: aka.ms/AzureCliLegal


Your CLI is up-to-date.

Please let us know how we are doing: https://aka.ms/azureclihats
and let us know if you're interested in trying out our newest features: https://aka.ms/CLIUXstudy

Azure にログイン

$ az login
To sign in, use a web browser to open the page https://microsoft.com/devicelogin and enter the code H4GVAAAAA to authenticate.

ブラウザーで、https://microsoft.com/devicelogin にアクセスしてコードを入れます。

拡張機能のインストール

az extension add --name azure-iot

SAS トークンの取得

az iot hub generate-sas-token -n iot-first

pip3 のインストール

sudo apt install python3-pip

paho のインストール

sudo pip3 install paho-mqtt
1
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
1
0