This how-to will cover how to get the first steps while using the thinger.io platform in the Raspberry Pi or any other Linux device. This includes how to install dependencies, clone the source code, and compile and execute the main example available in the GitHub Repository.
Requirements
A Raspberry Pi running Raspbian, and a terminal or SSH access. Other OS like Ubuntu or Debian may work but have not been tested yet. This tutorial has been tested with Debian Buster version.
Register a device in the thinger.io console and keep the credentials by hand. If any help is needed, please check this other how-to.
Install Dependencies
Thinger.io implementation for Linux requires some tools and libraries for its compilation:
A C++ compiler (GCC or Clang)
CMake to guide the compilation and search for installed libraries
OpenSSL for using secure connections with the platform
Boost Libraries used for high-performance async input/output
To install these dependencies, update the apt repository and install packages first.
pi@RevPi20679:~/thinger_iotmp_linux_client/build $ cmake ../
-- The C compiler identification is GNU 8.3.0
-- The CXX compiler identification is GNU 8.3.0
-- 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
-- Performing Test COMPILER_SUPPORTS_CXX17
-- Performing Test COMPILER_SUPPORTS_CXX17 - Success
-- Looking for pthread.h
-- Looking for pthread.h - found
-- Performing Test CMAKE_HAVE_LIBC_PTHREAD
-- Performing Test CMAKE_HAVE_LIBC_PTHREAD - Failed
-- Looking for pthread_create in pthreads
-- Looking for pthread_create in pthreads - not found
-- Looking for pthread_create in pthread
-- Looking for pthread_create in pthread - found
-- Found Threads: TRUE
-- Found OpenSSL: /usr/lib/arm-linux-gnueabihf/libcrypto.a (found version "1.1.1n")
-- OpenSSL Version: 1.1.1n /usr/include /usr/lib/arm-linux-gnueabihf/libssl.a;-lpthread;dl /usr/lib/arm-linux-gnueabihf/libcrypto.a;-lpthread;dl
-- Found Boost: /usr/include (found version "1.67.0") found components: system thread regex program_options date_time chrono atomic
-- Configuring done
-- Generating done
-- Build files have been written to: /home/pi/thinger_iotmp_linux_client/build