Author Topic: GCAL3 - General Discussion  (Read 164377 times)

guest141575

  • Guest
Re: GCAL3 - Google Calendar 3 (Unit Busy)
« Reply #15 on: August 27, 2014, 04:33:06 am »
Once it's done does it work correctly?

New status update:

This morning one of my main PLEG wouldn't load due to "Error loading Startup Lua" (or something like that). I can't say why. I had to resolve it by uninstalling GCal 3 and replace it by the old GCal II. Everything works smoothly with the old plugin.

I tried first to just unset the calendar URLs but it didn't help. I wish I could provide some info that is more helpful but I really had to get my Vera system back in a working state.

Offline Stuart

  • Moderator
  • Hero Member
  • *****
  • Posts: 728
  • Karma: +71/-2
Re: GCAL3 - Google Calendar 3 (Unit Busy)
« Reply #16 on: August 27, 2014, 05:53:10 am »
Once it's done does it work correctly?

New status update:

This morning one of my main PLEG wouldn't load due to "Error loading Startup Lua" (or something like that). I can't say why. I had to resolve it by uninstalling GCal 3 and replace it by the old GCal II. Everything works smoothly with the old plugin.

I tried first to just unset the calendar URLs but it didn't help. I wish I could provide some info that is more helpful but I really had to get my Vera system back in a working state.

PLEG gets a little agitated when devices it knew about are changed.  I have found that I need to remove all references to old devices and replace them whenever I either change the name of a plugin or it's device number changes.

With 4 instances of the plugin. ....... it would be easy get out pic sync

guest141575

  • Guest
Re: GCAL3 - Google Calendar 3 (Unit Busy)
« Reply #17 on: August 27, 2014, 06:14:31 am »
Once it's done does it work correctly?

New status update:

This morning one of my main PLEG wouldn't load due to "Error loading Startup Lua" (or something like that). I can't say why. I had to resolve it by uninstalling GCal 3 and replace it by the old GCal II. Everything works smoothly with the old plugin.

I tried first to just unset the calendar URLs but it didn't help. I wish I could provide some info that is more helpful but I really had to get my Vera system back in a working state.

PLEG gets a little agitated when devices it knew about are changed.  I have found that I need to remove all references to old devices and replace them whenever I either change the name of a plugin or it's device number changes.

With 4 instances of the plugin. ....... it would be easy get out pic sync

I had 3 trigger references in PLEG to the GCal devices. When Upgrading I created new GCAL 3 instances first and just changed the trigger references from the old to the new devices. (Btw, PLEG won't recognize any changes made unless I also alter the trigger name). After that I deleted the old GCal II devices and the Plugin itself. I did it this way because I don't want to reimplement my PLEG logic.

This morning when I had problems with my main PLEG starting, I did the same procedure as described above except from that I downgraded. That is, I actually created 4 new GCal II devices. It works fine after changing the references in PLEG to the new GCal II devices, no issues at all and fast reloading.

I don't know if this information helps... I wish I had a spare Vera for testing purposes :D


Offline Stuart

  • Moderator
  • Hero Member
  • *****
  • Posts: 728
  • Karma: +71/-2
Re: GCAL3 - Google Calendar 3
« Reply #18 on: August 27, 2014, 09:20:12 am »
@farang
This is good feedback.  I suspect that it's related to the multiple plugin reload issue - which I have reproduced.

The problem occurs when the plugins are trying to access google at the same time.  It's a little different method between GCal_II and GCal3.  I suspect the problem would occurs after startup during later checks but it's definitely a timing thing and sometimes happens and sometimes not -  so maybe that's what happened.

I'm going to implement a semaphore asap and see if that solves it. .....

A spare vera would be nice😶👀

Offline Stuart

  • Moderator
  • Hero Member
  • *****
  • Posts: 728
  • Karma: +71/-2
Re: GCAL3 - Google Calendar 3 (Unit Busy)
« Reply #19 on: August 27, 2014, 02:13:36 pm »
I've upgraded from GCal II to GCal 3.

Now, whenever Vera needs to make a reload it will take like ages. I have 4 defined calendar devices. The reload happens an arbitrary number of times, typically 4 times in a row. It says "Unit Busy", then it says "Running LUA Startup" or "Starting LUA Engine". Then it starts with "Unit Busy" and so on..  Before it was only a single cycle.

I had a long flight delay and was able to put in and test some semaphore code that should prevent this from happening.  It forces a staggered calendar refresh between instances of the plugin.

 The problem looked to be due to simultaneous https requests - but that's a bit speculative.  Can you try this version and let me know?  I could not get it to 'break' running two plugins at the same time trying for the same calendar ..... 

Attachment removed ...  had a bug
« Last Edit: August 29, 2014, 12:53:57 pm by Stuart »

guest141575

  • Guest
Re: GCAL3 - Google Calendar 3 (Unit Busy)
« Reply #20 on: August 28, 2014, 02:52:52 am »
I've upgraded from GCal II to GCal 3.

Now, whenever Vera needs to make a reload it will take like ages. I have 4 defined calendar devices. The reload happens an arbitrary number of times, typically 4 times in a row. It says "Unit Busy", then it says "Running LUA Startup" or "Starting LUA Engine". Then it starts with "Unit Busy" and so on..  Before it was only a single cycle.

I had a long flight delay and was able to put in and test some semaphore code that should prevent this from happening.  It forces a staggered calendar refresh between instances of the plugin.

 The problem looked to be due to simultaneous https requests - but that's a bit speculative.  Can you try this version and let me know?  I could not get it to 'break' running two plugins at the same time trying for the same calendar .....

Thank You Stuart  :)

Currently I'm quite busy working but I'll try to test when I get some time left. PM me if You'd like to get access to a busy GCal calendar for testing purposes (I manage a school schedule you could use for stress test)

Cheers  ;D

Offline tyfoon

  • Full Member
  • ***
  • Posts: 167
  • Karma: +0/-0
Re: GCAL3 - Google Calendar 3
« Reply #21 on: August 28, 2014, 07:37:59 am »
Hi,

Moving from the original Gcal to Gcal3 and having some issues with PLEG & GCAL3 I don't get.

I'm reading the gc_Trippedevent variable and using this value as a condition. See below for the PLEG logic.

What I don't get is that all three conditions are true.

Please note that the calendar items do not overlap so only one should be true.


Device Properties
Name   Device Name   Device Variable   Value   Last Change   Previous Change
GcalEvent   GCal3 Sensor   gc_TrippedEvent   KIDSWEG   2014-08-28 06:27:21.102   2014-08-28 06:26:21.789


Conditions
TempKidsWeg   No   GcalEvent=="KIDSWEG"   true   2014-08-26 20:03:18.346   2014-08-26 20:01:51.372
TempKidsWarm   No   GcalEvent=="KIDSWARM"   true   2014-08-26 20:09:23.507   0
TempKidsSlapen   No   GcalEvent=="KIDSSLAPEN"   true   2014-08-26 20:09:23.510   0
« Last Edit: August 28, 2014, 07:47:10 am by tyfoon »

Offline Stuart

  • Moderator
  • Hero Member
  • *****
  • Posts: 728
  • Karma: +71/-2
Re: GCAL3 - Google Calendar 3
« Reply #22 on: August 28, 2014, 12:10:59 pm »
Hi,

Moving from the original Gcal to Gcal3 and having some issues with PLEG & GCAL3 I don't get.

I'm reading the gc_Trippedevent variable and using this value as a condition. See below for the PLEG logic.

What I don't get is that all three conditions are true.

Please note that the calendar items do not overlap so only one should be true.


Device Properties
Name   Device Name   Device Variable   Value   Last Change   Previous Change
GcalEvent   GCal3 Sensor   gc_TrippedEvent   KIDSWEG   2014-08-28 06:27:21.102   2014-08-28 06:26:21.789


Conditions
TempKidsWeg   No   GcalEvent=="KIDSWEG"   true   2014-08-26 20:03:18.346   2014-08-26 20:01:51.372
TempKidsWarm   No   GcalEvent=="KIDSWARM"   true   2014-08-26 20:09:23.507   0
TempKidsSlapen   No   GcalEvent=="KIDSSLAPEN"   true   2014-08-26 20:09:23.510   0

Just a shot in the dark.  If gc_triggerNoKeyword is false. What happens if you set it to true?

Offline Borat

  • Full Member
  • ***
  • Posts: 169
  • Karma: +4/-5
Re: GCAL3 - Google Calendar 3
« Reply #23 on: August 29, 2014, 08:37:58 am »
Hi

I am also having trouble getting this to work in PLEG. I am using the "Event has specified name" option. I noticed when I looked in the gcal device advanced tab that the gc_jsonEvents variable is empty. From reading the docs, I believe this is probably what PLEG would be looking at?

Thanks

Offline hansibal

  • Newbie
  • *
  • Posts: 10
  • Karma: +0/-0
Re: GCAL3 - Google Calendar 3
« Reply #24 on: August 29, 2014, 10:22:59 am »
Hi Stuart,

I must be doing something wrong, have been trying for the last 3 day to get it working, first in UI7, but I have reverted to UI6, but no luck there either.

I have tried to set up the plugin both automatically via the 'app store' and manually. I get the calendar view in the calendar tab and I see the test event, but I get stuck in the 'checking loop'

This is the info from the log file
Code: [Select]
06      08/29/14 15:17:53.003   Device_Variable::m_szValue_set device: 107 service: urn:srs-com:serviceId:GCalIII variable: gc_lastCheck was: 2014-08-29T15:17:52 now: 2014-08-29T15:17:53 #hooks: 0 upnp: 0 v:(nil)/NONE duplicate:0 <0x2cd63680>
06      08/29/14 15:17:53.004   Device_Variable::m_szValue_set device: 107 service: urn:srs-com:serviceId:GCalIII variable: gc_jsonEvents was: [] now: [] #hooks: 0 upnp: 0 v:(nil)/NONE duplicate:1 <0x2cd63680>
50      08/29/14 15:17:53.004   luup_log:107: GCal3 gc_V 0.6:Device nil blocked semaphore request from device 107 <0x2cd63680>
06      08/29/14 15:17:53.005   Device_Variable::m_szValue_set device: 107 service: urn:srs-com:serviceId:GCalIII variable: gc_nextCheck was: 2014-08-29T15:18:02 now: 2014-08-29T15:18:03 #hooks: 0 upnp: 0 v:(nil)/NONE duplicate:0 <0x2cd63680>
50      08/29/14 15:17:53.006   luup_log:107: GCal3 gc_V 0.6:Next check will be in 10 sec at 2014-08-29T15:18:03 <0
This is what I get after updating to yesterdays V0.6 lua. It seems to me it doesn't get any events at all. Prior to updating the the most recent lua, I had the package file from post one and I got the following message:
Code: [Select]
LuaInterface::CallFunction_Timer-5 function GCalMain failed [string "local GCAL_VERSION = "V 0.6"..."]:234: attempt to concatenate local 'client_email' (a nil value)
But that seems to work now with the new version

Any ideas would be greatly appreciated!

Keep up the good work

Kr,
Hans

Offline Stuart

  • Moderator
  • Hero Member
  • *****
  • Posts: 728
  • Karma: +71/-2
Re: GCAL3 - Google Calendar 3
« Reply #25 on: August 29, 2014, 11:15:07 am »
Hi

I am also having trouble getting this to work in PLEG. I am using the "Event has specified name" option. I noticed when I looked in the gcal device advanced tab that the gc_jsonEvents variable is empty. From reading the docs, I believe this is probably what PLEG would be looking at?

Thanks

PLEG would not look at gc_jsonEvents.  Provided the browser UI was refreshed (F5) to update the advanced tab - if gc_jsonEvents is empty, this means that no events were read from the calendar - none at all.

What does the front panel of the plugin indicate ?  Does it show an event ?  Not tiggered / active / triggered ?   (lightbulb ==> grey / light yellow / full yellow). It's the value of gc_trippedEvent that causes "Event has specified name" to work.  Note also that your matching condition MUST be all upper case.

Please check these things and we will get it working.   Also - was this an existing or new PLEG configuration ?

The quickest way to troubleshoot is to get a log file with gc_debug set to 3.   The infoviewer plugin is great for that ......

Offline Stuart

  • Moderator
  • Hero Member
  • *****
  • Posts: 728
  • Karma: +71/-2
Re: GCAL3 - Google Calendar 3
« Reply #26 on: August 29, 2014, 12:52:27 pm »
Attached is a patched file.  There was a problem with the semaphore and that certainly affected Hansibal , quite likely Borat and likely everyone else who tried the last patch (which I have removed).

Here is version 6.1.2 -- please let me know how it goes.  I deliberately tried to make it misbehave - and think I've got it this time .....  learning about Lua all the time ......

Edit: Removed Attachment
« Last Edit: January 28, 2016, 07:05:38 pm by Stuart »

Offline Stuart

  • Moderator
  • Hero Member
  • *****
  • Posts: 728
  • Karma: +71/-2
Re: GCAL3 - Google Calendar 3
« Reply #27 on: August 29, 2014, 01:02:49 pm »
Hi Stuart,

I must be doing something wrong, have been trying for the last 3 day to get it working, first in UI7, but I have reverted to UI6, but no luck there either.

I have tried to set up the plugin both automatically via the 'app store' and manually. I get the calendar view in the calendar tab and I see the test event, but I get stuck in the 'checking loop'

This is the info from the log file
Code: [Select]
06      08/29/14 15:17:53.003   Device_Variable::m_szValue_set device: 107 service: urn:srs-com:serviceId:GCalIII variable: gc_lastCheck was: 2014-08-29T15:17:52 now: 2014-08-29T15:17:53 #hooks: 0 upnp: 0 v:(nil)/NONE duplicate:0 <0x2cd63680>
06      08/29/14 15:17:53.004   Device_Variable::m_szValue_set device: 107 service: urn:srs-com:serviceId:GCalIII variable: gc_jsonEvents was: [] now: [] #hooks: 0 upnp: 0 v:(nil)/NONE duplicate:1 <0x2cd63680>
50      08/29/14 15:17:53.004   luup_log:107: GCal3 gc_V 0.6:Device nil blocked semaphore request from device 107 <0x2cd63680>
06      08/29/14 15:17:53.005   Device_Variable::m_szValue_set device: 107 service: urn:srs-com:serviceId:GCalIII variable: gc_nextCheck was: 2014-08-29T15:18:02 now: 2014-08-29T15:18:03 #hooks: 0 upnp: 0 v:(nil)/NONE duplicate:0 <0x2cd63680>
50      08/29/14 15:17:53.006   luup_log:107: GCal3 gc_V 0.6:Next check will be in 10 sec at 2014-08-29T15:18:03 <0
This is what I get after updating to yesterdays V0.6 lua. It seems to me it doesn't get any events at all. Prior to updating the the most recent lua, I had the package file from post one and I got the following message:
Code: [Select]
LuaInterface::CallFunction_Timer-5 function GCalMain failed [string "local GCAL_VERSION = "V 0.6"..."]:234: attempt to concatenate local 'client_email' (a nil value)
But that seems to work now with the new version

Any ideas would be greatly appreciated!

Keep up the good work

Kr,
Hans

I'd love to know how this goes in UI7 .....

I think I fixed the problem you were seeing ....   see post above ....

Offline tyfoon

  • Full Member
  • ***
  • Posts: 167
  • Karma: +0/-0
Re: GCAL3 - Google Calendar 3
« Reply #28 on: August 29, 2014, 03:35:32 pm »
Hi

I am also having trouble getting this to work in PLEG. I am using the "Event has specified name" option. I noticed when I looked in the gcal device advanced tab that the gc_jsonEvents variable is empty. From reading the docs, I believe this is probably what PLEG would be looking at?

Thanks

PLEG would not look at gc_jsonEvents.  Provided the browser UI was refreshed (F5) to update the advanced tab - if gc_jsonEvents is empty, this means that no events were read from the calendar - none at all.

What does the front panel of the plugin indicate ?  Does it show an event ?  Not tiggered / active / triggered ?   (lightbulb ==> grey / light yellow / full yellow). It's the value of gc_trippedEvent that causes "Event has specified name" to work.  Note also that your matching condition MUST be all upper case.

Please check these things and we will get it working.   Also - was this an existing or new PLEG configuration ?

The quickest way to troubleshoot is to get a log file with gc_debug set to 3.   The infoviewer plugin is great for that ......
Hi Stuart,  please see my pleg code above (all capitals) and a screenshot of the Plugin.  The Plugin nicely shows a burning light bulb and the correct event.

Offline Borat

  • Full Member
  • ***
  • Posts: 169
  • Karma: +4/-5
Re: GCAL3 - Google Calendar 3
« Reply #29 on: August 30, 2014, 07:46:15 am »
Hi

I am also having trouble getting this to work in PLEG. I am using the "Event has specified name" option. I noticed when I looked in the gcal device advanced tab that the gc_jsonEvents variable is empty. From reading the docs, I believe this is probably what PLEG would be looking at?

Thanks

PLEG would not look at gc_jsonEvents.  Provided the browser UI was refreshed (F5) to update the advanced tab - if gc_jsonEvents is empty, this means that no events were read from the calendar - none at all.

What does the front panel of the plugin indicate ?  Does it show an event ?  Not tiggered / active / triggered ?   (lightbulb ==> grey / light yellow / full yellow). It's the value of gc_trippedEvent that causes "Event has specified name" to work.  Note also that your matching condition MUST be all upper case.

Please check these things and we will get it working.   Also - was this an existing or new PLEG configuration ?

The quickest way to troubleshoot is to get a log file with gc_debug set to 3.   The infoviewer plugin is great for that ......

It was definitely tripping on am event. Away at the mo so can't send a screenshot but it was showing the event I was looking for in pleg at the top and showing tripped. Will try the new version when I get home and let u know.