Azure / azure-iot-sdk-python

A Python SDK for connecting devices to Microsoft Azure IoT services
MIT License
423 stars 377 forks source link

Raspberry Pi Project - send DHT11 sensor data to Azure IoT hub #790

Closed jerry68 closed 3 years ago

jerry68 commented 3 years ago

Hi, I've been trying a raspberry pi project to send DHT11 sensor data to Azure IoT hub (and stream real-time using Power BI), but unsuccessful (it could be due to azure-iot-sdk-python-V1, or Adafruit DHT library deprecated), I will be grateful if someone can guide or provide me the "workable" python code. Thank you very much.

cartertinney commented 3 years ago

@jerry68 Please do not use the SDK V1. It is no longer supported, or maintained by us.

Instead, please install the V2 SDK via the following command

pip install azure-iot-device

We have many samples to illustrate how to use the this library here: https://github.com/Azure/azure-iot-sdk-python/tree/master/azure-iot-device/samples/sync-samples

jerry68 commented 3 years ago

Hi,

Thanks for your reply.

I know very little about coding.. I am not sure which example can be used to “insert” / “modify” the library/ commands of DHT11..

Please help.

Best regards, Jerry

On Sat, 19 Jun 2021 at 2:04 AM, Carter Tinney @.***> wrote:

@jerry68 https://github.com/jerry68 Please do not use the SDK V1. It is no longer supported.

Instead, please install the V2 SDK via the following command

pip install azure-iot-device

We have many samples to illustrate how to use the this library here: https://github.com/Azure/azure-iot-sdk-python/tree/master/azure-iot-device/samples/sync-samples

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/Azure/azure-iot-sdk-python/issues/790#issuecomment-864196963, or unsubscribe https://github.com/notifications/unsubscribe-auth/AJ4KXRJYD6Z35L5HAT5SBYLTTODDNANCNFSM465K7QCQ .

cartertinney commented 3 years ago

@jerry68

I can't really help you write your application. Perhaps you should start with the simple send message sample and then look for other samples depending on what features you want to use.

The SDK is generic, there is nothing special about using it with DHT11. We have no specific sample, or advice for using that sensor. You use the IotHubDeviceClient to send and receive data from your IoTHub - where you get that data you send (presumably your DHT11) has nothing to do with the the client.

cartertinney commented 3 years ago

Closing due to inactivity