多数のエンドデバイスを一括登録Tips & Tricks - CSVファイル 2 / 2

多数のエンドデバイスを一括登録Tips & Tricks - CSVファイル 2 / 2

多数のエンドデバイスを一括登録Tips & Tricks - csvファイル 2 / 2

CSVファイルリファレンス

The Things Stackは、CSV(カンマ区切り値)ファイルからのエンドデバイスのインポートをサポートしています。

この方法は、エンドデバイスのバッチが、Microsoft Excel、またはCSVファイルにエクスポートできます。その他スプレッドシートやデータベースで管理されている場合に便利です。

TTS_csv_import.png

The Things StackのCSVインポートは、以下の設定を使用します:

・セミコロン(;)をフィールドの区切り文字として使用します。これによりMicrosoft Excelやその他のスプレッドシートでの作業が便利になります。

・ヘッダー行が必要

・各行には、ヘッダー行と同じ数のフィールドを入力

・フィールド値に;を使用するには引用符を使用

・引用符をエスケープするには二重引用符を使用

・不明なヘッダー列は許されるが無視されます

以下のカラムが認識されます:

Column Required Alias Format Meaning
dev_eui Yes Hexadecimal string LoRaWAN® DevEUI
join_eui Yes app_eui Hexadecimal string LoRaWAN JoinEUI (or AppEUI)
id No Alphanumeric string, lowercase with hyphens Device ID (falls back to DevEUI if not set)
name No Free form Name
description No string Optional, description of the device
lorawan_version No * See MACVersion LoRaWAN version
lorawan_phy_version No * See PHYVersion LoRaWAN Regional Parameters version
frequency_plan_id No * See Frequency Plans Frequency plan ID
brand_id No Vendor ID string from Device Repository Device brand ID
model_id No Model ID from Device Repository Device model ID
firmware_version No Firmware version from Device Repository Firmware version
hardware_version No Hardware version from Device Repository Hardware version
band_id No See Frequency Plans LoRaWAN Band ID
supports_class_c No boolean true for Class C devices, false otherwise.
app_key Yes Hexadecimal string LoRaWAN AppKey
nwk_key No Hexadecimal string LoRaWAN NwkKey
rx1_delay No string Delay for the first Class A receive window (Rx1). Typical values are "RX_DELAY_1" (1 second) and "RX_DELAY_5" (5 seconds). See MACSettings for more information.
supports_32_bit_f_cnt No boolean true if device supports 32-bit frame counters, false if device only supports 16-bit frame counters.
dev_addr For existing session Hexadecimal string Needed for ABP devices or when migrating OTAA devices with an existing session. See Device Address for more information.
app_s_key For existing session string Needed for ABP devices or when migrating OTAA devices with an existing session. See Application Session Key for more information.
f_nwk_s_int_key For existing session string Forwarding Network Session Integrity Key, also referred to as Network Session Key in LoRaWAN v1.0.x compatibility mode. See SessionKeys and Forwarding Network Session Integrity Key for more information.
last_f_cnt_up For existing session uint Last uplink frame counter used.
last_n_f_cnt_down For existing session uint Last network downlink frame counter used.
last_a_f_cnt_down For existing session uint Last application downlink frame counter used.
  • これを設定しない場合は、C言語のインポート時にフォールバック値を設定する必要があります。右記ご参照: Importing devices.

例:

最小限の例:

dev_eui;join_eui;frequency_plan_id;lorawan_version;lorawan_phy_version;app_key
1111111111111111;1111111111111111;EU_863_870_TTN;MAC_V1_0_4;RP002_V1_0_3;11111111111111111111111111111111
2222222222222222;2222222222222222;EU_863_870_TTN;MAC_V1_0_4;RP002_V1_0_3;22222222222222222222222222222222
3333333333333333;3333333333333333;EU_863_870_TTN;MAC_V1_0_4;RP002_V1_0_3;33333333333333333333333333333333

LoRaWAN 1.0.4デバイスのすべての列:

id;dev_eui;join_eui;name;frequency_plan_id;lorawan_version;lorawan_phy_version;brand_id;model_id;hardware_version;firmware_version;band_id;app_key
test-one;1111111111111111;1111111111111111;Device 1;EU_863_870_TTN;MAC_V1_0_4;RP002_V1_0_3;the-things-industries;generic-node-sensor-edition;1.0.4;1.0;EU_863_870;11111111111111111111111111111111
test-two;2222222222222222;2222222222222222;Device 2;EU_863_870_TTN;MAC_V1_0_4;RP002_V1_0_3;the-things-industries;generic-node-sensor-edition;1.0.4;1.0;EU_863_870;22222222222222222222222222222222
test-three;3333333333333333;3333333333333333;Device 3;EU_863_870_TTN;MAC_V1_0_4;RP002_V1_0_3;the-things-industries;generic-node-sensor-edition;1.0.4;1.0;EU_863_870;33333333333333333333333333333333

EXCELテンプレート:

Download the Excel template.

エクセルのテンプレートをダウンロードしてください。不要な列はすべて削除してください(上記参照)。

The Things Stack用にエクスポートするには、「ファイル」→「名前を付けて保存」と進み、ファイル形式として「カンマ区切り値」を選択します。