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