-
Notifications
You must be signed in to change notification settings - Fork 426
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
AWSIoTPythonSDK - UserDefinedException Handling #15
Comments
Hi @Venkat2811 , Thank you very much for using AWS IoT Python SDK! In the Python Paho client, which is also used in the SDK as the MQTT layer, network traffic is managed in a separate thread. The client itself will not be able to send out MQTT packets unless the network traffic is enabled. Paho has provided severals APIs for managing the network traffic. One of them is
If you are using the SDK, it starts the network traffic thread in the background for you upon connect: Can you specify more about the issue you are having with the SDK? Are you having trouble publishing messages to AWS IoT? Do you have any error messages when you experiencing the missing publishes issue? Thanks, |
Hi @liuszeng , Thanks for your explanation. Yes after raising the issue, I noticed that you are also using loop_start() in connect() method of SDK. I tried to recreate the problem, but I couldn't. The problem is that, publish Queue got full and I got queue full exception. Client went offline for about 5 mins. Maybe it is some network issue. Also, I am unable to catch publishQueueDisabled Exception in my except block ? Why is that so.. ? User defined exceptions are caught only in except Exception block. I would like to have separate except block for pubishQueueDisabled and publishQueueFull exceptions. |
Hi @Venkat2811 , Sorry for the delayed reply. Thank you very much for providing the information. From your description, it seems like a disconnect happened in between and SDK client started to queue up outbound publish requests until it reaches the maximum internal queue size. To further investigate into the issue, we will need more debug information for that. As for exceptions, this is indeed a defect and we will fix it in the future releases. By now, you can use the following workaround: After you installed "AWSIoTPythonSDK", include the following lines into your code:
Thank you very much for pointing it out and making the SDK better. Liusu |
Hi @liuszeng , I was unable to recreate the issue. Sorry I couldn't provide more debug info. I included the above lines that you have shared in my program. Still publishQueueFullException, publishQueueDisabledException is not caught in their appropriate Were you able to do that ? Thanks, |
Hi @Venkat2811 , The following is the working code piece (Python 3.5.1, 2.7.3) for this work-around:
Can you try it again and see if the issue still exists? Thanks, |
Hi @liuszeng I am using Python 2.7.12. I'll check with 2.7.3 Will be expecting fix for this issue in future release. Thank you very much for your help :) Thanks, |
Renaming issue |
Addressed in v1.1.0. |
I'm a new guy to the AWS SDK, MQTT and IoT. |
Hi @joseph-mctigue , Thank you very much for your interest in AWS IoT Device SDK for Python. Can you open up a new thread to explain your use case and questions in details? Thanks, |
Hi,
I've been trying publishing messages to my local Mosquitto MQTT broker via Paho client and also to AWS IoT using your SDK. Sometimes, even though internet connectivity is available messages don't get published. After doing some reading, I found that loop_start() and loop_stop() of paho can help to over come this. I tried in my native paho client and also in AWS SDK. Before publishing I'll do loop_start() and after publishing I'll be doing loop_stop(). It's good so far and messages are published.
Is it a good practice ?
Would like to hear your inputs on this.
Thanks,
Venkat
The text was updated successfully, but these errors were encountered: