Pebble Version – Accessing and Interpreting Log Files

The OpenSeizureDetector Android App saves alarm events (warnings and full alarms) to the phone’s SD memory card by default.  You can switch this on, or extend the facility by having it write data regularly even if an alarm does not occur.   The information below gives some information on how to access the log files, and how to interpret the data.

Log File Set Up

From the Screenshot_2016-06-12-10-17-04main OpenSeizureDetector screen, use the menu to access the settings page, and select the “General – General Preferences” option.   You should see otpions to “Log Alarm events to SD Card” and “Log Data to SD Card”.

Make sure the “Log Alarm events to SD Card” is selected if you want logs to investigate false alarms.

If you are concerned about failure to detect actual seizures you will need to select “Log Data to SD Card”, and hope that a seizure occurs at one of the times it records the data (it does it every minute so there is a pretty good chance).

Use the back button to get back to the OpenSeizureDetector main screen – the app will re-start if you have changed anything.

Accessing the Log Files

IMG_20160612_100752You need to use a wifi connection between a computer and the phone to access the log files.  On the main screen you see a statement “Access Server at http://xxx.xxx.xxx.xxx:8080 (where xxx are numbers that depend on your home wifi settings).

The photo on the right shows our home set-up for Benjamin where the server address is http://192.168.1.170:8080.

Type this address into the address bar of a web browser:

Screenshot_2016-06-12_10-26-29This should open up a very simple web page.  Scroll down to the bottom of the page and you should see some de-bugging information at the very bottom, and a small ‘Logs’ button at the left hand side of the page:

Screenshot_2016-06-12_10-26-59

Screenshot_2016-06-12_10-30-48
Log file list from web interface. NOTE: RIGHT CLICK AND DO ‘SAVE As’ or OPEN IN NEW TAB/WINDOW ****You get a blank screen if you left click****

Pressing the Logs button shows you a list of all of the log files on the phone (there is one per day)

 

View the log file by RIGHT CLICKING on the file and selecting either ‘Save As’ or ‘Open in New Tab / Window’.

*** It is an unfortunate ‘Feature’ that if you left click on the log file name you get a blank screen until you press the browser’s Refresh button, sorry!!! ****

Interpreting the Log Files

The log files are simple text files, but they are in a machine readable format called JSON, so take a bit of thinking about.There is one line per event (warning or alarm initiation).  It will look something like:

{“alarmFreqMin”:3,”alarmFreqMax”:8,”dataTimeStr”:”20160611T193217″,”alarmRatioThresh”:50,”alarmThresh”:100,”haveSettings”:true,”alarmPhrase”:”WARNING”,”simpleSpec”:[28,23,49,131,249,260,202,126,54,47],”batteryPc”:50,”maxVal”:320,”specPower”:26,”alarmState”:1,”maxFreq”:4,”roiPower”:206,”dataTime”:”11-06-2016 19:32:17″,”pebbleAppRunning”:true,”pebbleConnected”:true}

This looks a bit like gibberish, but if you add new lines after the commas, and do some indenting, it looks easier:

{
“alarmFreqMin”:3,
“alarmFreqMax”:8,
“dataTimeStr”:”20160611T193217″,
“alarmRatioThresh”:50,
“alarmThresh”:100,
“haveSettings”:true,
“alarmPhrase”:”WARNING”,
“simpleSpec”:[28,23,49,131,249,260,202,126,54,47],
“batteryPc”:50,
“maxVal”:320,
“specPower”:26,
“alarmState”:1,
“maxFreq”:4,
“roiPower”:206,
“dataTime”:”11-06-2016-19:32:17″,
“pebbleAppRunning”:true,
“pebbleConnected”:true
}

That is, it s a set of key:value pairs – here AlarmFreqMin is 3 etc.   I have highlighted in bold the parameters that are most interesting from the perspective of looking for false alarms.

AlarmFreqMin and AlarmFreqMax define the frequency range of the Region of Interest (ROI) that we use to detect seizures – the narrower this range the more specific we are being about what frequency of movement we will call a seizure.  You can use the SimpleSpec figures which is the amount of movement in 1Hz steps to see how suited these figures are to the movement being detected.

ROIPower is the level of movement detected within the region of interest frequency range.  SpecPower is the level of movement in the whole spectrum.

Here we had values of 206 and 26, so the ratio is 206/26 = 7.9.   Because we only use integers on the Pebble watch, we mutiply by 10 to give 79 for the ratio.

The AlarmRatioThresh value is 50, so the reason the system is alarmed is that the actual ratio is 79 compared to the threshold of 50.

See the Seizure Detection Algorithm page for a bit more information.