The gate is a major tool of the Luos ecosystem. It is allowing you to translate any Luos architecture into a more convenient format for standard software ([JSON] most of the time) and to stream and receive this formatted information into any kind of communication way such as serial interface, WiFi, Bluetooth, Lora, ...
The gate is a simple embedded app service, so it can work on any MCU running Luos without any modification.
The gate service must be used with a driver service called pipe that can be hosted into different kinds of nodesHardware element (MCU) hosting and running Luos and hosting one or several services. allowing you to choose the communication way fitting with your project (USB, WiFi, Bluetooth, etc.)
Default Gate Process
The default behavior of the gate is optimized for system that only have drivers and control the entire behavior through a distant machine.
- At power up, the gate makes a network detection to find a pipe service. (Optional)
- The gate waits to receive a detection message from a pipe.
- At detection command, the gate performs a new detection and generates a formatted routing table to send it back to the pipe.
- Then the gate evaluates the time needed to convert the entire network values into the selected format. (Optional)
- the gate sets up all the network services to send back their values at the optimal frequency. (Optional)
- At this optimal frequency, the gate generates formatted data and sends commands coming from a pipe.
The gate service refreshes sensors information as fast as it can, so that can be intensive to Luos bandwidth.
The gate and the pipe are two separate services, they can be put on the same node or on separate nodes.
A Gate and a pipe on the same node
In that configuration, you put two services in the node as shown below:
In that configuration formatted messages don't pass through the Luos network and stay in localhost.
A Gate and a pipe on separate node
When the gate and the pipe are on separate nodes, formatted messages transit into the network and use even more bandwidth on the network and add latency.
The gate configurations
The default process described above can be changed using different configurations that you can use in the file node_config.h.
You could need to change it if you have apps on your Luos embedded system.
|GATE_BUFF_SIZE||1024||Maximum size of 1 formatted Data.|
|GATE_POLLING||NOT DEFINED||No auto-refresh, always ask for data (more intensive to Luos bandwidth).|
|NODETECTION||NOT DEFINED||Gate does not make detection at power up.|
If you have an App service on your device managing detection, you should define NODETECTION avoiding useless detection from the gate at the boot.
If you have an App service on your device using auto-update you should define GATE_POLLING avoiding the gate to take the lead on the services your app is using.