ensureMonoBN: Ensure we have monotonic boot numbers for a receiver...

View source: R/ensureMonoBN.R

ensureMonoBNR Documentation

Ensure we have monotonic boot numbers for a receiver database.

Description

Sensorgnomes are supposed to know how many times they've been booted, and record this bootnum in the name of each file they write. One use of this information is to position batches of files in real time if they were recorded during a boot session when the SG failed to set its clock to GPS time. These files will then appear to have been written in the year 2000. If the boot session before or after the problematic one is correctly dated, that lets us bracket the time interval in which the undated boot session must belong.

Usage

ensureMonoBN(src, testOnly = FALSE)

Arguments

src

dplyr:src_sqlite open to an existing receiver database

testOnly

logical scalar; default FALSE.

Details

Unfortunately, this scheme has failed in a few situations:

  • on beaglebone whites (BBW) where the SD card is changed between boot sessions. The boot count is stored on the SD card (there is no internal storage on the BBW), and there's no mechanism in place to set the boot count correctly when a new card is used.

  • on beaglebone blacks using a software image from some time in 2014(?) when the boot count was not updated correctly if it was at 2; in that case it is stuck at 2.

  • on beaglebone blacks re-imaged using a software image that did not preserve the boot count on the target BBBK. (I don't remember exactly which version(s) were affected).

  • more generally, see https://github.com/jbrzusto/sensorgnome/issues/53

This function can test for and correct non-monotonic boot counts.

Value

if testOnly==TRUE:

  • return TRUE if a non-monotonicity in bootnum is detected; ie. if there exist two files F1 and F2 such that F1$ts > MOTUS_SG_EPOCH && F2$ts > MOTUS_SG_EPOCH && F1$ts > F2$ts && F1$bootnum < F2$bootnum

  • return FALSE otherwise

if testOnly==FALSE: return TRUE iff monoBN values were changed for any file.

Note

If testOnly==FALSE, then change might be made to the monoBN field in file records. Any such changes are recorded in the bootnumChanges table.

Author(s)

John Brzustowski jbrzusto@REMOVE_THIS_PART_fastmail.fm


MotusWTS/motusServer documentation built on Dec. 3, 2024, 10:47 a.m.