1
votes

Currently I'm creating a IoT Hub device that reads a sensor multiple times each second. I would like to achieve 3 to 4 reading each second.

The sensor returns just a true or false and when its true I want a time-stamp and other information send to the Azure IoT hub. The device is a Raspberry Pi 3

I would like some advice. What would be the best language to create this program with? Can i send the messages every time or would this be to slow?

I made a sample program with python and used a GPIO event to detect if the pin is changed. And when it is changed, send a message to IoT hub. But i have a feeling this isn't fast enough?

Thank you for your time in advance! I hope you can give me some advice

1
Why wouldn't that be fast enough? But you are on the right track asking "Can I send messages every time...?" You could send them but if the new value that you are sending is the same as the last value then I have to argue that it is sort of redundant sending it "every time". Generally in my solutions i check the current value many times a second, but only send when there is a change, or I have hit a time threshold. If you have a solution running now, I wouldn't upgrade to another operating system until you have hit some sort of boundary or limitation.Chris Schaller

1 Answers

1
votes

It sounds like the bit your missing here is Windows 10 IoT Core as the operating system for your Raspberry Pi. For Pi 3 this is officially still in preview mode, but still works well for doing everything you've described. I've been using it on my new Pi3 for a few months now.

There are then loads of sample projects you can get your hands on to do things with sensors using C# as the language.

Here's a couple of links to get you started with Windows 10 IoT Core.

https://developer.microsoft.com/en-us/windows/iot

http://www.purplefrogsystems.com/paul/2016/06/controlling-your-windows-10-iot-core-device/

If your using a Windows workstation for development the IoT Dashboard is a must for managing your devices.

I would also recommend trying out the IoT Suite which gives you an end to end demo environment for sensors through the Azure IoT Hub and into Stream Analytics.

https://www.azureiotsuite.com/

https://channel9.msdn.com/events/Microsoft-Azure/AzureCon-2015/ACON309