Exercise: Test the app

Completed

The only thing left is to test the app.

Test the app

Complete the following steps in the SSH session on the Raspberry Pi:

  1. Launch the app

    ./cheesecave.net    
    

    A screenshot of a terminal with the cheesecave.net app running.

    The app runs and displays the current status. Notice Fan is OFF.

    Note

    If you receive either No such file or directory or cannot execute binary file: Exec format error, the most likely cause is a 32/64-bit mismatch between Raspberry Pi OS and your target runtime.

  2. Type fan and press Enter.

    Photograph of the breadboard with the LED illuminated.

    The LED illuminates and the console prints a status showing Fan is ON.

  3. Type fan and press Enter again to turn off the LED.

  4. Blow some hot or cold air over the BME280 breakout.

  5. Type status and press Enter. Notice the effect of the air on the temperature and humidity readings.

  6. 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:

  1. Double-check the connections on your breadboard. Use the tables and diagrams in unit 2 for reference.
  2. Did you enable the I2C service using raspi-config?
  3. Did you include the right device address for your BME280? If Bme280.DefaultI2cAddress doesn't work, try Bme280.SecondaryI2cAddress instead.
  4. Debug the code remotely, if needed. See the .NET IoT Libraries documentation for details.
  5. Use the i2cdetect tool as described here to verify your I2C bus and BME280 breakout are functioning.