cph-cachet / carp.sensing-flutter

CARP Mobile Sensing for Flutter, including mobile sensing framework, data backend support, and the CARP mobile sensing app.
MIT License
79 stars 28 forks source link

weather probe not working when air quality is included #308

Open sc00n opened 1 year ago

sc00n commented 1 year ago

Weather seems to work ok when I use all sensors excluding air quality. Once I add air quality I don't get anything anymore from weather.

code (with sampling every 10s. In real experiment the sampling will obviously be at a lower frequency).

 AirQualityService airService =
      AirQualityService(apiKey: APIAIR);
      protocol.addConnectedDevice(airService);

      protocol.addTriggeredTask(
          IntervalTrigger(period: Duration(seconds: 10)),
          BackgroundTask()
            ..addMeasure(Measure(type: ContextSamplingPackage.AIR_QUALITY)),
          airService);

WeatherService weatherService =
      WeatherService(apiKey: APIWEATHER);
      protocol.addConnectedDevice(weatherService);

      protocol.addTriggeredTask(
          IntervalTrigger(period: Duration(seconds: 10)),
          BackgroundTask()
            ..addMeasure(Measure(type: ContextSamplingPackage.WEATHER)),
          weatherService);
bardram commented 1 year ago

Strange - will investigate.

bardram commented 1 year ago

I cannot reproduce this error. When I configure a protocol to sample both weather and air quality on a regular basis (IntervalTrigger) it seems to work fine.

Two things to note:

bardram commented 8 months ago

This is still a problem...

image