Freezing during Download
p.p1 {margin: 0.0px 0.0px 0.0px 0.0px; font: 12.0px 'Helvetica Neue'; color: #454545}
p.p2 {margin: 0.0px 0.0px 0.0px 0.0px; font: 12.0px 'Helvetica Neue'; color: #454545; min-height: 14.0px}
I am using the MetaTrackr device paired with an iPhone 6s. When I start to download logged data, the device freezes and memory usage skyrockets.
Any ideas what might be going on?
This discussion has been closed.
Comments
p.p1 {margin: 0.0px 0.0px 0.0px 0.0px; font: 11.0px Menlo; color: #ffffff}
p.p2 {margin: 0.0px 0.0px 0.0px 0.0px; font: 11.0px Menlo; color: #ffffff; min-height: 13.0px}
p.p3 {margin: 0.0px 0.0px 0.0px 0.0px; font: 11.0px Menlo; color: #93c96a}
p.p4 {margin: 0.0px 0.0px 0.0px 0.0px; font: 11.0px Menlo; color: #4dbf56}
p.p5 {margin: 0.0px 0.0px 0.0px 0.0px; font: 11.0px Menlo; color: #4dbf56; min-height: 13.0px}
span.s1 {font-variant-ligatures: no-common-ligatures; color: #c2349b}
span.s2 {font-variant-ligatures: no-common-ligatures}
span.s3 {font-variant-ligatures: no-common-ligatures; color: #ffffff}
span.s4 {font-variant-ligatures: no-common-ligatures; color: #00afca}
span.s5 {font-variant-ligatures: no-common-ligatures; color: #93c96a}
span.s6 {font-variant-ligatures: no-common-ligatures; color: #8b84cf}
span.s7 {font-variant-ligatures: no-common-ligatures; color: #4dbf56}
span.s8 {font-variant-ligatures: no-common-ligatures; color: #e44347}
@IBAction func startMonitoringPressed(_ sender: Any) {
startMonitoringButton.isEnabled = false
stopMonitoringButton.isEnabled = true
device.led?.flashColorAsync(UIColor.white, withIntensity: 1.0)
updateAccelerometerBMI160Settings()
device.accelerometer!.dataReadyEvent.startLoggingAsync()
}
@IBAction func stopMonitoringPressed(_ sender: Any) {
startMonitoringButton.isEnabled = true
stopMonitoringButton.isEnabled = false
device.led?.setLEDOnAsync(false, withOptions: 1)
let hud = MBProgressHUD.showAdded(to: UIApplication.shared.keyWindow!, animated: true)
hud.mode = .determinateHorizontalBar
hud.label.text = "Downloading..."
device.accelerometer!.dataReadyEvent.downloadLogAndStopLoggingAsync(true) { number in
hud.progress = number
}.success { array in
self.accelerometerBMI160Data = array as! [MBLAccelerometerData]
for obj in self.accelerometerBMI160Data {
self.accelerometerGraphView.addX(obj.x, y: obj.y, z: obj.z)
}
hud.mode = .indeterminate
hud.label.text = "Clearing Log..."
self.logCleanup { error in
hud.hide(animated: true)
if error != nil {
self.connectDevice(false)
}
}
...
...
}.failure { error in
self.connectDevice(false)
hud.hide(animated: true)
}
}
BME280 Humidity + Temperature
LTR329ALS Light