Skip to main content
Version: 2.8.0

Luos engine

The node's embedded code hosts the Luos engine's embedded code and the node's functionalities, stored in services. Luos engine is responsible for creating each node's identity, integrating the node to a network, locating it among the other nodes, communicating with each other, and managing all their services.

Luos engine integration

Luos engine works as a code library running on nodes. It can use several network interfaces.

To match the Luos engine's library with your hardware, it offers an Hardware Abstraction Layer for various devices in the Luos engine's HAL folderHardware Abstraction Layer used to fit Luos with various hardware designs.. There is also specific Hardware Abstraction Layers for each network layer.

  • Luos engine: The main library you will be working with.

To make it work in your environment, you have to:

  • Include the Luos engine's library folders in your project compilation;
  • Include the right HAL for your device family;
  • If necessary, overload HAL default configuration with a node_config.h file describing specificities of your node. Luos engine's HAL provides default configurations for MCU families as examples, they can be modified to fit with your design (e.g. match pins with your design);
  • Include luos_engine.h in your main file.

The Luos engine's loop function needs to run constantly on each node.

The engine is like a task that has to be run regularly. The primary Luos engine's functions that should be called to be integrated into the embedded code of a node are Luos_init() and Luos_loop(). They should be added in the main() of your program.

Basically, your main() function will look like this:

#include "luos_engine.h"

int main(void)
{
Luos_Init();
while(1)
{
Luos_Loop();
}
return 0;
}

Adding this code to a nodeHardware element (MCU) hosting and running Luos and hosting one or several services. makes it able to react to a Luos network. It is now ready to host your services by running packages on your main.

As a developer, you will always develop your functionalities into services and never into the main() program.

note

The only information that should be put on the main() code are MCU's setup parameters and services' run functions.

A complete software node view

At the node level, communication is achieved by receiving and sending messages with the other services of a Luos network. The nodes can communicate with each other thanks to the network layer.

Luos engine will be able to find the physical destination to reach a specific service and define the best way to make it (basically using localhost or using the network layer).

info

If you use Luos engine on only one board, you don't need to take care of the physical network, the engine will only use localhost. You can use it to deal with microservice developpement on IOT, for example.

Robus executes a format control, and stores messages in the msg_buffer of your node. Depending on the specified destination and the type of each message, they are either treated automatically by Robus and Luos engine or sent to one or several services.

luos_imgluos_img

Node Parameters Configuration

Luos engine allows you to configure some parameters to optimize the memory usage and adapt it to fit your needs. To make it, we advise using a configuration file called node_config.h. Put the file at the root folder of your node project and add it in the compiling variables section of your IDE by adding the following line:

#include node_config.h

You can use it to set all your custom configurations:

  • for the services of your node
  • for the Luos engine of your node
  • to modify HAL configurations to fit your design
ParametersDefaults valueDescription
NBR_NAK_RETRY10Number of retries to send after a received NAK.
MAX_SERVICE_NUMBER5Number of services in the node (memory optimization).
MSG_BUFFER_SIZE3*size_msgMessage buffer size. Max size of a message (3 * (7 bytes header + 128 bytes data + 2 bytes CRC)).
MAX_MSG_NB2*MAX_SERVICE_NUMBERMax number of messages that can be referenced by Luos.
NBR_PORT2Number of PTP (port) on the node ( max 8). See electronic design page.

You will find the default configuration for Luos engine in the file config.h.

Check the Luos_hal_config.h and your Network_hal_config.h of your MCU family to see parameters that can be changed to fit your design.

Note: Every example provided by Luos has a node_config.h file that can be used as a base to fit your project's needs.

Luos Statistics

Into Luos embedded code, you are given the opportunity to obtain important information about different factors of the functioning of each node, as you can find stored several statistical values in the specific field of the structure that describes each node, like for example, the MCUs memory utilization, or timing information.

The statistics of a node can be occupied from any other node of the system, giving you the chance to explore the behavior of all your MCUs by having direct access to any of them.

More details of how to access the statistics are given in the Monitoring tools page.