AREG IoT SDK (or AREG SDK) is a real-time asynchronous communication framework written in C++ for embedded development that enables thin servers run on connected Things and provide device specific services at the edge of IoT network.

Overview

AREG IoT SDK to simplify multitasking programming

Bring your product to live service enabled

Introduction

AREG IoT SDK (or AREG SDK) is an Object Remote Procedure Call (ORPC) based, lightweight real-time asynchronous communication framework written in C++ that simplifies multitasking and service enabled applications development for embedded and high-end machines. AREG SDK enables mist computing at the edge of the network, where devices connect to IoT fog network not only as traditional clients, but as thin servers and provide device specific services.

More than embedded

When we were designing AREG SDK, the guiding principle was to create a framework to develop embedded applications that intelligently interact at the edge of the IoT network. To keep application design homogeneous, we defined Local services for inter-thread and the Public services for inter-process communications. As a base of IPC we used multicast routing (MCR) network communication model to have combined features of client-server and subscriber-provider (publisher-subscriber) models. In MCR network client-server nodes have logical connections and every node can be a mixture of logical servers and clients. This approach helps to create a fault tolerant, scalable and distributed system of meshed services running directly on connected Things.

Benefits

The major features of AREG SDK to benefit:

  • A combination of request-response and broadcast communication, and subscription service.
  • Transparency of service location, which also eases the creation of a simulation and a test automation.
  • Automated service discovery, automated messaging and dispatching, featured logging and code generator.

Challenges to solve

Traditionally, IoT devices are connected clients of cloud or fog servers to stream data from sensors for further processing. Since data is generated and collected at devices, it makes sense to provide network accessible (public) services directly on Things. Such a concept changes the role of connected devices and is a good foothold to provide robust solutions such as:

  • Increased data privacy, which is an important factor for sensitive data.
  • Decreased data streaming, which is a fundamental condition to optimize network communication.
  • Autonomous, intelligent and self-aware device development by providing network services directly in the environment of data origin.

Software build

AREG SDK provides Eclipse for C/C++ Developer project files for POSIX, and Visual Studio project files for Windows versions of the framework and examples. The default settings of provided project files are enough to compile all.

In case of Visual Studio, please select appropriate Solution Configuration in IDE toolbar to use the right PlatformToolset. For details on how to import projects, build and integrate framework, run examples, configure logging and multicast routing, please refer to HOWTO.md document.

Examples

The AREG SDK contains various examples to demonstrate features of the framework. The examples are listed in the examples/README.md document.

Licensing

AREG SDK is dual-licensed under commercial and free open source licenses. The commercial license gives the commercial support, full rights to create and distribute software without open source license obligations. For more details of licensing see LICENSE.txt file.

For license, support or additional information, please visit Aregtech web site or contact info[at]aregtec.com.

Comments
  • 20220205 issue18 cmake

    20220205 issue18 cmake

    Summery of changes:

    • Comments added to /conf/cmake/ configuration files.
    • Some improvements in and replacement in cmake configs.
    • New file - pre-project.cmake - added for some settings which must be added before project().

    In this phase, I must say some problems might be encountered during cross-compiling for specific scenarios, though I'm trying to solve them.

    Open to any modification or suggestion :)

    opened by Ali-Nasrolahi 16
  • CMake build patch for Visual Studio build system

    CMake build patch for Visual Studio build system

    This patch fixes:

    • Compiling and linking problems with previous script for Visual Studio

    Summary of changes:

    • New linking library added.
    • Few unused variables have been removed.
    • New configurations added to common.cmake.
    • Some Linux-specific configurations such as: GCC specific flags, have been removed for Windows.

    Tests

    Static and shared areg-sdk library has tested and all examples have been compiled and linked correctly both for Visual Studio (Windows) and Makefiles (Linux) build systems.

    As always open to any modification :)

    cmake hacktoberfest-accepted 
    opened by Ali-Nasrolahi 11
  • Wrong import and export flags of areg library

    Wrong import and export flags of areg library

    Precondition Merged the latest code and cmake changes (issue #28) in the 20220701-candidate branch to make a build.

    Actions Make a build using CMake

    Expected Compilation with no warnings and errors.

    Result When compile examples, see the warning message: WARNING: None of preprocessor defines are set. By default sets EXP_AREG_DLL. See GESwitches.h file of AREG API Core This may happen only when none of these options is set: EXP_AREG_DLL, EXP_AREG_LIB, IMP_AREG_DLL, IMP_AREG_LIB

    Note:

    1. When compile areg-sdk frameworklibrary as shared library (areg.so / areg.dll) the flag must be EXP_AREG_DLL, all other modules must have flag IMP_AREG_DLL
    2. When compile areg-sdk frameworklibrary as static library (areg.a / areg.lib*) the flag must be EXP_AREG_LIB, all other modules must have flag IMP_AREG_LIB

    Only in these cases there will be no warning. Otherwise, there will be a problem compiling for Windows OS, which requires precise import / export flags.

    bug cmake script 
    opened by aregtech 10
  • Integrate CMake file

    Integrate CMake file

    Similar to Makefile, there should be integrate CMake

    • to compile all project
    • generate files in product/gen folder
    • Add possibility to include .siml files in CMake automatically to generate sources.
    enhancement cmake script hacktoberfest 
    opened by aregtech 8
  • Examples failed to compile with VSCode and GCC compiler

    Examples failed to compile with VSCode and GCC compiler

    Describe the bug Try to compile codes in VSCode and GCC compiler of 20220701-candidate branch. All projects, except projects 10_locsvc and 11_locmesh are compiled and linked. The mentioned 2 projects failed during linking.

    To Reproduce Steps to reproduce the behavior.

    • In VSCode select CMakeLists.txt of the root folder and configure.
    • After configuration, build all projects.

    Expected behavior All projects must be compiled and linked.

    Desktop or embedded (please complete the following information):

    • OS: Windows 10
    • Hardware 64_x86
    • Compiler cygwin-gcc
    • AREG SDK version: 20220701-candidate branch.

    Additional context There were more projects that were not compiling, fixed by linking with libraries. Also tried to compile projects with MS Visual Studio CMake tool, all projects compiled fine.

    bug cmake 
    opened by aregtech 5
  • Integrate CMake file

    Integrate CMake file

    Brief description on changes

    Root cmake created with initializing aliases.

    configuration files placed in conf/cmake. some of makefile features which represented in conf/make are not compatible with cmake sysntax, therefore need a little bit polishing. (for instance configuring the platform in user.cmake )

    Absolutely open to any changes or resolving any mistake :)

    enhancement cmake 
    opened by Ali-Nasrolahi 5
  • Fixed compilation with VS Code and fixed application start

    Fixed compilation with VS Code and fixed application start

    This closes #64

    Description There where 2 critical issues described in bug #64

    1. The examples 10 and 11 where not compiling with VS Code under Windows (cygwin compiler).
    2. Other compiled applications where immediately crashing on start.

    Changes made

    1. The examples where not compiling because the compiler was requiring to import ProxyBase::Listener class, even if it is declared as private. The fix is import class: AREG_API class Listener.
    2. All examples where crashing creating stackdump files. It required multiple fixes. The reason was static objects that are created before main. Some of them where referring to other objects, which were not initialized yet. And this was causing application crash. The fixe is instead static variables use static methods that return statically created objects like this:
    Process & Process::getInstance( void )
    {
        static Process _theProcess;
        return _theProcess;
    }
    
    bug C++ cmake 
    opened by aregtech 3
  • Adding examples into CMake build

    Adding examples into CMake build

    CMake build

    Good morning @aregtech and @biwiki, hope you're doing well.

    I would like to present latest progress on CMake integration to areg-sdk.

    Change-logs

    • Rest of examples from 10_locsvc through 16_pubfsm added to CMake build routine.
    • Generated outputs would be part of product tree.
    • Few improvements on configurations happened for better solution.

    Next step

    • At this point, I believe CMake could be a trustworthy build system for areg-sdk - naturally, after being tested and modified as you desired - and could replace Makefile buiild.
      • Of course, there's always some bugfixes and improvements to make, nevertheless with current state; we could move on for now and rest could be done by small bugfixes.

    Test

    For testing result I have used following commands:

    $ cmake -Bbuild # Creates build directory for cmake configs.
    $ cmake --build build -j 4 # Builds areg-sdk core and examples by default.
    

    Output files will stay in product/<build-type> directory tree.

    Note

    Please test the build system and verify its integrity. Unfortunately, I have not proper windows machine to test Visual Studio build system; therefore, it'll be nice if you could check it out.

    As always open to any modification :)

    enhancement cmake script 
    opened by Ali-Nasrolahi 3
  • NESocket - Use std::string instead of String

    NESocket - Use std::string instead of String

    === NOT READY TO MERGE === Converting String to std::string in the areg base can be done incrementally like this. Still not compilable, but it is quite promising that we can move to std::string step by step.

    opened by biwiki 3
  • CMake integration

    CMake integration

    Good evening @aregtech and @biwiki.

    I'd like to present new progress on CMake integration to areg-sdk.

    Summery of new features and improvements:

    • Comments added to few instructions for clarification.

    • Some configuration settings have modified for better syntactical improvement.

    • Examples (01 to 09) is now compiled and linked by CMake.

      • examples 10_locsvc through 17_winchat (plus 00_helloservice) has different structure than others, therefore they need different method other than what had been implemented right now in examples/CMakeLists.txt.

        one of such difference is having multiple executables in a single example.

    Next PR will include rest of example support.

    To compile and test the output, I used following commands at root of areg-sdk :

    $ cmake CMakeLists.txt -Bbuild
    
    $ cd build
    $ make -j 4
    

    As our previous discussion, right now all examples output is still included in build directory along with mcrouter.out. Which after decision been made on output directory of executables, we could modify CMake configuration as needed easily.

    As always, open to any changes / modification. :)

    cmake 
    opened by Ali-Nasrolahi 2
  • Integrate CMake file #28

    Integrate CMake file #28

    Brief description on changes

    Root cmake created with initializing aliases.

    configuration files placed in conf/cmake. some of makefile features which represented in conf/make are not compatible with cmake sysntax, therefore need a little bit polishing. (for instance configuring the platform in user.cmake )

    Absolutely open to any changes or resolving any mistake :)

    opened by Ali-Nasrolahi 2
  • Copy config files after compilation

    Copy config files after compilation

    Motivation

    1. After compilation, the developer should be able to start any project without additional effort. At this moment, to start IPC project or to configure logging, after compilation with cmake, the developer needs manually create config subdirectory and copy log.init and router.init files in the folder of binaries. For example, compiling with msvc and make automatically do this action.
    2. make under Linux compiles and creates binaries with extension .out and msvc compiles binaries with extension .exe.
    3. Both, make and msvc compile with incremental build, which is much faster and does not require to recompile all projects.

    What to do

    1. After compilation of binaries with cmake, create config subfolder in the binary output folder bin (i.e. in bin/config) if it is not existing, and copy files log.init used by logging and router.init used for IPC.
    2. When compile under Linux, add .out extension to executable binaries, i.e. the mcrouter is mcrouter.out. No need to make this change for Windows, because the compiler automatically adds extension .exe.
    3. Support incremental build with cmake at least for Debug configuration, so that there will be no need to rebuild all projects after each small change.
    cmake script optimization improvement 
    opened by aregtech 4
  • Isolate and rename OS specific methods.

    Isolate and rename OS specific methods.

    Goal

    • Make code more readable.
    • All OS specific methods should be declared as private and have prefix _os.
    • If a regular method has OS specific code, declare a method with identical name and prefix _os, replace OS specific code there.
    • All OS specific methods should be located in the OS specific files, where suffix indicates the OS API (like Win32 or Posix).
    • The exceptions are object that completely belong to a specific OS. For example, there is a class MutexIX, which is completely belong to POSIX. In this case there is no need neither to specify the Posix suffix, nor methods having prefix _os.
    • The other exceptions can be when the OS specific code is very small and can be managed with #ifdef directive like this:
    AREG_API_IMPL bool NESocket::disableReceive(SOCKETHANDLE hSocket)
    {
    #ifdef WINDOWS
        int flag{ SD_RECEIVE };
    #else
        int flag{ SHUT_RD };
    #endif // WINDOWS
    
        return (hSocket != NESocket::InvalidSocketHandle ? RETURNED_OK == ::shutdown(hSocket, flag) : false);
    }
    

    Motivation This is a good preparation for future to integrate and support multiple OS. It clearly shows what are the OS dependent API.

    Background information At the moment, AREG SDK supports Win32 and POSIX API, so that it can be compiled under Windows and Linux platforms. All Windows specific implementations are in the Win32 and all POSIX specific implementations are in posix subfolders.

    improvement 
    opened by aregtech 0
  • UDP/IP service and communication channel

    UDP/IP service and communication channel

    Goal After implementing the UDP/IP wrapper (issue #32), it should be integrated in the AREG SDK to support communication using UDP/IP.

    Motivation The implementation of Multiple channel communication (issue #31) will allow to use different network communication. One of the easiest and fasted way to approve multi-channel communication is integration of the UDP/IP, which in comparison to TCP/IP is faster, but less stable.

    Background information The UDP/IP should be configured in the initialization files (issue #67). After setups, the network service should be able to establish UDP/IP connection and use multi-channel communication for messaging.

    enhancement C++ 
    opened by aregtech 0
  • Extend network configuration to setup multiple networks

    Extend network configuration to setup multiple networks

    Goal At this moment, AREG SDK supports only 1 communication channel via TCP/IP communication. The supported networks configuration is defined router.init file and is relevant only for message routing. The applications should be able via configuration to setup and initialize multiple network channels and protocols. In order to setup applications, there should be possibility to define the physical (network) and logical (routing) connections. This would also help to setup multi-channel communication, where each channel differ by:

    • network
    • protocol
    • message priority

    Motivation The multi-channel communication is one of agendas of AREG SDK. Each definition of the channel should be done in the configuration file. The setups and configurations should be dynamic, so that there will be no need to re-compile applications.

    Background information AREG SDK contains a parser to parse configuration files (init files). The parser has a simple syntax used to make setups to use when application initializes objects. At this moment the configuration is used to setup logging and mcrouter (IP address, port number, etc.). The parser should be extended to make initialization to use when instantiating objects like "network service". It makes basic dynamic setups.

    enhancement C++ 
    opened by aregtech 0
  • Improve streaming data rate

    Improve streaming data rate

    Goal The example 20_pubdatarate (currently available in candidate branch) shows that the communication data rate is about 100-120 MB/s on the PC. This value should be increased to achieve at least 300 MB/s on the PC.

    Motivation AREG SDK should handle high data rate without a problem (the minimum data rate on PC should be 300 MB/s). In most of the cases, the data rate should be dependent on CPU / HW, and less dependent on the code implementation. Currently nearly half of delay is because of the code. In the current implementation we serialize data in streaming object then copy data in the message. The creating event object for each target, copying data in the message, applying CRC cause delays.

    Background information The events are instantiated for each client. Currently the data is serialized in the shared buffer, but then they are copied to each message. Analyze the possibility:

    • check presence of the event listeners before starting serialization. Escape serialization if none is present.
    • create an event only once for all targets. Instead, set the list of targets sorted by channels.
    • the list should be handled by mcrouter, so that the source sends an event one time.

    The current business logic serializes data in the shared buffer then copied in the message.

    • analyze the possibility to unify messages (unify protocol) for IPC and local targets.
    • make message generic and independent on target location / channel.
    • Pay attention on mechanism of applying CRC. Maybe apply the CRC only on data and escape target / source.

    Test changes using 20_pubdatarate

    enhancement C++ optimization challenge 
    opened by aregtech 0
  • Integrate google test in CMake

    Integrate google test in CMake

    Goal Integrate Google test in the AREG SDK to star developing unit tests.

    Motivation The unit tests are used to test small functions / functionalities and it is an effective tool to find and fix bugs. Applications having high rate of unit test code coverage are quite stable. Our minimum goal is to have high rate of code coverage of base module, which contains collection of bases objects.

    Background information AREG SDK is possible to compile via cmake. The GTest contains well description how to integrate it in the project via CMakeLists.txt. In addition, there are very many projects that can be an example of integrating GTest.

    enhancement help wanted cmake script test 
    opened by aregtech 9
Releases(v1.0.0)
  • v1.0.0(Nov 11, 2021)

    The official release v1.0.0 to create interface-centric multithreading and multiprocessing distributed services running on connected Things.

    Source code(tar.gz)
    Source code(zip)
  • v0.9.2-beta(Oct 21, 2021)

  • v0.9.0-alpha(Oct 20, 2021)

    Date: 20 October 2021

    The first version of areg sdk -- asynchronous engine, which focus is to become the top mist-computing application development platform for embedded and high-end systems.

    Implemented features in version 0.9.0-alpha

    • Basic framework.
    • Service manager.
    • Timer service.
    • Request-response and publish-subscribe services.
    • Service provider and service user.
    • Logging / tracing.
    • TCP/IP communication manager.
    • Multiprocessing and multithreading automated messaging.
    • Multicast router (MCR);
    • Code-generator.
    Source code(tar.gz)
    Source code(zip)
  • v0.5.0_alpha(Oct 3, 2021)

Owner
Enabling services on your device
We help to develop autonomous, intelligent and self-aware connected things at the edge of the network, by enabling public services on your devices.
Enabling services on your device
Provide translation, currency conversion, and voting services. First using telnet you create a connection to a TCP socket, then the server connects to 3 UDP sockets hosted on other servers to do tasks.

to run micro servers g++ translator.cpp -o translator ./translator <port 1> g++ voting.cpp -o voting ./voting <port 2> g++ currency_converter.cpp -o c

Jacob Artuso 1 Oct 29, 2021
A modern C++ network library for developing high performance network services in TCP/UDP/HTTP protocols.

evpp Introduction 中文说明 evpp is a modern C++ network library for developing high performance network services using TCP/UDP/HTTP protocols. evpp provid

Qihoo 360 3.1k Nov 29, 2022
Espressif IoT Library. IoT Device Drivers, Documentations And Solutions.

Espressif IoT Library. IoT Device Drivers, Documentations And Solutions.

Espressif Systems 1.3k Nov 23, 2022
LAppS - Lua Application Server for micro-services with default communication over WebSockets. The fastest and most vertically scalable WebSockets server implementation ever. Low latency C++ <-> Lua stack roundtrip.

LAppS - Lua Application Server This is an attempt to provide very easy to use Lua Application Server working over WebSockets protocol (RFC 6455). LApp

null 48 Oct 13, 2022
BingBing 60 Nov 4, 2022
A C++ async HTTP client library to use in asynchronous applications while communicating with REST services.

libashttp An asynchronous HTTP library using Boost.ASIO as the backend. This project is licensed under: Usage Here is a example usage which is taken f

Tolga Hoşgör 52 Jul 3, 2022
This API uses both composition and inheritance to provide a generic way to set up a custom server with a custom communication protocol and custom middlewares

Ziapi Summary Introduction Installation Introduction This API uses both composition and inheritance to provide a generic way to set up a custom server

Aurélien Boch 8 Apr 22, 2022
StateAFL: A Greybox Fuzzer for Stateful Network Servers

StateAFL: A Coverage-Driven (Greybox) Fuzzer for Stateful Network Protocols StateAFL is a fuzzer designed for network servers. It extends the original

null 116 Nov 26, 2022
Encapsulates the two protocols of OpenVpn and Ikev2, you only need to enter the server IP and port number to realize the connection and status display, and the specific situation of the connection can be displayed at the same time。

NewVpnCore 封装了OpenVpn和Ikev2两种协议,只需要输入服务器IP和端口号即可实现连接和状态显示,同时可以显示连接的具体情况。 UniteVpn Core(第一版) 1. 模块说明 unitevpn:封装了vpn的操作和统一不同协议信息的模块 ikev2:IKEV2协议的源码 op

ZFashion 3 Jun 8, 2022
A cross-platform SDK enabling developers to integrate real-time chat technology into their projects

4Players ODIN SDK ODIN is a cross-platform software development kit (SDK) that enables developers to integrate real-time chat technology into multipla

4Players 5 Oct 28, 2022
Wangle is a framework providing a set of common client/server abstractions for building services in a consistent, modular, and composable way.

Wangle C++ networking library Wangle is a library that makes it easy to build protocols, application clients, and application servers. It's like Netty

Facebook 2.9k Nov 23, 2022
Run SSH on iOS 12 device.

Shelly12 Run SSH on iOS 12 device. Only worked on iPad Air 1, iOS 12.4 Working Get root Set tfp0 to hsp4 Escape Sandbox Restore/Remount RootFS Defeat

null 6 May 11, 2021
Pushpin is a reverse proxy server written in C++ that makes it easy to implement WebSocket, HTTP streaming, and HTTP long-polling services.

Pushpin is a reverse proxy server written in C++ that makes it easy to implement WebSocket, HTTP streaming, and HTTP long-polling services. The project is unique among realtime push solutions in that it is designed to address the needs of API creators. Pushpin is transparent to clients and integrates easily into an API stack.

Fanout 3.2k Nov 24, 2022
Hyelicht is an IoT/embedded project for home decoration/automation.

Hyelicht is an IoT/embedded project for home decoration/automation. Its software allows you to do colorful painting and animations on a LED-b

Eike Hein 59 Nov 27, 2022
The program shows how bluetooth devices are connected, without using socket programming

The program shows how bluetooth devices are connected, without using socket programming, it shows how files are shared using principles of OOP

SAKSHI JAIN 2 Oct 5, 2022
Run statically-compiled WebAssembly apps on any embedded platform

embedded-wasm-apps Run native, statically-compiled AssemblyScript, Rust, C/C++, TinyGo, Zig, etc. apps on any platform How it works The approach is si

Volodymyr Shymanskyy 111 Nov 18, 2022
Mongoose Embedded Web Server Library - a multi-protocol embedded networking library with TCP/UDP, HTTP, WebSocket, MQTT built-in protocols, async DNS resolver, and non-blocking API.

Mongoose - Embedded Web Server / Embedded Networking Library Mongoose is a networking library for C/C++. It implements event-driven non-blocking APIs

Cesanta Software 9k Dec 2, 2022
Corvusoft's Restbed framework brings asynchronous RESTful functionality to C++14 applications.

Restbed Restbed is a comprehensive and consistent programming model for building applications that require seamless and secure communication over HTTP

Corvusoft 1.7k Nov 29, 2022
An asynchronous web framework for C++ built on top of Qt

!!! I can no longer maintain this project. If you're interessed, please contact me and I can move the projetct to you !!! Tufão - an asynchronous web

Vinícius dos Santos Oliveira 556 Nov 22, 2022