Changes for page Notes for TTN
Last modified by Xiaoling on 2025/08/04 14:58
From version 201.1
edited by Edwin Chen
on 2023/03/15 16:07
on 2023/03/15 16:07
Change comment:
There is no comment for this version
Summary
-
Page properties (2 modified, 0 added, 0 removed)
Details
- Page properties
-
- Author
-
... ... @@ -1,1 +1,1 @@ 1 -XWiki. Edwin1 +XWiki.Xiaoling - Content
-
... ... @@ -805,6 +805,133 @@ 805 805 806 806 == 8.1 How to import devices keys to server. == 807 807 808 + 808 808 **For TTS in LPS8v2** 809 809 811 +Open your application and click the button **Import end devices** 812 + 813 +[[image:https://www.thethingsindustries.com/docs/getting-started/migrating/import-end-devices.png||alt="import devices" height="517" width="828"]] 814 + 815 + 816 +Select the **File format** and upload the file (e.g. or ).devices/jsondevices.csv 817 + 818 +You can specify **Fallback values** for Frequency plan and LoRaWAN and Regional Parameters version, in case the import file does not specify these settings for the device. 819 + 820 +You can also expand the **Advanced claiming and component settings** to set targeted components, and set the claim authentication code to be generated. 821 + 822 +Start the import by clicking the **Import end devices** button. 823 + 824 +[[image:https://www.thethingsindustries.com/docs/getting-started/migrating/upload-file.png||alt="upload devices.json file" height="536" width="858"]] 825 + 826 +Wait for the end devices to be successfully imported. In case any device fails, you will see a relevant error message in the console. 827 + 828 +[[image:https://www.thethingsindustries.com/docs/getting-started/migrating/operation-finished.png||alt="import finished" height="551" width="882"]] 829 + 830 +If the import was successful, your devices are added to the list of end devices in your application. 831 + 832 +[[image:https://www.thethingsindustries.com/docs/getting-started/migrating/successful-import.png||alt="successful-import" height="556" width="889"]] 833 + 834 +Devices are now registered on The Things Stack. 835 + 836 + 837 +=== **JSON File Reference** === 838 + 839 + 840 +The Things Stack allows you to import end devices from V2, ChirpStack and other LoRaWAN networks using a JSON file describing those devices. 841 + 842 +Using JSON file with device descriptions, you can migrate end devices with or without their existing sessions. 843 + 844 +Here is an example of an OTAA device description in the file:devices.json 845 + 846 +{{{{ 847 + "ids": { 848 + "device_id": "my-device", 849 + "dev_eui": "0102030405060708", 850 + "join_eui": "0102030405060708" 851 + }, 852 + "name": "My Device", 853 + "description": "Living room temperature sensor", 854 + "lorawan_version": "MAC_V1_0_2", 855 + "lorawan_phy_version": "PHY_V1_0_2_REV_B", 856 + "frequency_plan_id": "EU_863_870_TTN", 857 + "supports_join": true, 858 + "root_keys": { 859 + "app_key": { 860 + "key": "01020304050607080102030405060708" 861 + } 862 + } 863 +} 864 +}}} 865 + 866 +Multiple end devices can also be contained in a single file like so:devices.json 867 + 868 +{{{{ 869 + /* device 1 */ 870 +} 871 +{ 872 + /* device 2 */ 873 +} 874 +}}} 875 + 876 +The format above is considered by the Console and CLI as a JSON stream, processing one object at a time. For more details in how to use the file 877 + 878 + 879 +=== **CSV File Reference** === 880 + 881 + 882 +The Things Stack has support for importing end devices from CSV (comma-separated values) files. This is useful when batches of end devices are managed in Microsoft Excel or any other spreadsheet or database that can export to CSV file. 883 + 884 +The CSV import in The Things Stack uses the following settings: 885 + 886 +* Semicolon () as field delimiter. This makes working with Microsoft Excel and other spreadsheets convenient; 887 +* Header row is required 888 +* On each row, the same number of fields as on the header line 889 +* Use quotes to use in a field value; 890 +* Use double quotes to escape quotes 891 +* Unknown header columns are permitted and ignored 892 +* Name and id cannot have capital letters and special characters 893 +* Example column lorawan_phy_version is not needed 894 + 895 +(% style="display:none" %) 896 + 897 + 898 +=== **Example** === 899 + 900 + 901 +Minimal example: 902 + 903 +{{{dev_eui;join_eui;frequency_plan_id;lorawan_version;lorawan_phy_version;app_key 904 +1111111111111111;1111111111111111;EU_863_870_TTN;MAC_V1_0_4;RP002_V1_0_3;11111111111111111111111111111111 905 +2222222222222222;2222222222222222;EU_863_870_TTN;MAC_V1_0_4;RP002_V1_0_3;22222222222222222222222222222222 906 +3333333333333333;3333333333333333;EU_863_870_TTN;MAC_V1_0_4;RP002_V1_0_3;33333333333333333333333333333333 907 +}}} 908 + 909 +All columns for a LoRaWAN 1.0.4 device: 910 + 911 +{{{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 912 +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 913 +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 914 +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 915 +}}} 916 + 917 + 918 + 919 +=== **Excel Template** === 920 + 921 + 922 +[[Download the Excel template>>url:https://www.thethingsindustries.com/docs/getting-started/migrating/tts-end-devices-csv-template.xlsx]]. You can remove all columns that are not required (see above). 923 + 924 + 925 + 926 += 9. Trouble Shooting. = 927 + 928 +== 9.1 How to solve the problem of MIC Mismatch? == 929 + 930 + 931 +Please refer to the link below: 932 + 933 +[[http:~~/~~/wiki.dragino.com/xwiki/bin/view/Main/LoRaWAN%20Communication%20Debug/#H9.WhydoIseea22MICMismatch22errormessagefromtheserver3F>>url:http://wiki.dragino.com/xwiki/bin/view/Main/LoRaWAN%20Communication%20Debug/#H9.WhydoIseea22MICMismatch22errormessagefromtheserver3F]] 934 + 935 + 936 + 810 810