Azure-Samples / iot-hub-c-raspberrypi-client-app

Application collects weather data from a BME280 sensor and sends it to IoT hub, also take actions according to cloud-to-device message, device management.
https://docs.microsoft.com/en-us/azure/iot-hub/iot-hub-raspberry-pi-kit-c-get-started
MIT License
36 stars 34 forks source link

Getting it to compile Aug 2020 #35

Open qzzf1w opened 4 years ago

qzzf1w commented 4 years ago

Not an issue. But hopefully a helping hand

Got this running with PI zero and latest "Raspberry PI OS"

Here are my steps

  1. Use PI Imager Raspberry PI OS Full (32-bit) Use 8GB 10x MicroSD Card
  2. Overlay
    SSH. wpa_supplicant.conf instructions here: https://www.tomshardware.com/reviews/raspberry-pi-headless-setup-how-to,6028.html
  3. Connect via putty download: https://www.chiark.greenend.org.uk/~sgtatham/putty/latest.html address: raspberrypi.local uid: pi pwd: raspberry
  4. Enable VNC sudo raspi-config Interfacting Options P3 VNC
  5. Install CMAke sudo apt-get install cmake
  6. Install GIT sudo apt-get install git-core
  7. Fix libssl sudo apt-get purge -y libssl-dev sudo apt-get install libcurl4-openssl-dev sudo apt-get install libssl-dev
  8. Update PI sudo apt-get update sudo apt-get upgrade
  9. Reboot sudo reboot
  10. Connect VNC download: https://realvnc.com/en/connect/download/viewer/windows/ address: raspberrypi.local uid: pi pwd: raspberry
  11. Run Welcome Wizzard
    • Set Country
    • change password
    • choose default network
    • update software
  12. Restart
  13. Connect via putty address: raspberrypi.local uid: pi pwd: new password
  14. Git the Azure IOT SOurce cd ~ mkdir Source cd Source git clone --recursive https://github.com/azure/azure-iot-sdk-c.git
  15. Build the Azure IOT Source cd azure-iot-sdk-c/build_all/linux ./build.sh --no-make cd ../../cmake/iotsdk_linux make
    sudo make install '
  16. Install Sample App Source cd ~ git clone https://github.com/Azure-Samples/iot-hub-c-raspberrypi-client-app.git cd ./iot-hub-c-raspberrypi-client-app
  17. Install wiringPI sudo apt-get install wiringpi
  18. Install parson git clone https://github.com/kgabis/parson.git cd ./parson mv parson.c parson.h .. cd .. rm -rf parson
  19. Set the sample "Simulate Data" as required sed -i 's/#define SIMULATED_DATA 0/#define SIMULATED_DATA 1/' config.h
  20. Make the sample cmake . && make
  21. Run the sample sudo ./app 'DEVICE CONNECTION STRING'
mehmoodn commented 4 years ago

Great update. Thank you!!

inatale commented 4 years ago

This post helped me a lot. Thanks. I was able to run the sample with real BME280. But also I had to use "apt-get install uuid-dev" because of an error "'uuid/uuid.h file not found" during sdk compilcation.