cbitstech / purple-robot Goto Github PK
View Code? Open in Web Editor NEWSensing and automation platform for Android.
License: Other
Sensing and automation platform for Android.
License: Other
probes.builtin.ContinuousAccelerometerProbe;formattedBundle;ContinuousAccelerometerProbe.java;75 ProbeViewerActivity;onCreate;ProbeViewerActivity.java;37
java.lang.RuntimeException: Unable to start activity ComponentInfo{edu.northwestern.cbits.purple_robot_manager/edu.northwestern.cbits.purple_robot_manager.ProbeViewerActivity}: java.lang.NullPointerException
probes.funf.WifiProbe;bundleForScanResultArray;WifiProbe.java;54 probes.funf.WifiProbe;formattedBundle;WifiProbe.java;72 ProbeViewerActivity;onCreate;ProbeViewerActivity.java;37
java.lang.RuntimeException: Unable to start activity ComponentInfo{edu.northwestern.cbits.purple_robot_manager/edu.northwestern.cbits.purple_robot_manager.ProbeViewerActivity}: java.lang.NullPointerException
Test Setup: Enable all sensors using the preference activity in Purple Robot. Allow the activity to run for some time. Take another look at the preference activity. Some sensors which were enabled prior (particularly Funf based sensors) are no longer enabled.
Expected Results: Chances are Android kills the preference activity after a period of inactivity, to reclaim memory. SharedPreferences should persist between outside of the normal activity lifecycle!
Possibly an issue with the Holo Everwhere framework. Holo Everywhere handles these preferences.
probes.features.JavascriptFeature;processData;JavascriptFeature.java;116 plugins.JavascriptFeaturePlugin;processIntent;JavascriptFeaturePlugin.java;36 plugins.OutputPlugin;process;OutputPlugin.java;154 plugins.OutputPluginManager;onReceive;OutputPluginManager.java;36
org.mozilla.javascript.EvaluatorException: invalid return (#)
Would like to include jQuery & other JS libraries in Purple Robot functions.
Useful for debug purposes, a simple addition to the ListView which would show:
If we got REAL fancy, we might even work out the hourly transfer rate, and issue an alert if it clearly can't keep up!
Could you add a getAltitude() call for the pressure sensor in the funf code? It would be quite nice to compute this on the phone itself and transmit to Postgres as an additional parameter. Should be a one LoC addition.
http://developer.android.com/reference/android/hardware/SensorManager.html#getAltitude(float, float)
ProbeViewerActivity;screenForBundle;ProbeViewerActivity.java;364 ProbeViewerActivity;onCreate;ProbeViewerActivity.java;41
java.lang.RuntimeException: Unable to start activity ComponentInfo{edu.northwestern.cbits.purple_robot_manager/edu.northwestern.cbits.purple_robot_manager.ProbeViewerActivity}: java.lang.NullPointerException
Test Setup: Enable any of the continuous probes. Go to configuration, then go back to the main screen.
Description: Logs show an occassional "Unable to Start Service Intent" error for the continuous pressure/gyro/acceleration/magnetic field and visible satellite probes.
Extracted Logs:
11-19 14:38:00.804: W/ActivityManager(310): Unable to start service Intent { act=edu.mit.media.funf.probe.Probe.REQUEST cmp=edu.northwestern.cbits.purple_robot_manager/.probes.builtin.ContinuousPressureProbe (has extras) }: not found
11-19 14:38:00.827: W/ActivityManager(310): Unable to start service Intent { act=edu.mit.media.funf.probe.Probe.REQUEST cmp=edu.northwestern.cbits.purple_robot_manager/.probes.builtin.ContinuousGyroscopeProbe (has extras) }: not found
11-19 14:38:00.905: W/ActivityManager(310): Unable to start service Intent { act=edu.mit.media.funf.probe.Probe.REQUEST cmp=edu.northwestern.cbits.purple_robot_manager/.probes.builtin.ContinuousAccelerometerProbe (has extras) }: not found
11-19 14:38:00.976: W/ActivityManager(310): Unable to start service Intent { act=edu.mit.media.funf.probe.Probe.REQUEST cmp=edu.northwestern.cbits.purple_robot_manager/.probes.builtin.VisibleSatelliteProbe (has extras) }: not found
11-19 14:38:00.983: W/ActivityManager(310): Unable to start service Intent { act=edu.mit.media.funf.probe.Probe.REQUEST cmp=edu.northwestern.cbits.purple_robot_manager/.probes.builtin.ContinuousMagneticFieldProbe (has extras) }: not found
Expected Results:
This should never happen! A service should always be found in AndroidManifest.xml!
Test Setup: Ensure a number of probes are initially enabled. Currently, on this device these are: Gyro (30Hz), Magnetic Field (1Hz), Visible Satellites (Every 1 minute), Accelerometer (200Hz), and Pressure (5Hz). Uncheck all but 1 of the sensor(s) and return to the main activity. All sensors originally enabled remain enabled, with new data values being displayed in real time.
Expected Results: All but one of the probes should be disabled. They should not appear in ListView, and more importantly should have been unregistered with the Android OS!! The service listening to the sensor events should arguably have been torn down, but clearly this hasn't happened!
Proposed Workaround: Understandably, exiting and relaunching the activity has no effect. Disabled sensors will remain in the ListView and continue to update. Forcing the entire application to close (via Settings => Apps => Running) and relaunching is the only known workaround!
probes.builtin.ContinuousMagneticFieldProbe;formattedBundle;ContinuousMagneticFieldProbe.java;207 ProbeViewerActivity;onCreate;ProbeViewerActivity.java;37
java.lang.RuntimeException: Unable to start activity ComponentInfo{edu.northwestern.cbits.purple_robot_manager/edu.northwestern.cbits.purple_robot_manager.ProbeViewerActivity}: java.lang.NullPointerException
Do we need to build a built-in version of this now that the FUNF version has been retired?
probes.builtin.BluetoothDevicesProbe;bundleForDevicesArray;BluetoothDevicesProbe.java;385 probes.builtin.BluetoothDevicesProbe;formattedBundle;BluetoothDevicesProbe.java;402 ProbeViewerActivity;onCreate;ProbeViewerActivity.java;37
java.lang.RuntimeException: Unable to start activity ComponentInfo{edu.northwestern.cbits.purple_robot_manager/edu.northwestern.cbits.purple_robot_manager.ProbeViewerActivity}: java.util.MissingFormatArgumentException: Format specifier: s
StartActivity$1$1;run;StartActivity.java;117 StartActivity$1;onReceive;StartActivity.java;107
java.lang.NullPointerException
probes.builtin.WifiAccessPointsProbe$1;onReceive;WifiAccessPointsProbe.java;84
java.lang.RuntimeException: Error receiving broadcast Intent { act=android.net.wifi.SCAN_RESULTS } in edu.northwestern.cbits.purple_robot_manager.probes.builtin.WifiAccessPointsProbe$
android.database.CursorWindowAllocationException: Cursor window could not be created from binder.
JSONConfigFile;update;JSONConfigFile.java;305 JSONConfigFile;getSharedFile;JSONConfigFile.java;142 ManagerService;onHandleIntent;ManagerService.java;226
java.lang.OutOfMemoryError: thread creation failed
Data still appears to be sent as normal => Only an aesthetic issue ...
Purple Robot seems to be saving data to phone storage & uploading every 30s & 5 mins respectively. Consequently, typical file size can be anything from 1kB - 500kB. Would it be better if PR instead done this when a predefined amount of data has been collected? It would make it easier to test!
Test Setup: Ensure the Bluetooth Probe is enabled in Probe Configuration. Disable Bluetooth from the Android Settings Activity. Relaunch Purple Robot (see "Disable Probes not working" issue) Bluetooth magically turns on without user's consent.
Expected Results: Bluetooth should not have automatically enabled without users consent. This should be quite straightforward to do (I've code somewhere, if you'd like)
probes.builtin.RobotHealthProbe$1;run;RobotHealthProbe.java;93
java.lang.NullPointerException
probes.builtin.RobotHealthProbe$1;run;RobotHealthProbe.java;119
java.lang.NullPointerException
StartActivity$1$1;run;StartActivity.java;115 StartActivity$1;onReceive;StartActivity.java;107
java.lang.NullPointerException
probes.builtin.ContinuousMagneticFieldProbe;formattedBundle;ContinuousMagneticFieldProbe.java;201 ProbeViewerActivity;onCreate;ProbeViewerActivity.java;37
java.lang.RuntimeException: Unable to start activity ComponentInfo{edu.northwestern.cbits.purple_robot_manager/edu.northwestern.cbits.purple_robot_manager.ProbeViewerActivity}: java.lang.NullPointerException
probes.builtin.HardwareInformationProbe;isEnabled;HardwareInformationProbe.java;89 probes.Probe;nudge;Probe.java;36 probes.ProbeManager;nudgeProbes;ProbeManager.java;75 SettingsActivity;onPreferenceClick;SettingsActivity.java;97
java.lang.NoSuchFieldError: android.os.Build.SERIAL
probes.builtin.ContinuousMagneticFieldProbe;formattedBundle;ContinuousMagneticFieldProbe.java;227 ProbeViewerActivity;onCreate;ProbeViewerActivity.java;37
java.lang.RuntimeException: Unable to start activity ComponentInfo{edu.northwestern.cbits.purple_robot_manager/edu.northwestern.cbits.purple_robot_manager.ProbeViewerActivity}: java.lang.NullPointerException
Test Setup: Uncheck "Enable Probes" checkbox in Probe Configuration, press back button twice to return to main activity. The activity still displays all probes, and seems to continue updating.
Expected Result: The probes should be stopped. An Image should be displayed on the Activity.
Further info: No exception thrown via Logcat. The message 11-19 12:09:06.931: D/HockeyApp(12159): Current handler class = net.hockeyapp.android.internal.ExceptionHandler appears in the logs. Try looking at Hockey App logs!
probes.builtin.SoftwareInformationProbe;isEnabled;SoftwareInformationProbe.java;111 probes.ProbeManager;getDataRequests;ProbeManager.java;87 FunfService;sendProbeRequests;FunfService.java;125 FunfService;ensureServicesAreRunning;FunfService.java;115 FunfService;onCreate;FunfService.java;50
java.lang.RuntimeException: Unable to create service edu.northwestern.cbits.purple_robot_manager.FunfService: java.lang.NullPointerException
probes.builtin.ContinuousAccelerometerProbe;formattedBundle;ContinuousAccelerometerProbe.java;54 ProbeViewerActivity;onCreate;ProbeViewerActivity.java;37
java.lang.RuntimeException: Unable to start activity ComponentInfo{edu.northwestern.cbits.purple_robot_manager/edu.northwestern.cbits.purple_robot_manager.ProbeViewerActivity}: java.lang.NullPointerException
probes.funf.LightProbe;formattedBundle;LightProbe.java;54 ProbeViewerActivity;onCreate;ProbeViewerActivity.java;37
java.lang.RuntimeException: Unable to start activity ComponentInfo{edu.northwestern.cbits.purple_robot_manager/edu.northwestern.cbits.purple_robot_manager.ProbeViewerActivity}: java.lang.NullPointerException
Test Setup: Enable all probes in the configuration activity. Force a stop on the Activity (As a precaution for issue #13 -- Disable Probes not working). Relaunch Purple Robot. Only the custom Purple Robot probes launch (there's 5 total). Many of the services do not appear in the Apps => Running activity, with the exception of (FunfService, BatteryProbe, AudioFilesProbe, AndroidInfoProbe). On at least one occasion PR was allowed to run for >12 hours, but did not display any of the other probes in this time. Could be related to issue #16 (Unable to start Service Intent)
Expected Results: The probes should launch automatically, assuming they've been enabled in the config!
When the phone is offline, thousands of files can build up. The existing Windows Explorer interface to the device often fails to display the full extent of this problem.
Existing workaround: Using the adb shell, we can login to the Linux filesystem and clear out or move log files in the directory.
Proposed Workaround: Adding a custom probe to Purple Robot, which displays disk usage in the pre-defined PR directory will help testers monitor the folder. When the PR directory folder exceeds a predefined size threshold, old log files could be placed in a separate, permanent directory, or just removed entirely.
Out of Memory Exceptions frequently occur caused by the upload class preparing the JSON data, attempting to upload this, and log results. To date, some code modifications have been undertaken to optimize existing code, reduce the memory burden of logging etc.
The heap threshold is about 40MB on Nexus devices. While not preparing or uploading data, PR typically has a baseline 12-13MB heap size.
Proposed Workarounds include:
What we want: We would like to occasionally monitor the number of visible GPS satellites, SNR for these satellites and a timestamp.
What we get: Three separate tables have been setup in Postgres -- VisibleSatelliteProbe, VisibleSatelliteProbe.ArrayValues, VisibleSatelliteProbe.SATELLITES.
Problems:
probes.builtin.WifiAccessPointsProbe;isEnabled;WifiAccessPointsProbe.java;155 probes.Probe;nudge;Probe.java;36 probes.ProbeManager;nudgeProbes;ProbeManager.java;73 ManagerService;onHandleIntent;ManagerService.java;221
java.lang.IllegalArgumentException: Receiver not registered: edu.northwestern.cbits.purple_robot_manager.probes.builtin.WifiAccessPointsProbe$
At the moment, we monitor screen (in)active events. It would also be good to add call in progress events, to provide a more accurate account of when the phone is in use. A use case would be when labeling data, we may want to disqualify data collected while the phone is in use (or vice versa, as the case may be)
probes.builtin.WifiAccessPointsProbe;isEnabled;WifiAccessPointsProbe.java;152 probes.Probe;nudge;Probe.java;36 probes.ProbeManager;nudgeProbes;ProbeManager.java;73 SettingsActivity;onPreferenceClick;SettingsActivity.java;97
java.lang.IllegalArgumentException: Receiver not registered: edu.northwestern.cbits.purple_robot_manager.probes.builtin.WifiAccessPointsProbe$
probes.builtin.BluetoothDevicesProbe$1;onReceive;BluetoothDevicesProbe.java;295
java.lang.RuntimeException: Error receiving broadcast Intent { act=android.bluetooth.adapter.action.DISCOVERY_FINISHED } in edu.northwestern.cbits.purple_robot_manager.probes.builtin.BluetoothDevicesProbe$
plugins.HttpUploadPlugin$3;run;HttpUploadPlugin.java;620
java.lang.OutOfMemoryError
Chris says it was enabled on phone app. No sign of it on Postgres. Expected LinearAcceleration and LinearAcceleration.ArrayValues tables.
The following tables are blank after ~11 days of logging, so I'm have to ask if they should legitimately exist! Note: this is likely related to issue # 24 (Visible Satellites JSON Object not parsed correctly in FunfImporter)
.ArrayValues
AudioFilesProbe.ArrayValues
BluetoothProbe.ArrayValues
BrowserBookmarksProbe.ArrayValues
BrowserSearchesProbe.ArrayValues
CallLogProbe.ArrayValues
ContactProbe.ArrayValues
HardwareInfoProbe
ImagesProbe.ArrayValues
SMSProbe.ArrayValues
VideosProbe.ArrayValues
VisibleSatelliteProbe.ArrayValues
WifiProbe.ArrayValues
Is there a better way to reset Purple Robot to an initial test state, whereby the directory is empty of all log files etc? At the moment, if I want to delete a log file, I have to use DDMS, and delete each one individually, which takes about 2-3s per file, using that protocol. Given that it creates a log file every 30s, it might be a feature worth adding.
Hitting the 'Clear Data' button in Settings-Apps also deletes the config files.
J
JavaScriptEngine;runScript;JavaScriptEngine.java;81 JavaScriptEngine;runScript;JavaScriptEngine.java;56 triggers.Trigger;execute;Trigger.java;54 triggers.DateTrigger;execute;DateTrigger.java;197 ManagerService;onHandleIntent;ManagerService.java;242
org.mozilla.javascript.EcmaError: TypeError: Cannot find function loadLibrary in object edu.northwestern.cbits.purple_robot_manager.JavaScriptEngine. (#)
Test Setup: Use Purple Robot to log some sensor data, preferably in airplane mode. Encrypted data will be stored on the phone, awaiting upload to the server. Disable data encryption, enable wireless. Causes the following exception:
11-19 13:25:26.843: W/System.err(3450): org.json.JSONException: Value ?D?n%??i?*��?Nr of type java.lang.String cannot be converted to JSONArray
11-19 13:25:26.843: W/System.err(3450): at org.json.JSON.typeMismatch(JSON.java:111)
11-19 13:25:26.843: W/System.err(3450): at org.json.JSONArray.(JSONArray.java:91)
11-19 13:25:26.843: W/System.err(3450): at org.json.JSONArray.(JSONArray.java:103)
11-19 13:25:26.843: W/System.err(3450): at edu.northwestern.cbits.purple_robot_manager.plugins.HttpUploadPlugin$3.run(HttpUploadPlugin.java:467)
11-19 13:25:26.843: W/System.err(3450): at java.lang.Thread.run(Thread.java:856)
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.