Creating a Terraform Provider for LoRaServer

I WAS trying to get this to work and HAD some questions:

  1. Where in the Chirpstack dashboard can I find the ApplicationID (in64) field for the device XLSX?
    Answer: integrations/mqtt page says to view a device and then look in the address bar (for me that’s “http://10.1.6.90:8080/#/organizations/1/applications/1/devices/4491600000f7d7bb”). So, my ApplicationID is just “1”?
    [Yes, this is correct.] [edit] Since I managed to accidentally delete my application (see below), that’s now “3”.

  2. In the DeviceImportRecord, what is/how do I determine the NetworkKey (string)? “NetworkKey” links to just this entry on forums.chirpstack.io (useless to me).
    Answer: I just used Device Key that all of my devices come with IN BOTH FIELDS (NetworkKey & ApplicationKey). Devices join fine.

  3. I also ‘guessed’ DeviceProfileID wrong - it must be the UUID of “Device-profiles/rb_decoded”. So, in Chripstack, go to a particular device profile and then look at address line. For me that was “http://10.1.6.90:8080/#/organizations/1/device-profiles/34c91614-d656-42f6-b3bf-edad433b90de”. The DeviceProfileID is the last string, but must remove all the dashes.

  4. Every time I ran the script, it exited with an error BUT it still added one sensor - it was seeing a space in first position of every ApplicationKey field but still adding device, sans AppKey. It should ignore leading & trailing spaces :slight_smile:

    2021/08/06 18:50:07 WARNING: proto: file “common.proto” is already registered
    A future release will panic on registration conflicts. See:
    https://developers.google.com/protocol-buffers/docs/reference/go/faq#namespace-conflict

    2021/08/06 18:50:07 using insecure api
    2021/08/06 18:50:07 device CCC0790000EE5595 already exists (row 2)
    2021/08/06 18:50:07 import error (device CCC0790000EE4DCC) (row 3): rpc error: code = InvalidArgument desc = encoding/hex: invalid byte: U+0020 ’ '
    exit status 1

In lieu of XLSX file, below is line for one device that I’m using:
DevEUI (str) = CCC0790000EE5595
ApplicationID (in64) = 1
DeviceProfileID (str) = 34c91614d65642f6b3bfedad433b90de
Name (str) = 301-C1
Description (str) = External_RTD_-40to100C
NetworkKey (str) = 00000000000000000000000000000000
ApplicationKey (str) = BBA84EB3883E1142996C9FA474D0E7C8

Too bad there is no column to specify value for “Disable frame-counter validation” as all of my devices have this turned off (ON by default). So all devices still require a manual edit :frowning:

It’s working now.

Thank you.

P.S. Thank you for this great software. I’m adding sensors in an older facility and not having to run conduit is a lifesaver.