Transmit Sensor Data using a Simulated Device
Last updated
Last updated
Click the button to launch the Raspberry Pi online simulator.
There are three areas in the web simulator.
Assembly area - The default circuit is that a Pi connects with a BME280 sensor and an LED. The area is locked in preview version so currently you cannot do customization.
Coding area - An online code editor for you to code with Raspberry Pi. The default sample application helps to collect sensor data from BME280 sensor and sends to your Azure IoT Hub. The application is fully compatible with real Pi devices.
Integrated console window - It shows the output of your code. At the top of this window, there are three buttons.
Run - Run the application in the coding area.
Reset - Reset the coding area to the default sample application.
Fold/Expand - On the right side there is a button for you to fold/expand the console window.
In coding area, make sure you are working on the default sample application. Replace the placeholder in Line 15 with the Azure IoT hub device connection string.
Click Run or type npm start
to run the application.
You should see the following output that shows the sensor data and the messages that are sent to your IoT hub