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.
Methods¶
-
diagnostics.
all
() → bool¶ Run all (below) diagnostic checks, notifications are presented to the repl header and the system log in case of warnings. If any test failed a ‘false’ is returned, if all test passed a ‘true’ is returned.
-
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.
config
() → bool¶ Checks if the config.txt. ‘false’: no sd card detected. ‘false’: no config.txt file detected. ‘true’ : SD card present and config.txt detected. 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()
diag.all()
diag.rtc()
diag.battery()
diag.config()