HomeGenie Forum
Development => Bug reporting => Topic started by: badfinger on April 03, 2014, 07:16:34 PM
-
Hi Gene,
there is something wrong with the scheduler service. It can't launch. Everytime you try to start this occurs:
Errors:
1. Object reference not set to an instance of an object
2. at HomeGenie.Automation.Scripting.ModulesManager.get_IsOn () [0x00000] in :0
3. at HomeGenie.Automation.Scripting.ModulesManager.get_IsOff () [0x00000] in :0
4. at HomeGenie.Automation.Scripting.ScriptingInstance.m__0 (HomeGenie.Automation.Scripting.ModuleHelper module) [0x00000] in :0
5. at HomeGenie.Automation.Scripting.ModulesManager.Each (System.Func`2 callback) [0x00000] in :0
6. at HomeGenie.Automation.Scripting.ScriptingInstance.RunCode (System.String PROGRAM_OPTIONS_STRING) [0x00000] in :0
7. at HomeGenie.Automation.Scripting.ScriptingInstance.Run (System.String PROGRAM_OPTIONS_STRING) [0x00000] in :0
Program disabled, fix errors first.
regards
Alex
-
That's odd. It's working here. I also tried recompiling... it continues to work properly.
When reporting a bug please also give few lines about your configuration:
- architecture
- mono version
- what devices have scheduled on/off enabled
- operating system
- etc...
Cheers,
g.
-
Hi Gene,
1. Raspberry
2. CPU Usage
2,6 %
3. Mono version
Mono JIT compiler version 3.2.8 (Debian 3.2.8+dfsg-4+rpi1)
4. All devices are scheduled......this is the reason for homegenie ...... ;-))
regards
Alex
-
Change the "Code to Run" of the "Automation/Scenes/Scheduled on/off" program like this:
var controlModules = Modules.WithFeature("HomeGenie.ScheduleControl");
controlModules.Each((module)=>{
try
{
var schedexpr = module.Parameter("HomeGenie.ScheduleOn").Value;
if (module.IsOff && Scheduler.IsScheduling(schedexpr))
{
Program.Notify("Scheduled Control", module.Instance.Name + " ON");
module.On();
}
}
catch
{
Program.Notify("Scheduler Error", "Module " + module.Instance.Name);
}
return false;
});
controlModules.Each((module)=>{
try
{
var schedexpr = module.Parameter("HomeGenie.ScheduleOff").Value;
if (module.IsOn && Scheduler.IsScheduling(schedexpr))
{
Program.Notify("Scheduled Control", module.Instance.Name + " OFF");
module.Off();
}
}
catch
{
Program.Notify("Scheduler Error", "Module " + module.Instance.Name);
}
return false;
});
I just added a Program.Notify so we can see at least the name of the device causing the error. Also the try/catch will prevent the program from stopping.
Cheers,
g.
-
Hi Gene,
bene. Perfetto.
Ciao
Alex