carp.sensing-flutter icon indicating copy to clipboard operation
carp.sensing-flutter copied to clipboard

weather probe not working when air quality is included

Open sc00n opened this issue 3 years ago • 3 comments

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);

sc00n avatar Jan 16 '23 15:01 sc00n

Strange - will investigate.

bardram avatar Jan 18 '23 12:01 bardram

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:

  • make sure that you're on the latest v. 0.40.12 version of CAMS (previously there was a bug in the IntervalTrigger)
  • check you weather API key - if you're using the CACHET api key (ending in 844a) it is on a regular basis blocked due to over-use

bardram avatar Feb 13 '23 11:02 bardram

This is still a problem...

image

bardram avatar Dec 18 '23 12:12 bardram