Hi Everyone,
I’m trying to create my own smart home application using TTN python SDK. I started by using the example code, as written below:
app_id = “foo”
access_key = “ttn-account.**********************”
def uplink_callback(msg, client):
print("Received uplink from ", msg.dev_id)
print(msg)
handler = ttn.HandlerClient(app_id, access_key)
Where I provided correct App ID and access key, and the rest of the parameters used are the default (such as discovery address etc.)
Unfortunately, I get the following error:
Traceback (most recent call last):
File “C:/Users/Alon_Berman/Desktop/TempMonitor/temperature_monitor/server/ttn_client.py”, line 17, in
handler = ttn.HandlerClient(app_id, access_key)
File “C:\Users\Alon_Berman\Desktop\TempMonitor\temperature_monitor\venv\lib\site-packages\ttn\handler.py”, line 32, in init
self.__open(discovery_address)
File “C:\Users\Alon_Berman\Desktop\TempMonitor\temperature_monitor\venv\lib\site-packages\ttn\handler.py”, line 47, in __open
self.announcement = discovery.get_by_app_id(self.app_id)
File “C:\Users\Alon_Berman\Desktop\TempMonitor\temperature_monitor\venv\lib\site-packages\ttn\discovery.py”, line 54, in get_by_app_id
return self.client.GetByAppID(req)
File “C:\Users\Alon_Berman\Desktop\TempMonitor\temperature_monitor\venv\lib\site-packages\grpc_channel.py”, line 824, in call
return _end_unary_response_blocking(state, call, False, None)
File “C:\Users\Alon_Berman\Desktop\TempMonitor\temperature_monitor\venv\lib\site-packages\grpc_channel.py”, line 726, in _end_unary_response_blocking
raise _InactiveRpcError(state)
grpc._channel._InactiveRpcError: <_InactiveRpcError of RPC that terminated with:
status = StatusCode.UNKNOWN
details = “Stream removed”
debug_error_string = “{“created”:”@1578742144.428000000",“description”:“Error received from peer ipv4:52.178.215.58:1900”,“file”:“src/core/lib/surface/call.cc”,“file_line”:1056,“grpc_message”:“Stream removed”,“grpc_status”:2}"
I tried to look for any clues on the internet, but I couldn’t find any useful information about it.
Perhaps someone can clarify why the application fails to instantiate the ClientHandler object?
Thanks in advance!
Alon.