Raspberry C example code not compiled

Category: azure iot hub

Question

Naakar on Thu, 10 Jan 2019 18:53:50


Hi

I got raspberry node.js example working .

Original problem was raspberry c example.

Raspberry image is now 2017-07-05 Rasbian-jessie, Rasberry is Pi 3 model B

Following again next example:

https://docs.microsoft.com/en-us/azure/iot-hub/iot-hub-raspberry-pi-kit-c-get-started

E: Unable to fetch some archives, maybe run apt-get update or try with --fix-missing?

> I run sudo apt-get update, and then

> sudo apt-get install git-core    seems to be OK

I got error that cmake is missing

./setup.sh: line 85: cmake: command not found

> cmake then installed

then running again

sudo chmod u+x setup.sh

sudo ./setup.sh

Gives next error ( seems to be some missing file or directory)

Br Kari

Replies

António Sérgio Azevedo - MSFT on Fri, 11 Jan 2019 13:01:54


Hi Naakar,

Is this the same issue?

https://github.com/MicrosoftDocs/azure-docs/issues/18981

I suggested to use "sudo ./setup-sh --simulated-data" . Can you try it as well?

Thanks!

Naakar on Fri, 11 Jan 2019 15:30:38


Hi Antonio

Looks like same problem.

Simulation ON gives still same error, xlogging file missing ?

Below is the whole log.

Do I need to install libssl ?

E: Unable to locate package libssl1.0-dev

Br Kari


pi@raspberrypi:~/iot-hub-c-raspberrypi-client-app $
pi@raspberrypi:~/iot-hub-c-raspberrypi-client-app $ sudo ./setup.sh --simulated-data                                             Hit http://archive.raspberrypi.org jessie InRelease
Get:1 http://mirrordirector.raspbian.org jessie InRelease [14.9 kB]
Hit http://archive.raspberrypi.org jessie/main armhf Packages
Hit http://archive.raspberrypi.org jessie/ui armhf Packages
Get:2 http://mirrordirector.raspbian.org jessie/main armhf Packages [9,538 kB]
Ign http://archive.raspberrypi.org jessie/main Translation-en_GB
Ign http://archive.raspberrypi.org jessie/main Translation-en
Ign http://archive.raspberrypi.org jessie/ui Translation-en_GB
Ign http://archive.raspberrypi.org jessie/ui Translation-en
Get:3 http://mirrordirector.raspbian.org jessie/contrib armhf Packages [43.3 kB]
Get:4 http://mirrordirector.raspbian.org jessie/non-free armhf Packages [88.1 kB]
Get:5 http://mirrordirector.raspbian.org jessie/rpi armhf Packages [1,356 B]
Ign http://mirrordirector.raspbian.org jessie/contrib Translation-en_GB
Ign http://mirrordirector.raspbian.org jessie/contrib Translation-en
Ign http://mirrordirector.raspbian.org jessie/main Translation-en_GB
Ign http://mirrordirector.raspbian.org jessie/main Translation-en
Ign http://mirrordirector.raspbian.org jessie/non-free Translation-en_GB
Ign http://mirrordirector.raspbian.org jessie/non-free Translation-en
Ign http://mirrordirector.raspbian.org jessie/rpi Translation-en_GB
Ign http://mirrordirector.raspbian.org jessie/rpi Translation-en
Fetched 9,686 kB in 25s (380 kB/s)
Reading package lists... Done
Reading package lists... Done
Building dependency tree
Reading state information... Done
Package 'libssl-dev' is not installed, so not removed
0 upgraded, 0 newly installed, 0 to remove and 216 not upgraded.
Reading package lists... Done
Building dependency tree
Reading state information... Done
E: Unable to locate package libssl1.0-dev
E: Couldn't find any package by regex 'libssl1.0-dev'
mkdir: cannot create directory ‘Source’: File exists
fatal: destination path 'azure-iot-sdk-c' already exists and is not an empty directory.
~/Source/azure-iot-sdk-c/cmake/iotsdk_linux ~/Source/azure-iot-sdk-c/build_all/linux
-- The C compiler identification is GNU 4.9.2
-- The CXX compiler identification is GNU 4.9.2
-- Check for working C compiler: /usr/bin/cc
-- Check for working C compiler: /usr/bin/cc -- works
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Detecting C compile features
-- Detecting C compile features - done
-- Check for working CXX compiler: /usr/bin/c++
-- Check for working CXX compiler: /usr/bin/c++ -- works
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- IoT Client SDK Version = 1.2.12
-- Looking for include file stdint.h
-- Looking for include file stdint.h - found
-- Looking for include file stdbool.h
-- Looking for include file stdbool.h - found
-- target architecture: ARM
-- Performing Test CXX_FLAG_CXX11
-- Performing Test CXX_FLAG_CXX11 - Success
CMake Error at /usr/share/cmake-3.6/Modules/FindPackageHandleStandardArgs.cmake:148 (message):
  Could NOT find OpenSSL, try to set the path to OpenSSL root folder in the
  system variable OPENSSL_ROOT_DIR (missing: OPENSSL_LIBRARIES
  OPENSSL_INCLUDE_DIR)
Call Stack (most recent call first):
  /usr/share/cmake-3.6/Modules/FindPackageHandleStandardArgs.cmake:388 (_FPHSA_FAILURE_MESSAGE)
  /usr/share/cmake-3.6/Modules/FindOpenSSL.cmake:380 (find_package_handle_standard_args)
  c-utility/CMakeLists.txt:95 (find_package)


-- Configuring incomplete, errors occurred!
See also "/root/Source/azure-iot-sdk-c/cmake/iotsdk_linux/CMakeFiles/CMakeOutput.log".
See also "/root/Source/azure-iot-sdk-c/cmake/iotsdk_linux/CMakeFiles/CMakeError.log".
make: *** No targets specified and no makefile found.  Stop.
make: *** No rule to make target 'install'.  Stop.
gcc version check pass (current:4.9.2,require:4.4.7)
cmake version check pass (current:3.6.2,require:2.8.12)
fatal: destination path 'wiringPi' already exists and is not an empty directory.
wiringPi Build script
=====================


WiringPi Library
[UnInstall]
make: Nothing to be done for 'all'.
[Install Headers]
[Install Dynamic Lib]

WiringPi Devices Library
[UnInstall]
make: Nothing to be done for 'all'.
[Install Headers]
[Install Dynamic Lib]

GPIO Utility
make: Nothing to be done for 'all'.
[Install]

All Done.

NOTE: To compile programs with wiringPi, you need to add:
    -lwiringPi
  to your compile line(s) To use the Gertboard, MaxDetect, etc.
  code (the devLib), you need to also add:
    -lwiringPiDev
  to your compile line(s).

Using simulated data
-- Configuring done
-- Generating done
-- Build files have been written to: /home/pi/iot-hub-c-raspberrypi-client-app
Scanning dependencies of target app
[ 20%] Building C object CMakeFiles/app.dir/main.c.o
/home/pi/iot-hub-c-raspberrypi-client-app/main.c:9:45: fatal error: azure_c_shared_utility/xlogging.h: No such file or directory
 #include <azure_c_shared_utility/xlogging.h>
                                             ^
compilation terminated.
CMakeFiles/app.dir/build.make:62: recipe for target 'CMakeFiles/app.dir/main.c.o' failed
make[2]: *** [CMakeFiles/app.dir/main.c.o] Error 1
CMakeFiles/Makefile2:67: recipe for target 'CMakeFiles/app.dir/all' failed
make[1]: *** [CMakeFiles/app.dir/all] Error 2
Makefile:83: recipe for target 'all' failed
make: *** [all] Error 2

Naakar on Fri, 11 Jan 2019 15:41:17


Hi

Could it be some version mismatch libssl1.0-dev ( is that old version from 2017 that is not anymore available)

Br Kari

António Sérgio Azevedo - MSFT on Tue, 15 Jan 2019 15:10:24


Hi,

Do I need to install libssl ?

Can you give it a try? Did you have success?

If still having issues please file an issue here: https://github.com/Azure/azure-iot-sdk-c/issues

Thanks!