smartDrive smartCORE Module
Description
The "smartdrive" module provides the interface to the owasys hardware of the smartDrive edge device for smartCORE. It handles
- reading the 4 analog inputs (AIN0 – AIN3)
- monitoring the supply voltage (V_IN) and the internal housing temperature
- driving the 4 status LEDs on the top of the device
- the periodic internet connectivity check (cellular or Ethernet/network) via an HTTP HEAD request
The module only runs on smartDrive devices, since it internally initializes the owasys RTU and IO kernel modules (libRTU / libIOs).
Status LEDs
The module drives all 4 status LEDs of the smartDrive:
| LED | Color | Driven by the module |
|---|---|---|
| RADIO | yellow | lights up as long as the last periodic ping check (see below) was successful, regardless of whether the connection is via the cellular modem or via Ethernet/network |
| PWR | green | switched on permanently at module startup, once the owasys hardware interface could be initialized |
| STATE | red | toggled every second (blinking at 1 Hz) as long as the module is running; if the LED stays dark, the module (and thus the smartCore process) is no longer active |
| GPS | orange | lights up continuously as soon as a valid GNSS fix is present (prerequisite: a GPS module is present in the smartCore configuration, see below) |
Internet connectivity check
Every 60 seconds, an HTTP HEAD request is sent to the configurable pingUrl via libcurl. The result (reachable / unreachable) directly drives the RADIO LED.
GPS status check
At module startup, the module searches all configured smartCORE modules for one with the factory gps. If one is found, its gpsinfo call is queried every 30 seconds. The GPS LED lights up when satcount > 0, posfixmode >= 2, and both latitude and longitude are non-zero. If no GPS module is configured, the GPS LED stays off permanently and no query is performed.
Interfaces & protocols used
- owasys RTU/IO kernel modules (libRTU, libIOs) for analog inputs, V_IN, internal temperature, and LEDs
- HTTP (HEAD request via libcurl) for the connectivity check
- smartCORE call interface of an optionally configured
gpsmodule
JSON configuration
Example configuration (minimal)
{
"module": "SmartDrive",
"factory": "smartdrive",
"config": {}
}
Without specifying ain_channels, all 4 analog inputs remain disabled; pingUrl falls back to the default www.google.com.
Example configuration (maximal)
{
"module": "SmartDrive",
"factory": "smartdrive",
"config": {
"pingUrl": "www.google.de",
"ain_channels": {
"samplingRate": 10,
"ch1": {
"active": true,
"name": "TestChn1",
"unit": "V",
"scale": 1000.0,
"offset": 0.0,
"adcMaxRange": 30,
"absTolerance": 0.0,
"bufferSize": 100
},
"ch2": {
"active": false,
"name": "Channel2",
"unit": "mV",
"scale": 1.0,
"offset": 0.0,
"adcMaxRange": 5,
"absTolerance": 1.0,
"bufferSize": 100
},
"ch3": {
"active": true,
"name": "Channel3",
"unit": "mV",
"scale": 2.0,
"offset": 0.5,
"adcMaxRange": 30,
"absTolerance": 0.5,
"bufferSize": 100
},
"ch4": {
"active": true,
"name": "Channel4",
"unit": "mV",
"scale": 1.0,
"offset": 0.0,
"adcMaxRange": 5,
"absTolerance": 0.1,
"bufferSize": 100
}
}
}
}
Parameter list
| Parameter name | Required | Data type | Reasonable range | Default | Description |
|---|---|---|---|---|---|
| pingUrl | No | STRING | valid URL | "www.google.com" | URL queried every 60s via HTTP HEAD request to check the internet connection (RADIO LED) |
| ain_channels | No | Object | see below | - | Configuration of the 4 analog inputs (AIN0 – AIN3) |
ain_channels configuration
| Parameter name | Required | Data type | Reasonable range | Default | Description |
|---|---|---|---|---|---|
| samplingRate | No | INT | 1, 2, 5, 10 [Hz] | 1 | Sampling rate of all 4 analog inputs |
| ch1 | No | Object | see below | - | Configuration of AIN0 |
| ch2 | No | Object | see below | - | Configuration of AIN1 |
| ch3 | No | Object | see below | - | Configuration of AIN2 |
| ch4 | No | Object | see below | - | Configuration of AIN3 |
Configuration of an analog input channel (ch1 – ch4)
| Parameter name | Required | Data type | Reasonable range | Default | Description |
|---|---|---|---|---|---|
| active | No | BOOL | false, true | true | Enable the channel; only active channels are created as a smartCHANNEL |
| name | No | STRING | "SmartDriveAINChannel" | smartCHANNEL name of the analog input | |
| unit | No | STRING | "" | Physical unit of the produced values | |
| scale | No | NUMBER | 1.0 | Scale factor applied to the measured voltage (value * scale + offset) | |
| offset | No | NUMBER | 0.0 | Offset applied to the measured voltage (value * scale + offset) | |
| adcMaxRange | No | INT | 5, 30 [V] | 30 | Measuring range of the analog input (0–5.12 V or 0–30.72 V) |
| absTolerance | No | NUMBER | 0.01 | Absolute tolerance of the data reduction filter | |
| bufferSize | No | INT | 1 - | 100 | Buffer size of the smartCHANNEL |
Produced signals
| Signal | Data type | Unit | Description |
|---|---|---|---|
| PowerSupply | float | V | Current supply voltage (V_IN) of the smartDrive |
| InternalTemperature | int32 | °C | Internal housing temperature of the smartDrive |
| AIN0 – AIN3 | float | mV (or as configured) | Raw value of the respective analog input, scaled via scale/offset (only if the channel is active) |
Call interface functions
getStatus
Checks whether the owasys hardware interface (RTU/IO kernel modules) was successfully initialized.
| Return value | Type | Description |
|---|---|---|
| value | BOOL | true if the owasys hardware interface is initialized |
getInternalTemperature
Reads the current internal housing temperature.
| Return value | Type | Description |
|---|---|---|
| value | INT | Internal temperature in °C, or -1 if the value could not be read |
getSupplyVoltage
Reads the current supply voltage (V_IN).
| Return value | Type | Description |
|---|---|---|
| value | NUMBER | Supply voltage in V, or 0 if the value could not be read |
Module information
| Information | Value |
|---|---|
| Author | optiMEAS GmbH |
| Module type | Producer |
| Consumes signals | No |
| Produces signals | Yes |
| Dependencies | smartDrive edge device (owasys RTU/IO kernel modules); optional configured gps module for the GPS LED |
| Supported systems | smartDrive |