The gate is a major tool of the Luos eco-system. It's allowing you to translate any Luos achitecture into a more convenient format for standard software ([JSON] most of the time) and to stream and receive those formated informations into any kind of communication way such as serial interface, wifi, bluetooth, Lora, ...
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 nodeHardware 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 make a network detection to find a pipe service. (Optional)
- The gate wait to receive a detection message from a pipe.
- At detection command, the gate perform a new detection and generate a formated routing table to send it back to the pipe.
- Then the gate evaluate the time needed to convert the entire network values into the selected format. (Optional)
- the gate setup all the network service to send back their values at the optimal frequency. (Optional)
- At this optimal frequency the gate generate formated data and send commands comming from a pipe.
The gate service refreshes sensors informations 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 node.
A Gate and a pipe on the same node
In that configuration you put 2 services in the node like below.
In that configuration formated 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, formated 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 on your node_config.h.
You could need to change it if you have Apps on you Luos embedded system.
|GATE_BUFF_SIZE||1024||Maximum size of 1 formatted Data.|
|GATE_POLLING||NOT DEFINED||No autorefresh always ask data (more intensive to Luos bandwidth.)|
|NODETECTION||NOT DEFINED||Gate do not make detection a power up|
If you have an App service on your device managing detections you should define NODETECTION avoiding useless detection from the gate at 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.