set Configuration

Hi, I need to record sensor data on a MetaTracker device. For setup settings use setConfigurationAsync on your phone, to download data use another mobile phone, but the configuration set I can not retrieve it. how can I exchange sensor data between two different phones?

Comments

  • How can I get data from MBLAnonymousEvent?

  • I try to recover data with createAnonymousEventsAsync:

    [[self.device createAnonymousEventsAsync] success:^(NSArray * _Nonnull result) {
    NSLog(@obj %@", result);
    for (id event in result) {

            NSLog(@"identifier %@", [event identifier]);
            [[event downloadLogAndStopLoggingAsync:YES] success:^(id  _Nonnull result) {                
                NSLog(@"Result %@", [result class]);
    
            }];
    
        }
    
    }];
    

    this is the result :

    2018-02-28 19:18:19.969688+0100 FlayWatch[1733:460968] obj (
    "",
    "",
    "",
    ""
    )
    2018-02-28 19:18:19.969914+0100 identifier (null)
    2018-02-28 19:18:19.970156+0100 identifier (null)
    2018-02-28 19:18:19.970320+0100 identifier (null)
    2018-02-28 19:18:19.970470+0100 identifier (null)
    2018-02-28 19:18:20.187463+0100 *** Terminating app due to uncaught exception 'NSRangeException', reason: '*** -[__NSCFData subdataWithRange:]: range {0, 18} exceeds data length 4'
    *** First throw call stack:
    (0x182856fe0 0x1812b8538 0x182856f28 0x1832af4a8 0x1000dbc34 0x1000e1ac4 0x184bd4214 0x1012f1a10 0x1012ff2e8 0x1012f5634 0x1012ff810 0x101301630 0x10130139c 0x181917100 0x181916cac)
    libc++abi.dylib: terminating with uncaught exception of type NSException

  • What code are you running to setup the sensor logging? Anonymous events are still an experimental feature with the Objective-C SDK so it could be that you are using it in an unsupported manner.

  • @lukahowlettapp said:

    I try to recover data with createAnonymousEventsAsync:

    [[self.device createAnonymousEventsAsync] success:^(NSArray * _Nonnull result) {
    NSLog(@obj %@", result);
    for (id event in result) {

    NSLog(@identifier %@", [event identifier]);
    [[event downloadLogAndStopLoggingAsync:YES] success:^(id _Nonnull result) {
    NSLog(@Result %@", [result class]);

    }];
    }
    }];

    this is the result :

    2018-02-28 19:18:19.969688+0100 FlayWatch[1733:460968] obj (
    "",
    "",
    "",
    ""
    )
    2018-02-28 19:18:19.969914+0100 identifier (null)
    2018-02-28 19:18:19.970156+0100 identifier (null)
    2018-02-28 19:18:19.970320+0100 identifier (null)
    2018-02-28 19:18:19.970470+0100 identifier (null)
    2018-02-28 19:18:20.187463+0100 *** Terminating app due to uncaught exception 'NSRangeException', reason: '*** -[__NSCFData subdataWithRange:]: range {0, 18} exceeds data length 4'
    *** First throw call stack:
    (0x182856fe0 0x1812b8538 0x182856f28 0x1832af4a8 0x1000dbc34 0x1000e1ac4 0x184bd4214 0x1012f1a10 0x1012ff2e8 0x1012f5634 0x1012ff810 0x101301630 0x10130139c 0x181917100 0x181916cac)
    libc++abi.dylib: terminating with uncaught exception of type NSException

  • I asked for the code that sets up sensor logging, not creating anonymous events.

  • this my code for configuration

    @interface DeviceConfiguration()

    @end

    @implementation DeviceConfiguration

    • (void)runOnDeviceBoot:(nonnull MBLMetaWear *)device {

      MBLHygrometerBME280 *hydro = (MBLHygrometerBME280 *)device.hygrometer;
      self.umiditaFilter = [[hydro periodicHumidity] periodicSampleOfEvent:CAMPIONAMENTO];
      [self.umiditaFilter startLoggingAsync];

      self.temperatureFilter = [[[device.temperature onDieThermistor] periodicReadWithPeriod:CAMPIONAMENTO] changeOfEventByDelta:0 output:0] ;
      [self.temperatureFilter startLoggingAsync];

      MBLAccelerometerBMI160 *accelerometor = (MBLAccelerometerBMI160 *)device.accelerometer;
      accelerometor.lowOrHighGEvent.lowGEnabled = false;
      accelerometor.lowOrHighGEvent.highGThreshold = 0.1;
      accelerometor.lowOrHighGEvent.highGEnabledAxis = MBLAccelerometerAxisX;

    // self.accellerometroFilter = [[acellerometor dataReadyEvent] changeOfEventAcrossThreshold:0.25 hysteresis:0.1 output:0] ;
    self.accellerometroFilter = [[accelerometor dataReadyEvent] changeOfEventAcrossThreshold:0.1 hysteresis:5 output:0] ;
    [self.accellerometroFilter startLoggingAsync];

    MBLAmbientLightLTR329 *luce = (MBLAmbientLightLTR329 *)device.ambientLight;
    luce.gain = MBLAmbientLightLTR329Gain8X;
    luce.integrationTime = MBLAmbientLightLTR329Integration400ms;
    luce.measurementRate = MBLAmbientLightLTR329Rate1000ms;
    self.luceFilter = [[luce periodicIlluminance] changeOfEventAcrossThreshold:10 hysteresis:0 output:0 ] ;
    [self.luceFilter startLoggingAsync];
    

    }

    then

    DeviceConfiguration *dev = [[DeviceConfiguration alloc] init];

        [[self.device setConfigurationAsync:dev] success:^(MBLMetaWear * _Nonnull result)..... 
    
  • edited March 2018

    Right, so as previously stated, anonymous events are still experimental in the iOS SDK. I believe it is only supported for raw sensor data so you can't use it with data processing events or even the detection algorithms on the BMI160. Basically it is working enough to work in the MetaBase app, but nothing beyond that.

  • so it is not possible to exchange data on a device on two different phones?

  • No, that is not what I said. What I said is that the Obj-C SDK only supports a limited set of sensors, up to what is necessary for the MetaBase app to work.

    Based on the code snippets you posted, you are using data filters, which is not supported.

This discussion has been closed.