more G-Labs products

Author Topic: Release 358 Bug  (Read 1613 times)

April 03, 2014, 07:16:34 PM
Read 1613 times

badfinger

  • **
  • Information
  • Jr. Member
  • Posts: 32
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

April 03, 2014, 07:33:36 PM
Reply #1

Gene

  • *****
  • Information
  • Administrator
  • Posts: 1472
  • Tangible is the future!
    • Yet Another Programmer
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.
« Last Edit: April 03, 2014, 07:35:48 PM by Gene »

April 03, 2014, 07:46:32 PM
Reply #2

badfinger

  • **
  • Information
  • Jr. Member
  • Posts: 32
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





April 03, 2014, 08:42:06 PM
Reply #3

Gene

  • *****
  • Information
  • Administrator
  • Posts: 1472
  • Tangible is the future!
    • Yet Another Programmer
Change the "Code to Run" of the "Automation/Scenes/Scheduled on/off" program like this:

Code: [Select]
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.
« Last Edit: April 03, 2014, 08:50:03 PM by Gene »

April 03, 2014, 09:57:20 PM
Reply #4

badfinger

  • **
  • Information
  • Jr. Member
  • Posts: 32
Hi Gene,
bene. Perfetto.

Ciao

Alex