2

I am working on IoT Technology. I have doubt as I developed an IoT Project which is sending different sensors data to the Azure IoT Hub.

Next I bought one more Raspberry Pi 2 device and deployed my application into it. This new device can’t send sensors data to my IoT hub because, in my application, I have written a connection string for only one device.

So, there is only one chance is to edit my code but I want, without disturbing my existing code, to register my new device with my IoT hub. After deploying my application into this Pi I will then send the sensors data to IoT hub.

Please tell me how I can achieve the above scenario.

  • Could you confirm that the hub you're talking about is the Azure IoT Hub? – goobering Jul 29 '16 at 12:05
  • Yes, I used the Azure IoT Hub – Pradeep Jul 29 '16 at 12:08
  • I think I can solve this if I can figure out how to get a unique identifier from the Pi using C#. That's proving trickier than I'd hoped. I'll update if I find anything. – goobering Jul 29 '16 at 12:41
  • I think this link will help to get the Device Id and name using C#. raspberrypi.stackexchange.com/questions/45574/…, Please tell me how to get my scenario. – Pradeep Jul 29 '16 at 14:02
  • That might work for retrieving the device name, but the name isn't necessarily unique, and can normally be set by the user. What I think we can do to address your problem is to generate or retrieve some kind of UUID which is specific to that Pi, and is unchangeable throughout the Pi's lifetime. A CPU ID number, a Windows license key - something along those lines. – goobering Jul 29 '16 at 14:21

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.