Im quite new to Chripstack, and im running into a problem. I want to create a device from purely from REST api calls and return the keys to join as a response.
Currently i can create a device by POST call. I see it listed in my applications and i can also fetch it with a get request to /api/devices/{devEUI}.
The problem im currently running into is that when i call /api/devices/{devEUI}/keys or /activation i get the following result:
Im not sure, but from that i conclude that the devEUI is correct. I also found an error in the application server log saying it cant find the grpc method getKeys.
I found what the problem was, to be able to execute the …/keys get call you first need to provide all the keys to the API. So you need to provide the devEUI, networkKey, appKey and genAppKey.
What i dont understand is why you would have to provide every key. Chirpstack already has a function on the dashboard to generate those keys, why cant it generate the keys on creation of the device. If people need to use their own keys they can create another post call. Now everybody is forced to do multiple post calls.
ChirpStack does provide a function to generate random keys (this is done by the web-interface), but still you need to do a POST to the .../keys endpoint, which is what the web-interface also do for you.
Note that for most devices, these keys are provided by the device vendor. Generating random keys is great for testing, but it does not work for all devices. In case the join-request is forwarded to an external join-server, then it is expected that a device has no keys at all.