-
Notifications
You must be signed in to change notification settings - Fork 735
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
Error while trying to run blob upload from MQTT client sample #276
Comments
Hi @jakuboz, I took a look at your code. Are you using the same connection string in both the MQTT half and the Upload half? If you are then your original connection will be terminated by the service when you attempt to connect again. You need to share the IoTHub Client handle between the two. Mark Radbourne MSFT |
I've tried using (with the same host name):
P.S. |
Hi @jakuboz, You may not see connection termination because the MQTT connection is performed lazily. It does not connect until you call DoWork. Since you don't do that in the file upload portion of the code the MQTT service is likely not aware that you are connecting twice hence you do not see the disconnection. However, the file upload service will be confused because it will be aware of the other connection with the same device name. I would, however, expected your third scenario, different devices and access keys to have worked. To the Azure IoT hub you would have appeared as two separate devices. I may need to take a look at that. I've closed your issue. If you still have problems then feel free to reopen it or create a new issue. Mark Radbourne MSFT |
OS and version used: Raspbian Stretch 4.9.41-v7+ OPTION_DO_WORK_FREQUENCY_IN_MS #1023
SDK version used: 1.1.26
Description of the issue:
I've tried to combine two samples thogether- iot_hub_client_sample_mqtt and iot_hub_client_sample_upload_to_blob. After receiving a message from Cloud program should upload a blob to a storage.
While- when run separately- samples work fine (small exception below), after simply copy-pasting them together and running gives me an error.
Only modification to my environment is mentioned here: #219 (comment) - I've replaced openssl with libcurl4-gnutls-dev
Code sample exhibiting the issue:
Complete source code is available on my github.
https://github.com/jakuboz/iot_hub_sdk_sample
I've tried not to modify the samples much, only appropriate connection strings are needed to run the sample.
First I thought that issue was caused by running both activities in a single thread (running both samples simultaneously works) hence the threadFunc in (...)upload_to_blob but this seems not to be the issue.
Lines 95 and 96 in (...)sample_mqtt.c can be used alternatively.
Repro steps:
Console log of the issue:
If not direct help, then push in the right direction would be much appreciated, as I've already run out of ideas.
The text was updated successfully, but these errors were encountered: