One of the long time frustrations with Raspberry Pi development is that you needed a physical device and hardware (sensors, buttons, etc) to fully develop and test your Internet of Things (IoT) solutions. Many haven’t really seen this as an issue since deploying code to the device isn’t really that difficult. However, this presents yet another hurtle when first learning how to develop IoT solutions. This can especially be a hurtle when you need to purchase hardware in order to start learning how to develop IoT solution using Microsoft Azure IoT Suite. For this reason Microsoft has created the Raspberry Pi Azure IoT Online Simulator. This simulator does just what it sounds; it simulates the Raspberry Pi hardware so you can easily get coding IoT solutions with ease.
The Raspberry Pi Azure IoT Online Simulator is currently in a Preview state at the time of writing this article. As a result it has a limited feature set, but you can expect the features to get expanded out as Microsoft (and possibly other community members) contribute further to the project. The project is Open Source and hosted on Github, so you can view the full source code as well as submit Pull Requests yourself as well!
The Raspberry Pi Azure IoT Online Simulator is broken out into the following user interface areas:
- Hardware Assembly – You can see your device status, and it’s hardware configuration
- Coding Editor – You have access to an Online Code Editor to write your app to run on the device with Node.js.
- Integrated Console Window – You can see the console output of your app here.
The simulator is still a bit limited currently as it only supports a “hardcoded” hardware configuration of a Raspberry Pi 3, Adafruit BME280 (Temperature, Barometric pressure, and Humidity) sensor, and a Red LED. This limitation is due to the project currently being in a Preview state. As it progresses towards GA (General Availability) you should be able to expect it to be grown out into a much more feature rich simulator environment.
The default code sample in the Raspberry Pi Azure IoT Online Simulator is written in Node.js and it is setup to perform the following actions:
- Connect to Azure IoT Hub
- Read sensor data from the BME280 sensor
- Send sensor data as message to Azure IoT Hub every 2 seconds
- Blink the LED each time a message is successfully sent to IoT Hub
- Write out the body of a message to the console each time one is received.
You can view the full source code for the default code sample by either going to the Raspberry Pi Azure IoT Online Simulator, or by viewing it directly on the Github project.
I look forward to seeing how this project progresses overtime, and what it becomes. This project has some great potential. And, even though it only supports Node.js for programming it still looks to have some great potential!