Exercise: Test the app
The only thing left is to test the app.
Test the app
Complete the following steps in the SSH session on the Raspberry Pi:
Launch the app
./cheesecave.net
The app runs and displays the current status. Notice Fan is OFF.
Note
If you receive either
No such file or directory
orcannot execute binary file: Exec format error
, the most likely cause is a 32/64-bit mismatch between Raspberry Pi OS and your target runtime.Type fan and press Enter.
The LED illuminates and the console prints a status showing Fan is ON.
Type fan and press Enter again to turn off the LED.
Blow some hot or cold air over the BME280 breakout.
Type status and press Enter. Notice the effect of the air on the temperature and humidity readings.
Type exit and press Enter to end the program.
Congratulations! You've built and coded a working IoT device prototype!
What to do if something doesn't work
If your app doesn't work right or throws an exception, don't panic. Check the following things:
- Double-check the connections on your breadboard. Use the tables and diagrams in unit 2 for reference.
- Did you enable the
I2C
service usingraspi-config
? - Did you include the right device address for your BME280? If
Bme280.DefaultI2cAddress
doesn't work, tryBme280.SecondaryI2cAddress
instead. - Debug the code remotely, if needed. See the .NET IoT Libraries documentation for details.
- Use the
i2cdetect
tool as described here to verify your I2C bus and BME280 breakout are functioning.