Yuvraj-Takey / sitewhere-linux

C library that simplify sending data to SiteWhere from any Linux based system.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Sitewhere-Linux library

C library that simplify sending data to SiteWhere from any Linux based system.

C library that allows Linux system to interact with SiteWhere. You can register a device with the SiteWhere, publish events using the provided API and receive commands which can be used to execute code on the device. Messages like SendMeasurement, SendLocation, SendAlert are implemented also abnormal termination are handled. The protocol(MQTT) is used to create a persistent connection between the Linux-application and a SiteWhere instance.

Developer Setup

  • Linux platform
  • gnome-terminal
  • Internet connection

Quickstart

  1. Clone this repository.
  2. Install some dependencies
    • Download MQTTClient-C library from eclipse paho
    • Traverse till that downloaded directory using $ cd command and enter the following commands
      $ sudo apt-get install cmake
      $ cmake -DPAHO_WITH_OPENSSL=TRUE
      $ make
      $ sudo make install
      
  3. Now copy all libpaho-mqtt* files into /usr/lib/ from /usr/local/lib/ and also all MQTT* header files into /usr/include/ from /usr/local/include/ directory
    $ sudo su
    $ mv /usr/local/lib/libpaho-mqtt3* /usr/lib
    $ mv /usr/local/include/MQTT* /usr/include/
    
  4. Now go to SiteWhere-Linux(cloned repository) directory using $ cd command and enter the below commands
    $ make
    $ make run
    

Sample Application

The sample application can be found in the SiteWhere-Linux(sw_test.c) directory. The application demostrates how an Linux system can be an IoT gateway and/or client device for SiteWhere. As an IoT gateway you can register an Linux system with SiteWhere and send location, alert, measurement events to SiteWhere. GUI is not there so you need to know some terminal basic.

Resources

You can refer the SiteWhere Documentation from here: - Introduction - userguide

About

C library that simplify sending data to SiteWhere from any Linux based system.


Languages

Language:C 99.3%Language:Makefile 0.6%Language:Shell 0.2%