I am trying to test the very simple python example to get data from a ttn applcation into a raspberry database.
It works fine and then after 5…6 data stream I get the following message on my ptyhon console :
Traceback (most recent call last):
File "getData.py", line 22, in <module>
my_app = app_client.get()
File "/home/xxx/.local/lib/python3.6/site-packages/ttn/application.py",
line 64, in get
" application: {}".format(err.code().name))
RuntimeError: ('Error while getting the', ' application: PERMISSION_DENIED')
Fortunately only the second technique fails, so at least the first technique gets an opportunity to run (and it works). So, ignore the second technique (or fix it and tell everyone). You can sleep forever, or have an infinite loop, and deal with new data in the callback.
The documentation for that demo code should be improved. Everyone who tries it will see the same error, and wonder what is going on.
yeah, it is often like that…
People publish their scripts but 50% of the time with always minimal explanation and minimal testing. When you try them it does not work.
I ended to remove this rubish second part keeping only the mqtt client.
I also removed the close instructrion as I want to collect my data for ever…
The Python SDK has been discontinued and is no longer supported.
Therefore none of it’s (example) code and documentation will be further maintained, improved or corrected.
If you follow the link provided by @arjanvanb you will see the following message in the Python SDK GitHub repository’s readme:
This SDK has been discontinued and will not be further supported.
What is strange however, is that the Python SDK docs article does not make any mention that the Python SDK has been discontinued.
I will try to get this corrected and added to the docs article to prevent further confusion in the future.