roadlabs / funf-open-sensing-framework

Automatically exported from code.google.com/p/funf-open-sensing-framework
0 stars 0 forks source link

Alarm problem #107

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
Hello,

I have just started using "funf-open-sensing-framework" and it is very 
interesting and useful. 

I have some problems configuring the interval time to read data sensors and 
running the actions related to them (archive,upload,update).

My configuration file is the following one:

<string name="pipeline">        
        {"@type":"edu.mit.media.funf.pipeline.BasicPipeline",
         "name":"default",
         "version":1 ,
         "archive": {
        "@schedule": {"interval": 60}   
      },         

         "data": [                        

                         {"@type": "edu.mit.media.funf.probe.builtin.BatteryProbe",
                         "@schedule": {"interval":30, "exact":true}
                        },

                        {"@type": "edu.mit.media.funf.probe.builtin.SimpleLocationProbe",
                         "@schedule": {"interval": 40, "exact":true},
                         "goodEnoughAccuracy": 80,
                         "maxWaitTime": 60
                        }

                                 ]

      "upload": {
        "url": \"http://192.168.2.17:8000/data\",
        "@schedule": {"interval": 120}
      },
      "update": {
        "url": \"http://192.168.2.17:8000/config\",
        "@schedule": {"interval": 86400}
      } 

    }</string>

When the framework parses it, the result is the following one:

       "@type":"edu.mit.media.funf.pipeline.BasicPipeline",
    "name":"default",
    "version":1,
    "archive":{
    },
    "data":[
        {
            "@type":"edu.mit.media.funf.datasource.CompositeDataSource",
            "source":{
                "@type":"edu.mit.media.funf.datasource.ProbeDataSource",
                "source":{
                    "interval":30,
                    "exact":true,
                    "@type":"edu.mit.media.funf.probe.builtin.AlarmProbe"
                }
            },
            "filter":{
                "@type":"edu.mit.media.funf.action.ActionAdapter",
                "target":{
                    "@type":"edu.mit.media.funf.action.StartDataSourceAction",
                    "target":{
                        "@type":"edu.mit.media.funf.datasource.ProbeDataSource",
                        "source":{
                            "@type":"edu.mit.media.funf.probe.builtin.BatteryProbe"
                        }
                    }
                }
            }
        },
        {
            "@type":"edu.mit.media.funf.datasource.CompositeDataSource",
            "source":{
                "@type":"edu.mit.media.funf.datasource.ProbeDataSource",
                "source":{
                    "interval":40,
                    "exact":true,
                    "@type":"edu.mit.media.funf.probe.builtin.AlarmProbe"
                }
            },
            "filter":{
                "@type":"edu.mit.media.funf.action.ActionAdapter",
                "target":{
                    "@type":"edu.mit.media.funf.action.StartDataSourceAction",
                    "target":{
                        "@type":"edu.mit.media.funf.datasource.ProbeDataSource",
                        "source":{
                            "goodEnoughAccuracy":80,
                            "maxWaitTime":60,
                            "@type":"edu.mit.media.funf.probe.builtin.SimpleLocationProbe"
                        }
                    }
                }
            }
        }
    ],
    "upload":{
        "url":"http://192.168.2.17:8000/data"
    },
    "update":{
        "url":"http://192.168.2.17:8000/config"
    },
    "schedules":{
        "archive":{
            "@type":"edu.mit.media.funf.datasource.CompositeDataSource",
            "source":{
                "@type":"edu.mit.media.funf.datasource.ProbeDataSource",
                "source":{
                    "interval":60,
                    "@type":"edu.mit.media.funf.probe.builtin.AlarmProbe"
                }
            }
        },
        "upload":{
            "@type":"edu.mit.media.funf.datasource.CompositeDataSource",
            "source":{
                "@type":"edu.mit.media.funf.datasource.ProbeDataSource",
                "source":{
                    "interval":120,
                    "@type":"edu.mit.media.funf.probe.builtin.AlarmProbe"
                }
            }
        },
        "update":{
            "@type":"edu.mit.media.funf.datasource.CompositeDataSource",
            "source":{
                "@type":"edu.mit.media.funf.datasource.ProbeDataSource",
                "source":{
                    "interval":86400,
                    "@type":"edu.mit.media.funf.probe.builtin.AlarmProbe"
                }
            }
        }
    }

The framework creates 5 alarms, which run within the interval of time marked 
but I think they don't work properly.

Analyzing the execution data log that is sent to the DataListener when the 
alarm is executed, these are the data obtained:

CONFIG {" @ type ": " edu.mit.media.funf.probe.builtin.AlarmProbe " , "exact" : 
true, "interval ": 30 } 
IMMUTABLE {" timestamp" : 1385459073,786 }

But I would like to obtain information about the sensor or actions related to 
them (archive,upload,update) after the execution of the alarm. For example:

CONFIG {" @ type ": " edu.mit.media.funf.probe.builtin.BatteryProbe "} 
IMMUTABLE 
{"health":2,"icon-small":17302840,"invalid_charger":0,"level":100,"plugged":2,"p
resent":true,"scale":100,"status":5,"technology":"Li-ion","temperature":273,"tim
estamp":1385459073.772,"voltage":4321}

Could the alarm ask for the data obtained from the sensor, store them, update 
them and upload them?Is it possible?. 

Am I doing something wrong?

Can someone help me?

Thank you very much.

Best regards, Celia

Original issue reported on code.google.com by CeliaSch...@gmail.com on 26 Nov 2013 at 12:19