GCAL3 - General Discussion

This topic is for general discussion about Google Calendar 3

Stuart, really looking forward to installing this. Will give it a go in the next day or so… So glad this plugin is in it’s own forum (just noticed that)…

Just posted the release files above. Hope the install is smooth …

Thumbs up Stuart!!!

Followed all the steps, but:

50 08/25/14 11:24:40.417 luup_log:75: GCal3 gc_V 0.6:Getting new token __LEAK__ this:40960 start:3620864 to 0x12e1000 <0x8c24> 50 08/25/14 11:24:40.420 luup_log:75: GCal3 gc_V 0.6:Client email is: xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx@developer.gserviceaccount.com __LEAK__ this:4096 start:3624960 to 0x12e2000 <0x8c24> 50 08/25/14 11:24:40.792 luup_log:75: GCal3 gc_V 0.6:Command rm /etc/cmh-ludl/GCal3/GCal3.token returned 256 <0x8c24> 50 08/25/14 11:24:41.027 luup_log:75: GCal3 gc_V 0.6:Command /usr/lib/lua/googlejwt.sh xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx@developer.gserviceaccount.com https://www.googleapis.com/auth/calendar /etc/cmh-ludl/GCal3/GCal3.pem /etc/cmh-ludl/GCal3/GCal3.token returned 32512 <0x8c24> 50 08/25/14 11:24:41.028 luup_log:75: GCal3 gc_V 0.6:Could not execute the googlejwt.sh script <0x8c24> 50 08/25/14 11:24:41.029 luup_log:75: GCal3 gc_V 0.6:Fatal error trying to get access token <0x8c24> 06 08/25/14 11:24:41.032 Device_Variable::m_szValue_set device: 75 service: urn:srs-com:serviceId:GCalIII variable: gc_nextCheck was: 2014-08-25T14:13:52 now: 2014-08-25T14:24:32 #hooks: 0 upnp: 0 v:(nil)/NONE duplicate:0 <0x8c24> 50 08/25/14 11:24:41.033 luup_log:75: GCal3 gc_V 0.6:Next check will be in 10800 sec at 2014-08-25T14:24:32 <0x8c24>

The calendar shows up fine though after opening the calendar-tab, the device hangs on ‘Checking…’.

Any idea? :slight_smile:

Stuart,

Will GCal3 install over GCal_II or would it be appear as another device?

Thank you!

JR

[quote=“duiffie, post:5, topic:182612”]Followed all the steps, but:

50 08/25/14 11:24:40.417 luup_log:75: GCal3 gc_V 0.6:Getting new token __LEAK__ this:40960 start:3620864 to 0x12e1000 <0x8c24> 50 08/25/14 11:24:40.420 luup_log:75: GCal3 gc_V 0.6:Client email is: xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx@developer.gserviceaccount.com __LEAK__ this:4096 start:3624960 to 0x12e2000 <0x8c24> 50 08/25/14 11:24:40.792 luup_log:75: GCal3 gc_V 0.6:Command rm /etc/cmh-ludl/GCal3/GCal3.token returned 256 <0x8c24> 50 08/25/14 11:24:41.027 luup_log:75: GCal3 gc_V 0.6:Command /usr/lib/lua/googlejwt.sh xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx@developer.gserviceaccount.com https://www.googleapis.com/auth/calendar /etc/cmh-ludl/GCal3/GCal3.pem /etc/cmh-ludl/GCal3/GCal3.token returned 32512 <0x8c24> 50 08/25/14 11:24:41.028 luup_log:75: GCal3 gc_V 0.6:Could not execute the googlejwt.sh script <0x8c24> 50 08/25/14 11:24:41.029 luup_log:75: GCal3 gc_V 0.6:Fatal error trying to get access token <0x8c24> 06 08/25/14 11:24:41.032 Device_Variable::m_szValue_set device: 75 service: urn:srs-com:serviceId:GCalIII variable: gc_nextCheck was: 2014-08-25T14:13:52 now: 2014-08-25T14:24:32 #hooks: 0 upnp: 0 v:(nil)/NONE duplicate:0 <0x8c24> 50 08/25/14 11:24:41.033 luup_log:75: GCal3 gc_V 0.6:Next check will be in 10800 sec at 2014-08-25T14:24:32 <0x8c24>

The calendar shows up fine though after opening the calendar-tab, the device hangs on ‘Checking…’.

Any idea? :-)[/quote]

@duiffie
This log tells me there was a error trying to execute the command /ur/lib/lua/googlejwt.sh – possibly that it could not be found …
The number and type of arguments looks correct

What does the log file indicate at the very start ? It’s possible there was a failure in downloading googlejwt.sh or setting it’s permissions.

Unfortunately googlejwt.sh is currently a ‘black box’ there is no debugging. That’s the next thing I’m working on, although - given a correctly formed GCal3.json file - I’ve not seen it fail.

Lets see if googlejwt.json exists first - can you telnet in ? do an ‘ls -l’ ?

[quote=“roquej, post:6, topic:182612”]Stuart,

Will GCal3 install over GCal_II or would it be appear as another device?

Thank you!

JR[/quote]

You “should” be fine - I think (I’m on the road for a couple of days) there may be one global variable that I have not tidied up that is common with GCal_II but it’s only used briefly when decoding calendar results - so it would be bad luck if there was a ‘collision’. Even then - I’m not certain how Lua / mios seprates the execution space … so it might be perfectly fine even as is.

[quote=“Stuart, post:7, topic:182612”][quote=“duiffie, post:5, topic:182612”]Followed all the steps, but:

50 08/25/14 11:24:40.417 luup_log:75: GCal3 gc_V 0.6:Getting new token __LEAK__ this:40960 start:3620864 to 0x12e1000 <0x8c24> 50 08/25/14 11:24:40.420 luup_log:75: GCal3 gc_V 0.6:Client email is: xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx@developer.gserviceaccount.com __LEAK__ this:4096 start:3624960 to 0x12e2000 <0x8c24> 50 08/25/14 11:24:40.792 luup_log:75: GCal3 gc_V 0.6:Command rm /etc/cmh-ludl/GCal3/GCal3.token returned 256 <0x8c24> 50 08/25/14 11:24:41.027 luup_log:75: GCal3 gc_V 0.6:Command /usr/lib/lua/googlejwt.sh xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx@developer.gserviceaccount.com https://www.googleapis.com/auth/calendar /etc/cmh-ludl/GCal3/GCal3.pem /etc/cmh-ludl/GCal3/GCal3.token returned 32512 <0x8c24> 50 08/25/14 11:24:41.028 luup_log:75: GCal3 gc_V 0.6:Could not execute the googlejwt.sh script <0x8c24> 50 08/25/14 11:24:41.029 luup_log:75: GCal3 gc_V 0.6:Fatal error trying to get access token <0x8c24> 06 08/25/14 11:24:41.032 Device_Variable::m_szValue_set device: 75 service: urn:srs-com:serviceId:GCalIII variable: gc_nextCheck was: 2014-08-25T14:13:52 now: 2014-08-25T14:24:32 #hooks: 0 upnp: 0 v:(nil)/NONE duplicate:0 <0x8c24> 50 08/25/14 11:24:41.033 luup_log:75: GCal3 gc_V 0.6:Next check will be in 10800 sec at 2014-08-25T14:24:32 <0x8c24>

The calendar shows up fine though after opening the calendar-tab, the device hangs on ‘Checking…’.

Any idea? :-)[/quote]

@duiffie
This log tells me there was a error trying to execute the command /ur/lib/lua/googlejwt.sh – possibly that it could not be found …
The number and type of arguments looks correct

What does the log file indicate at the very start ? It’s possible there was a failure in downloading googlejwt.sh or setting it’s permissions.

Unfortunately googlejwt.sh is currently a ‘black box’ there is no debugging. That’s the next thing I’m working on, although - given a correctly formed GCal3.json file - I’ve not seen it fail.

Lets see if googlejwt.json exists first - can you telnet in ? do an ‘ls -l’ ?[/quote]

it does exist and it is executable:

ls -ltr /usr/lib/lua/googlejwt.sh -rwxr-xr-x 1 root root 1240 Aug 25 18:04 /usr/lib/lua/googlejwt.sh

i see that the openssl command is used within this shell script. My box (vera 2) doesn’t seem to have openssl installed, can that be a reason?

@ Duiffie
Wow! I have a vera light and do not know if there is supposed to be a difference.

The reason I went that route is because vera does not have a lua module that would otherwise be used. So I assumed that the *nix libraries would be the safest approach…

I’ll send an email to vera support and ask. It may be a simple opt install - if so we can do that manually and later I can pout a check in the plugin.

[quote=“Stuart, post:10, topic:182612”]@ Duiffie
Wow! I have a vera light and do not know if there is supposed to be a difference.

The reason I went that route is because vera does not have a lua module that would otherwise be used. So I assumed that the *nix libraries would be the safest approach…

I’ll send an email to vera support and ask. It may be a simple opt install - if so we can do that manually and later I can pout a check in the plugin.[/quote]

I did 2 things and then things started to work:

  • installed openssl: opkg install openssl-util
  • changed the first line of the googlejwt.sh script (#!/bin/bash to #!/bin/ash) because bash seems not present on vera 2 as well

@Duiffie

Great! And Thanks! !!!

I suspect that ash vs bash is just a symlink to busybox- strange that MCV would do that. … might be an openwrt thing. …

Might be that the script can be made generic by invoking busybox direct.

I’m traveling this week but will look at some options when I return including auto installing opened out it’s not there. …

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.

[quote=“farang, post:13, topic:182612”]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.[/quote]

Once it’s done does it work correctly?
Can you capture a log file?
I did not test with multiple plugins since hopefully the ability to define multiple keywords makes that unnecessary. I will try to test but may not get to it until next week.

[quote=“Stuart, post:14, topic:182612”][quote=“farang, post:13, topic:182612”]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.[/quote]

Once it’s done does it work correctly?
Can you capture a log file?
I did not test with multiple plugins since hopefully the ability to define multiple keywords makes that unnecessary. I will try to test but may not get to it until next week.[/quote]

First I want to say Thank You for your great work. ;D

Yes, everything seems to work after it’s done reloading etc , so it’s not that urgent. It can wait until you have time to look into it. I use multiple GCal 3 devices since I have several calendars to watch :smiley:

If You can’t reproduce the behaviour I will learn how to produce a log file. Thanks! ;D ;D ;D

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.

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.[/quote]

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

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.[/quote]

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[/quote]

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 :smiley:

@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​:no_mouth::eyes:

[quote=“farang, post:13, topic:182612”]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.[/quote]

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

© 2019 Vera Control Ltd., All Rights Reserved. Terms of Use | Privacy Policy