I am trying to write an application which checks for any uplinks and downlinks of one device.
I already tried the example code which was discussed in this topic
Furthermore I tried this code which is an adaption of the example code from here (https://www.thethingsnetwork.org/docs/applications/python/):
import time import ttn app_id = "xxx" access_key = "ttn-account.xxx" def downlink_callback(msg, client): print("Downlink from ", msg.dev_id) print(msg) handler = ttn.HandlerClient(app_id, access_key) # using mqtt client mqtt_client = handler.data() mqtt_client.set_downlink_callback(downlink_callback) mqtt_client.connect() time.sleep(60) mqtt_client.close() # using application manager client app_client = handler.application() my_app = app_client.get() print(my_app) my_devices = app_client.devices() print(my_devices)
I am not able to receive downlink data. Is there something wrong in my code?
For uplink_callbacks it is working.
Can anyone help?