0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

AITRIOS WASM Logを見る

Posted at

Edge Applicationが出力するログ(WASM Log)を見る手順です。
環境はConsole Developer Edition + AIH-IVRW2です。

先にポイントを書いておくと、

  • デバイスにWASM Log出力を有効/無効設定します。
  • Connectedの状態じゃないと、WASM Log出力を有効化するときにエラーになります。
  • デバイスの電源をオフするとWASM Log出力は無効になります。
  • WASM Log出力が有効になっていると、WASM LogがConsoleに保存されます。

1. REST APIのアクセストークンを取得

WASM Logの有効化はConsole REST APIを使いますので、それ用のアクセストークンを取得します。

1-1. API KeyとSecretをbase64エンコード

echo -n "{API Key}:{Secret}" | openssl enc -e -base64

1-2. Access Tokenを取得

curl --request POST \
--url 'https://auth.aitrios.sony-semicon.com/oauth2/default/v1/token' \
--header 'accept: application/json' \
--header "authorization: Basic {base64したAPI KeyとSecret}" \
--header 'cache-control: no-cache' \
--header 'content-type: application/x-www-form-urlencoded' \
--data 'grant_type=client_credentials&scope=system'

こんなJSONが返ってきます。
access_tokenがアクセストークンです。

アクセストークンの有効期限は1時間です。

{
    "token_type": "Bearer",
    "expires_in": 3600,
    "access_token": "{Access Token}",
    "scope": "system"
}

2. デバイスを接続

デバイスを起動してConsoleに接続しておきます。

3. WASM Logを有効化

curl --request PUT \
--url 'https://console.aitrios.sony-semicon.com/api/v1/devices/{Device ID}/configuration/applog' \
--header 'Content-Type: application/json' \
--header 'Authorization: Bearer {Access Token}' \
--data '{"enable": true}'

成功するとこんなJSONが返ってきます。

{"result":"SUCCESS"}

4. 推論の実行と停止

Console > Manage Device > Device > <Device> の Settings > Inference Control > Get Inference Dataで推論を実行すると、デバイスのWASM LogがConsoleに送られて保存されます。
推論し続けるとConsoleの負担になると思うので、推論の実行は短時間にするよう心がけましょう。

5. WASM Logを確認

Console > Manage Device > Device > <Device> の Status > WASM Logで確認できます。

image.png

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

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?