babelouest / carleon

Backend application webservices for logres and angharad applications

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Carleon

House automation side services.

This repository has been archived because this source code has moved to its mother project

Part of the Angharad system, but you can use it as a standlone program.

Provides the context execution for carleon services.

Carleon services

Carleon implements an interface to control multiple types of house automation services (camera, music, etc.). To add a new service, you have to create a library with the proper functions, then place the library in the folder specified by modules_path in your configuration file, then restart the program.

Check Carleon services modules How-To for more information on how to build a service.

Prerequisites

External dependencies

TL;DR

On Debian-based systems (Debian, Raspbian, Ubuntu), use the following comand to install dependencies:

sudo apt-get install libmicrohttpd-dev libjansson-dev libcurl4-gnutls-dev libmysqlclient-dev libsqlite3-dev libconfig-dev

git clone https://github.com/babelouest/orcania.git
cd orcania
make
sudo make install

git clone https://github.com/babelouest/yder.git
cd yder/src
make
sudo make install

git clone https://github.com/babelouest/ulfius.git
cd ulfius/src
make
sudo make install

git clone https://github.com/babelouest/hoel.git
cd hoel/src
make
sudo make install

You need gcc and Make to compile the program.

External libraries are mandatory to compile Benoic:

Also, Benoic is based on Angharad libraries to work:

  • Orcania, Potluck with different functions for different purposes that can be shared among angharad programs
  • Yder, Logging library
  • Ulfius, Web Framework for REST Applications
  • Hoel, Database abstraction library

Installation

Standalone compilation

When all prerequisites are installed, clone carleon from github:

git clone https://github.com/babelouest/carleon.git
cd carleon
make release-standalone

Carleon service compilation

Go to Carleon services directory, then compile the services you need.

cd service-modules
make libservicemotion.so libservicempd.so

Full system installation

Go back to carleon source folder, then as root, run make install:

cd carleon
sudo make install

Database installation

Depending on your needs, you can use a sqlite3 database (single file, fast and reliable) or a MySQL Database (fast and reliable as well but also more secure).

MySQL Installation

Run the SQL script carleon.mariadb.sql file under an already existing database.

mysql < carleon.mariadb.sql

SQLite3 installation

Run the SQL script carleon.sqlite3.sql file in an existing or a new SQLite3 database file:

sqlite3 carleon.db < carleon.sqlite3.sql

Configuration

The file carleon.conf.sample contains a sample file with all the configuration parameters needed, just fill the parameters with your own environment. Paths can be relatives or absolute.

Copy carleon.conf.sample into your configuration folder as carleon.conf

cp carleon.conf.sample /usr/local/etc/carleon.conf

Run Carleon

To run carleon, simply execute the command:

/usr/local/bin/carleon --config-file=/usr/local/etc/carleon.conf

Check the log messages in the log file, syslog or the console, depending on your configuration, then the server will be up and running when you'll se the following log message:

yyyy-mm-dd hh:mm:ss - Carleon INFO: Start carleon on port 2756

API Documentation

The full API Documentation can be found in the file API.md:

About

Backend application webservices for logres and angharad applications

License:GNU General Public License v3.0


Languages

Language:C 97.8%Language:Makefile 2.2%