This is an old revision of the document!
Bulk Device Upload (CSV Format)
This documentation provides guidelines for formatting a CSV (Comma-Separated Values) file for performing bulk device uploads in your application. To successfully upload devices in bulk, the CSV file must adhere to the following specifications.
CSV Column Requirements
The CSV file should contain the following columns in the specified order:
- devEUI: The device EUI (Extended Unique Identifier), which serves as a unique identifier for the device. It should be in hexadecimal format (e.g., `0123456789ABCDEF`).
- applicationKey: The application key associated with the device. This key provides secure communication between the device and the application. It should be a string of characters or alphanumeric values.
- deviceName: The name of the device. It should be a descriptive name that helps identify the device within your application. The value can be a string of characters.
- joinEUI: The join EUI of the device. The join EUI is a globally unique identifier used during the device activation process. It should be in hexadecimal format (e.g., `0123456789ABCDEF`). This column is only used for TTN network server configurations.
- udtName: The UDT name associated with the device. This initializes the correct UDT instance in the selected tag provider and associates an existing decoder with the device. The LoRaWan/Regional Parameters versions are also specified by the UDT. Options for UDT Names can be found in your existing UDT Definitions, or you may specify one type of UDT for the entire upload by selecting the Single Device Type option on the bulk upload menu.
- description: A brief description of the device. This field can contain additional information or notes about the device. The value can be a string of characters.
- latitude: The latitude coordinate of the device's physical location. It should be a decimal value representing the device's latitude on the Earth's surface.
- longitude: The longitude coordinate of the device's physical location. It should be a decimal value representing the device's longitude on the Earth's surface.
Alternate Formats
- Alternate formats are partially supported, such as the device export format from the TTN, where the column names available are dev_eui, join_eui, name, app_key, and description instead of the ones mentioned above. However, a single device type would need to be specified or an extra column (denoted udtName) added to the csv with the correct UDT definition names for tags to be created for each device.
Formatting Guidelines
Follow these guidelines when formatting your CSV file:
- Each row of the CSV file represents a single device.
- The first row of the file should contain the column headers, as specified above.
- Subsequent rows should contain the corresponding values for each column.
- Ensure that each device has a unique `devEUI`. Duplicate `devEUI` values will cause conflicts during the upload process.
- Columns are case-sensitive, and all columns must be present in the CSV file. However, you can leave the values empty for optional columns like description, latitude, longitude, and joinEUI (for non-TTN network uploads).
- Make sure that the CSV file is saved with the appropriate file extension, such as `.csv`.
- There should be no additional columns or data beyond the required columns specified above. Any extra columns will be ignored during the upload process.
Conclusion
By adhering to the specified format and guidelines outlined in this documentation, you will be able to successfully perform bulk device uploads using a CSV file. Ensure that your CSV file contains all the required columns and that the values are correctly formatted.