class Diagnostics

Easy to use diagnostics checks to validate the operation or presence of system peripherals. The checks automatically create notifications in case of false results. The checks clear or add notifications depending on the test results.

Constructor

class omc048.diagnostics

Create a diagnostics object

Methods

diagnostics.sd() bool

Checks the SD card. ‘false’: no sd card detected. ‘false’: the used SD capacity exceeds 90%. ‘true’ : SD card present and the used capacity below 90%. Notifications are presented to the repl header and the system log in case of warnings (‘false’ as response).

diagnostics.battery() bool

Checks backup battery. ‘false’: Voltage is below 2.5 V (empty battery). ‘false’: Voltage is below 2.85V (low battery). ‘true’: Voltage is above 2.85 (normal battery). Notifications are presented to the repl header and the system log in case of warnings (‘false’ as response).

diagnostics.rtc() bool

Checks if the onboard real time clock is responsive. ‘false’: Real time clock is unresponsive. ‘true’ : Real time clock is responsive. Notifications are presented to the repl header and the system log in case of warnings (‘false’ as response).

diagnostics.temp() bool

Checks the onboard temperature of the device. ‘false’: Temperature is below -30 degrees celcius. ‘false’: Temperature is above 70 degrees celcius. ‘true’: Temperature is between -30 and 70 degrees celcius. Notifications are presented to the repl header and the system log in case of warnings (‘false’ as response).

diagnostics.hum() bool

Checks the onboard humidity of the device. ‘false’: Humidity read is out of bound. ‘true’: Humidity is between 0 - 100 percent. Notifications are presented to the repl header and the system log in case of warnings (‘false’ as response).

diagnostics.hum_exceeded() bool or 6-tuple

Check if the device warranty has been voided due to a high humidity. return: False if not exceeded or a tuple with the date and time of exceeding the limit. The tuple has the following format:

(year, month, day, weekday, hours, minutes, seconds, subseconds)

diagnostics.temp_high_exceeded() bool or 6-tuple

Check if the device warranty has been voided due to a high temperature return: False if not exceeded or a tuple with the date and time of exceeding the limit. The tuple has the following format:

(year, month, day, weekday, hours, minutes, seconds, subseconds)

diagnostics.temp_low_exceeded() bool or 6-tuple

Check if the device warranty has been voided due to a low temperature. return: False if not exceeded or a tuple with the date and time of exceeding the limit. The tuple has the following format:

(year, month, day, weekday, hours, minutes, seconds, subseconds)

Example

The following example runs various diagnostic checks.

import omc048

diag = omc048.diagnostics()

sd = diag.sd()
rtc = diag.rtc()
bat = diag.battery()
temp = diag.temp()
hum = diag.hum()
hum_ex = diag.hum_exceeded()
temp_high = diag.temp_high_exceeded()
temp_low = diag.temp_low_exceeded()

print("SD: {}\r\nRtc: {}\r\nBattery: {}\r\nTemperatur: {}\r\nHumidity: {}\r\nHum_ex: {}\r\nTemp_high: {}\r\nTemp_low: {}".format(sd, rtc, bat, temp, hum, hum_ex, temp_high, temp_low))