The project is split into two parts. The first is a native service app (written in C) that runs reliable in the background and takes care of the sensor data, analysis thereof and the notifications (in case a seizure is thought to be detected). The other is a web app - the UI - and is responsible for the settings, starting and stopping of the service app. Additionally, you can activate logging of the fft-output. After collecting some logs, they can be compressed and uploaded to a FTP server from the watch (WiFi needs to be truned on).
Below you can find a task-list which indicates the current state of the project and the goals for the near future:
-
Tizen Native Service Application:
- collecting of accelerometer data
- analysis of collected data as described above
- sending of notifactions if alarmstate is increased as a local notification on the watch
- send notification on shutdown (if not triggered by UI) to detect when it crashes
- complete logging of (analyzed) data (in order to later optimize default values); collect data for up to one week (timestamp, minFreq, maxFreq, complete simplified freqs, alarmstate, avg_roi_x|y|z, avg_nroi_x|y|z, avg_roi, multRatio --> 62 data points per second)
- implement data transfer to Raspberry Pi 4 (running home assistant) via FTP (to be triggered via button in UI)
- tar and gzip all log files before upload
- optimize analysis, i.e., remove the (unnecessary) aggregation of the spectra in 0.5Hz bins
- implement basic functionality for ftp upload
- start UI (web app) if alarmstate changes (and app is not running)
- appcontrol to delete all log files
- raise alarm by initializing phone call and/or send SMS (write companion app for Android or stick to LTE version of smart watch/can we use Samsung's very own SOS system?)
- read GPS data every now and then s.t. it can be sent as an attachment of the alarm notification
- automatically start and stop analysis at given times (using Alarm API)
-
Tizen Web Application (javascript):
- UI that allows starting and stopping of seizure detection of native service app
- basic setup of UI (one list, on the top switch to toggle analysis, below settings, last infos on app)
- check on start of UI if service app is running (and initialize button correctly!)
- button for sending collected internal data via FTP to specified IP address
- settings, sent to service app on startup of seizure detection:
- warnTime, mult_thresh, roi_thresh, min|maxFreq (only in 0.5Hz steps)
- settings, sent to service app when compressing logs and uploading to FTP server:
- hostname, port, username, password, path
- UI to change default values of params (see above)
- save settings to local storage and load them from there
- if something goes wrong in the service app, give appropriate popup warnings in UI (compression failed, upload failed, seizure detection failed)
- deactivate settings if sensor listener is running (settings only get applied after restart of listener!)
- improve visuals s.t. it is clear that settings cannot be changed during activated seizure detection
- button to delete all log files (with confirmation popup, then one can easily erase data each day if no seizure happened...)
-
Python Log Analysis:
- download tars from ftp server
- convert json into python-dicts
- (automatic) analysis of 'gaps' between measurements
- verify c-implementation, i.e., comptuation of multRatio, avgROI (etc) from the spectrum, then remove those values from the logs
- using list of timestamps from actual seazures and their corresponding logs, optimize params of analysis s.t. less false alarms are raised but still all seizures detected
-
Known issues:
- automatic seizure detection start/stop does not work reliably
- (local) notifications are not sent properly (i.e. no vibration)
other todos:
- fix default values on SM-R830; I could at least not trigger the alarm on purpose :/
- optimize battery usage (currently 4.2%/h battery on SM-R820 with logging enabled)
- with/without logging (try to minimize the difference, logging is (at least for now) extremely important!)
- decrease sampleRate (beware of aliasing effects!)
- check whether night mode affects actual sampling rate
- make first prototype available to first real test person (not just my shaky hand)
- clarify which LICENSE can be used
- create logo
- create widget that allows starting/stopping of seizure detection, and shows if it is running