The main system communicate using
MQTT between device to device and between devices to central server
HTML between device to client (not recommended) and between central to client
Each device should be able to perform its own job and to communicate to other devices and also to the central system. The device has a mini file system which can hold different files. Some files are otional, some are mandatory
Each device must have:
a config.ini file which configure the device (name, device type, server reference,...)
a main.xml file which specify what to do on each evenment
On startup the device will try to connect to the network via wifi. If it cannot access (if WIFI is not strong enough, or at first boot, when the device is not configured), then the ap.xml file is started instead of the main.xml.
Devices may also hold html files, images files.... to be able to serve a web client.
The config.ini file has this form :
[Section1]
VariableA=valueA
VariableB=valueB
...
example :
[General]
Device=test_WT32
Wifi_ssid=MyWiFi.
Wifi_password=password
The main.xml file has this form :
<Source>
<Event>
Action
</Event>
</Source>
...
...
example :
<Sys>
<Start>
Display(Hello world);
</Start>
</Sys>
<T>
<L1200>
Display(It is miday);
</L1200>
<L0000>
Display(It is midnight);
</L0000>
</T>
More information can be found in the documentation.
Central server hosts :
MQTT broker (may be hoted on another server)
MirTOS demon (in charge of handling messages, and feeding the database)
MirTOS faces (in charge to serve HTTP client with web pages)
MirTOS deamon (MirTOSd) is running in background.
It is connected to the MQTT broker, reads the messages and handles them according different rules.
As a device, the daemon needs two files :
a config.ini file which contains the configuration
a xml file which contains the rules
MirTOSfaces is called on web access request.
It gets from the local DB the devices information, build an xml with this, and apply an xsl before sending to the client.
The MirTOSfaces needs files :
a config.ini file which contains the configuration
a set of xsl files which contain the 'specific presentation' of the page to be served