リカバリーモード
このページは自動翻訳されたもので、まだレビューされていません。内容に相違がある場合は、英語の原文が優先されます。 英語の原文を読む
センサーがリカバリーモードにあるかどうかとその理由を確認し、インストール済みのファームウェアを再起動します。WebGUIでの操作は、リカバリーモードを参照してください。
これらの例は Pythonライブラリを使用し、アプリケーションキーでサインインします。qb2-xxxxxxxxx をお使いのセンサーのホスト名またはIPアドレスに、application-key-for-qb2-xxxxxxxxx をキーのシークレットに置き換えてください。
センサーがリカバリーモードにあるかどうかを確認する
メソッドGetは、センサーがリカバリーモードにあるかどうかとその理由を返します。
import blickfeld_qb2
def get_recovery_state() -> None:
# Create token factory using an application key
token_factory = blickfeld_qb2.TokenFactory(
application_key_secret="application-key-for-qb2-xxxxxxxxx"
)
# Open a secure connection to the sensor
with blickfeld_qb2.Channel("qb2-xxxxxxxxx", token=token_factory) as channel:
# Use recovery service
service = blickfeld_qb2.hardware.services.Recovery(channel)
# Get the information from the recovery service
response = service.get()
# Print the response
print(response)
get_recovery_state()
リカバリーモードではないセンサーの出力です。理由はありません:
RecoveryGetResponse(recovery=Recovery())
リカバリーモードでは、reason はRecoveryオブジェクトで定義された理由のいずれかになります。例:Recovery(reason=2)
| 値 | 理由 | 次の手順 |
|---|---|---|
|
|
インストール済みのファームウェアの再起動を試みてください。インストール済みのファームウェアを再起動するを参照してください。 |
|
|
インストール済みのファームウェアを再起動する
理由がREASON_BOOT_ATTEMPTS_EXCEEDEDの場合、メソッドAttemptBootは、インストール済みのファームウェアの再起動を試みます。それ以外の理由の場合、センサーはFAILED_PRECONDITIONで呼び出しを拒否します。その場合は代わりにファームウェアをインストールしてください。
import blickfeld_qb2
def attempt_boot_from_recovery() -> None:
# Create token factory using an application key
token_factory = blickfeld_qb2.TokenFactory(
application_key_secret="application-key-for-qb2-xxxxxxxxx"
)
# Open a secure connection to the sensor
with blickfeld_qb2.Channel("qb2-xxxxxxxxx", token=token_factory) as channel:
# Use Recovery service
service = blickfeld_qb2.hardware.services.Recovery(channel)
# Call the service to attempt a boot into the existing firmware
service.attempt_boot()
attempt_boot_from_recovery()