meta data for this page
Differences
This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
documentation:recsdaemon [2016/09/28 10:07] – [Communication] kru | documentation:recsdaemon [2021/06/08 14:12] (current) – Adding SensorProviderJetson info vor | ||
---|---|---|---|
Line 3: | Line 3: | ||
===== Introduction ===== | ===== Introduction ===== | ||
- | The RECSDaemon is a small program that can be installed on compute modules in a RECS|Box system to be able to forward OS-level | + | The RECSDaemon is a small program that can be installed on compute modules in a RECS< |
To be able to adapt to different platforms, the RECSDaemon uses plugins for different purposes. To configure these plugins and other settings an .ini file is used. | To be able to adapt to different platforms, the RECSDaemon uses plugins for different purposes. To configure these plugins and other settings an .ini file is used. | ||
The RECSDaemon is also able to execute commands sent by the management system to the node (e.g. for shutting down the OS gracefully). | The RECSDaemon is also able to execute commands sent by the management system to the node (e.g. for shutting down the OS gracefully). | ||
Line 9: | Line 9: | ||
===== Installation ===== | ===== Installation ===== | ||
- | The RECSDaemon is currently | + | The RECSDaemon is open source and available as [[https:// |
- | After downloading | + | The installation script will try to auto-detect some of the configuration parameters, but as platforms supported by the daemon are very diverse, manual configuration of remaining parameters most probably will be necessary. |
- | dpkg --install RECSDaemon_3.5.0.deb | + | RECSDaemon comes with both systemd and classical init scripts to allow automatically starting the daemon during system boot. Depending on your distribution, |
- | The installation script will try to auto-detect some of the configuration parameters, but as platforms supported by the daemon are very diverse, manual configuration of remaining parameters most probably will be necessary. | + | <code bash> |
+ | systemctl enable RECSDaemon | ||
+ | </ | ||
+ | |||
+ | or | ||
+ | |||
+ | <code bash> | ||
+ | update-rc.d RECSDaemon defaults | ||
+ | </ | ||
===== Configuration ===== | ===== Configuration ===== | ||
Line 24: | Line 32: | ||
/ | / | ||
- | As this is a standard INI file, it is devided | + | As this is a standard INI file, it is divided |
The different aspects that need to be configured will be described in the following chapters. | The different aspects that need to be configured will be described in the following chapters. | ||
==== Communication ==== | ==== Communication ==== | ||
+ | |||
To be able to send sensor values and to receive commands, the RECSDaemon has to communicate with the management system of the RECS< | To be able to send sensor values and to receive commands, the RECSDaemon has to communicate with the management system of the RECS< | ||
This can happen via one of two different communication channels: On the one hand it is possible to use the internal management bus (I2C) of the RECS< | This can happen via one of two different communication channels: On the one hand it is possible to use the internal management bus (I2C) of the RECS< | ||
Line 44: | Line 53: | ||
=== LinuxCommunicatorDev === | === LinuxCommunicatorDev === | ||
- | If neccessary, the I2C bus to be used can be changed. This is done by setting the '' | + | |
+ | If necessary, the I2C bus to be used can be changed. This is done by setting the '' | ||
Example configuration: | Example configuration: | ||
- | < | + | |
+ | < | ||
+ | [Comm] | ||
PluginName=LinuxCommunicatorDev | PluginName=LinuxCommunicatorDev | ||
- | i2cBus=0</ | + | i2cBus=0 |
+ | </ | ||
=== CommunicatorTCP configuration === | === CommunicatorTCP configuration === | ||
- | When utilizing I2C as the communication channel, the RECSDaemon automatically can determine on which baseboard in the RECS< | + | When utilizing I2C as the communication channel, the RECSDaemon automatically can determine on which baseboard in the RECS< |
- | Also neccessary | + | Also necessary |
Example configuration: | Example configuration: | ||
- | < | + | |
+ | < | ||
+ | [Comm] | ||
PluginName=CommunicatorTCP | PluginName=CommunicatorTCP | ||
baseboard=2 | baseboard=2 | ||
- | controller=192.168.13.56</ | + | controller=192.168.13.56 |
+ | </ | ||
==== Slot detection ==== | ==== Slot detection ==== | ||
+ | |||
+ | Because some of the RECS< | ||
+ | |||
+ | ^ Plugin ^ Detection method ^ | ||
+ | |LinuxSlotDetectorGPIO | Accesses GPIOs via the Linux GPIO Sysfs interface| | ||
+ | |||
+ | If no SlotDetector can or should be used, the slot can be manually changed by setting the '' | ||
+ | |||
+ | === LinuxSlotDetectorGPIO configuration === | ||
+ | |||
+ | This plugin needs the numbers of the GPIO pins used to sense the slot position as used by the running kernel. These are set with the '' | ||
+ | |||
+ | Example configuration: | ||
+ | <code ini> | ||
+ | [Slot] | ||
+ | slotPluginName=LinuxSlotDetectorGPIO | ||
+ | Bit0GPIO=133 | ||
+ | Bit1GPIO=134 | ||
+ | </ | ||
==== Sensor providers ==== | ==== Sensor providers ==== | ||
+ | |||
+ | Sensor providers, as the name implies, add one or more sensors to the RECSDaemon' | ||
+ | |||
+ | Currently the following sensor provider plugins are available: | ||
+ | |||
+ | ^ Plugin ^ Type ^ Sensors provided ^ | ||
+ | |LinuxSensorProviderEth | Direct | Ethernet link status/ | ||
+ | |SensorProviderSystem | Direct | CPU utilization, | ||
+ | |SensorProviderZynq | Direct | Serial transceiver link, utilization, | ||
+ | |SensorProviderZynqModule | JSON | Sensors provided by the module’s microcontroller: | ||
+ | |SensorProviderJetson | Direct | Nvidia Jetson Xavier AGX SoC temperature and various power measurements | | ||
+ | |||
+ | Example configuration: | ||
+ | < | ||
+ | SensorProviders=SensorProviderZynq, | ||
+ | JSONSensorProviders=SensorProviderZynqModule</ | ||
+ | |||
+ | The plugins with " | ||
+ | |||
+ | Some of the plugin need further configuration. Please see the following chapters for details. | ||
+ | |||
+ | === SensorProviderZynq === | ||
+ | |||
+ | This plugin needs the base address of the monitoring peripheral it should read in the Zynq's memory space. Configure it with the '' | ||
+ | |||
+ | === SensorProviderZynqModule === | ||
+ | |||
+ | This plugin needs the name of the serial port of the management microcontroller on the Zynq module. Configure it with the '' | ||
==== Sensors ==== | ==== Sensors ==== | ||
+ | |||
+ | Besides SensorProviders that automatically add a set of sensors when enabled, the RECSDaemon also allows manual configuration of additional sensors. | ||
+ | |||
+ | Currently, the following plugins can be used to instantiate sensors manually: | ||
+ | |||
+ | ^ Plugin ^ Use for ^ | ||
+ | |SensorFileReader | Value read from arbitrary file| | ||
+ | |||
+ | Sensors are instantiated in the '' | ||
+ | |||
+ | '' | ||
+ | |||
+ | An example configuration for one manual sensor could be: | ||
+ | <code ini> | ||
+ | [Sensors] | ||
+ | count=1 | ||
+ | |||
+ | pluginName1=SensorFileReader | ||
+ | sensorName1=Test | ||
+ | options1=path=test.txt type=U8 | ||
+ | </ | ||
+ | |||
+ | === SensorFileReader configuration === | ||
+ | |||
+ | This plugin reads and parses the first line of a given file each time it is requested to update the sensor value. It recognizes the following options: | ||
+ | |||
+ | ^ Option ^ Possible values ^ Required ^ Description ^ | ||
+ | |path | String | Yes | Path of the file to be read | | ||
+ | |type | U8, U16, double | Yes | Data type of the sensor. U8 and U16 mean unsigned integers of the given width. | | ||
+ | |multiplier| Double | No | When type is " | ||
+ | |unit | °C | No | Unit of the sensor value | | ||
+ | |lowerCriticalThreshold | Double | No | Lower critical threshold as double | | ||
+ | |lowerWarningThreshold | Double | No | Lower warning threshold as double | | ||
+ | |upperWarningThreshold | Double | No | Upper warning threshold as double | | ||
+ | |upperCriticalThreshold | Double | No | Upper critical threshold as double | | ||
==== Other settings ==== | ==== Other settings ==== | ||
+ | |||
+ | In the '' | ||
+ | |||
+ | ===== TCP/IP server ===== | ||
+ | |||
+ | The RECSDaemon provides a simple TCP/IP server (by default on port 2023) that can be used by external programs to gain information or provide additional sensors. | ||
+ | |||
+ | The following commands are currently supported: | ||
+ | |||
+ | ^ Command ^ Action ^ | ||
+ | |getnodeid | Returns ID of this node as shown in the WebGUI | | ||
+ | |monitor | Returns sensor data (current, voltage, temperatures) from the baseboard as a JSON string | | ||
+ | |addsensors | Used to add sensors by giving a JSON description | | ||
+ | |updatesensors | Updates sensors added previously | | ||
+ | |exit | Terminates connection | | ||
+ | |||
+ | ==== Getting monitoring data ==== | ||
+ | |||
+ | Using the '' | ||
+ | |||
+ | The returned JSON string has the following format: | ||
+ | |||
+ | <code javascript> | ||
+ | [ | ||
+ | {" | ||
+ | {" | ||
+ | {" | ||
+ | {" | ||
+ | ] | ||
+ | </ | ||
+ | |||
+ | The '' | ||
+ | |||
+ | ==== Adding and updating sensors ==== | ||
+ | |||
+ | Sensors added via the TCP/IP server are managed in groups that are identified by arbitrary strings. When adding sensors the group is defined via the '' | ||
+ | |||
+ | See chapter "JSON sensor description" | ||
+ | < | ||
+ | |||
+ | To update a sensor group, send a '' | ||
+ | < | ||
+ | |||
+ | ===== JSON sensor description ===== | ||
+ | |||
+ | A JSON sensor description contains one or more sensors, thus the outer element is an Array ([]). Inside that, the sensors are defined as objects ({}) that support the following properties: | ||
+ | |||
+ | ^ Property ^ Possible values ^ Required ^ Description ^ | ||
+ | |name | String, max. 29 characters | Yes | Name of the sensor | | ||
+ | |dataType | U8, U16, U32, U64, double, string | Yes | Data type of the sensor. U8 to U64 mean unsigned integers of the given width. | | ||
+ | |maxDataSize | 1 - 255 | Only for dataType " | ||
+ | |unit | W, A, V, °C, RPM | No | Unit of the sensor value | | ||
+ | |lowerThresholds | JSON array with two doubles | No | Lower critical and warning threshold as doubles | | ||
+ | |upperThresholds | JSON array with two doubles | No | Upper warning and critical threshold as doubles | | ||
+ | |||
+ | Example: | ||
+ | <code javascript> | ||
+ | [ | ||
+ | { | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | }, | ||
+ | { | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | } | ||
+ | ] | ||
+ | </ |