Hello,
I have a problem with chirpstack v4: I am trying to create a device using gRPC to an existing application that I created manually and it has an ID “application id: 47024c85-9559-46a0-ad0d-dbf1b16bde45”.
My python file is :
import os
import sys
import grpc
from chirpstack_api.as_pb.external import api
# Configuration.
# This must point to the API interface.
server = "localhost:8081"
# The API token (retrieved using the web-interface).
api_token = "...."
if __name__ == "__main__":
# Connect without using TLS.
channel = grpc.insecure_channel(server)
client = api.DeviceServiceStub(channel)
# Define the API key meta-data.
auth_token = [("authorization", "Bearer %s" % api_token)]
# Construct request.
try:
req = api.CreateDeviceRequest()
req.device.dev_eui = 'f4fbcdb6545e5e3b'
req.device.name = 'device2'
req.device.description = 'A new device via grpc'
req.device.application_id = int('525548505299565345575353574552549748459710048100451009810249984954981001015253')
req.device.device_profile_id = 'Prof A'
req.device.skip_f_cnt_check = False
req.device.is_disabled = True
#req.device.variables = 'ras'
#req.device.variables.value = 'ras'
#req.device.tags = 'ras'
#req.device.tags.value = 'ras'
resp = client.Create(req, metadata=auth_token)
except Exception as e:
print('<><><> Exception <><><> ' + str(e))
I have an error with the variable “req.device.application_id” that must be an integer.
Thank you in advance.