We have moved at community.getvera.com

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

Offline Stuart

  • Moderator
  • Hero Member
  • *****
  • Posts: 728
  • Karma: +71/-2
Re: GCAL3 - Google Calendar 3
« Reply #135 on: October 03, 2014, 12:11:13 am »
I started from the beginning ... By removing all ...
I recreated a module (241) with my calendar, default was GCal3241.token ??
After a reload Successfully initialized (but blocked)  He tells me it is retained after a check.

50      10/03/14 5:16:01.701    luup_log:241: GCal3 gc_V 0.7.0:Command ls /etc/cmh-ludl/GCal3/GCal3241.token returned 0 <0x30d4b680>

I feel that it comes from my google calendar but I do not understand because I do not have defects in .log

In fact I have two calendars that work well ...
All other even if I create them ask me problems.

I was wondering if it's because they had no event the day before or after ...

So I add "test" with recursion each day and the module works !!!!
Is gc_debug set to 3 ?   If it is not then you will only get basic logging - not details.   I think this may be the situation.

Doe the content of GCal3241.token look like this ?

{
  "access_token" : "ya29.kgDML9AF5-abc123abc123L9ljNdfQzbf9oLARmEwHG672iXe-_mvuA",
  "token_type" : "Bearer",
  "expires_in" : 3600
}

This is a good token - so one of the things that says it's ok.

I really need to see the rest of the log.   If gc_debug is set to 3 then we should see the messages we are after.

If you remove some of the plugins (when troubleshooting) then the semaphore can get 'stuck'

Just to make sure -- run this before testing

Code: [Select]
local result = os.execute("rm -f /etc/cmh-ludl/GCal3/GCal3.sem")

This will clear the semaphore file and allow things to run again.   But without gc_debug set to 3 it will be impossible to see what is happening.

Start with one plugin - make sure it is working properly - get a log file
Add another plugin (make sure gc_debug set to 3) - get a log file

step by step and we will fix this .....

Offline Eldoctor62

  • Sr. Newbie
  • *
  • Posts: 23
  • Karma: +0/-0
Re: GCAL3 - Google Calendar 3
« Reply #136 on: October 03, 2014, 02:00:43 am »
Thank you for your help Stuart;-)

So I have 3 in debug mode, I follow your instructions step by step

I'll let the log work alone today ...

I just come back to the fact that if I have nothing the next 24 hours, the plug remains pending (Checking ...) and therefore block other ... If I program any event within 24 hours while normal returns and other plug ... and running again properly!

Also, if an event is not until around 6hours before it gets stuck
« Last Edit: October 03, 2014, 05:38:34 am by Eldoctor62 »

Offline Stuart

  • Moderator
  • Hero Member
  • *****
  • Posts: 728
  • Karma: +71/-2
Re: GCAL3 - Google Calendar 3
« Reply #137 on: October 03, 2014, 09:56:35 am »
Thank you for your help Stuart;-)

So I have 3 in debug mode, I follow your instructions step by step

I'll let the log work alone today ...

I just come back to the fact that if I have nothing the next 24 hours, the plug remains pending (Checking ...) and therefore block other ... If I program any event within 24 hours while normal returns and other plug ... and running again properly!

Also, if an event is not until around 6hours before it gets stuck

Please attach a copy of your log file so i can take a look

Offline Eldoctor62

  • Sr. Newbie
  • *
  • Posts: 23
  • Karma: +0/-0
Re: GCAL3 - Google Calendar 3
« Reply #138 on: October 04, 2014, 01:43:22 am »
I sent my log MP ...  ;)

We can see there has midnight blockage ... What i see is that there is nothing planned for the day or the next day ... I could be wrong but if i program something, the plug returns to work  :o

guest141575

  • Guest
Re: GCAL3 - Google Calendar 3
« Reply #139 on: October 04, 2014, 03:09:55 am »
Good morning Stuart!  ;D ;D ;D

No lessons scheduled today. gc_EventsToday is not zeroed (is zeroed even a word? I don't know) if no events found. Manual GCalCheck doesn't help either.

I wish you a nice weekend :D

Offline geoay

  • Jr. Member
  • **
  • Posts: 68
  • Karma: +0/-0
Re: GCAL3 - Google Calendar 3
« Reply #140 on: October 04, 2014, 12:42:46 pm »
I am facing some issues with the Plug-in.
I installed it successfully. I was able to see my Google Calendar.
But now it doesn't work anymore ...
When I start Vera  I got Successfully initialized in the Plug-in interface.
But when I click the check button,  then agenda... No more agenda displayed.
I  record some log and I got this :

Device_Variable::m_szValue_set device: 396 service: urn:srs-com:serviceId:GCalIII variable: gc_lastCheck was: 2014-10-04T14:41:44 now: 2014-10-04T14:41:54 #hooks: 0 upnp: 0 v:(nil)/NONE duplicate:0 <0x306b3680>
06   10/04/14 14:41:54.102   Device_Variable::m_szValue_set device: 396 service: urn:srs-com:serviceId:GCalIII variable: gc_jsonEvents was: [] now: [] #hooks: 0 upnp: 0 v:(nil)/NONE duplicate:1 <0x306b3680>
50   10/04/14 14:41:54.102   luup_log:396: GCal3 gc_V 0.7.0:Checking semaphore <0x306b3680>
50   10/04/14 14:41:54.125   luup_log:396: GCal3 gc_V 0.7.0:Command ls /etc/cmh-ludl/GCal3/GCal3.sem returned 0 <0x306b3680>
50   10/04/14 14:41:54.125   luup_log:396: GCal3 gc_V 0.7.0:Semaphore file returned 396 <0x306b3680>
50   10/04/14 14:41:54.148   luup_log:396: GCal3 gc_V 0.7.0:Command ls /etc/cmh-ludl/GCal3/GCal3.sem returned 0 <0x306b3680>
50   10/04/14 14:41:54.149   luup_log:396: GCal3 gc_V 0.7.0:Device 396 claimed semaphore <0x306b3680>
50   10/04/14 14:41:54.150   luup_log:396: GCal3 gc_V 0.7.0:StartMin is 2014-10-04T00:00:00.000Z StartMax is 2014-10-05T15:41:54.000Z <0x306b3680>
50   10/04/14 14:41:54.151   luup_log:396: GCal3 gc_V 0.7.0:Function: requestCalendar <0x306b3680>
50   10/04/14 14:41:54.173   luup_log:396: GCal3 gc_V 0.7.0:Command ls /etc/cmh-ludl/GCal3/GCal3396.token returned 0 <0x306b3680>
50   10/04/14 14:41:54.418   luup_log:396: GCal3 gc_V 0.7.0:token info status: HTTP/1.1 200 OK __LEAK__ this:73728 start:2109440 to 0x1bc8000 <0x306b3680>
50   10/04/14 14:41:54.421   luup_log:396: GCal3 gc_V 0.7.0:Token will expire in 3196 sec <0x306b3680>
50   10/04/14 14:41:54.421   luup_log:396: GCal3 gc_V 0.7.0:Checking google calendar <0x306b3680>
50   10/04/14 14:41:54.422   luup_log:396: GCal3 gc_V 0.7.0:Requested url: https://www.googleapis.com/calendar/v3/calendars/xxxxxxxf8qbvhfr3ogmr73s2nio@group.calendar.google.com/events?access_token=xxxxxxxxx57meI4H-0TZEpBrnymDpR1maxA89bhBKPVdV-mmVoyYVh-6gnr&timeZone=utc&singleEvents=true&orderBy=startTime&timeMax=2014-10-05T15:41:54.000Z&timeMin=2014-10-04T00:00:00.000Z&fields=items(description%2Cend%2Cstart%2Csummary) <0x306b3680>
50   10/04/14 14:41:54.697   luup_log:396: GCal3 gc_V 0.7.0:Calendar request status: HTTP/1.1 200 OK __LEAK__ this:73728 start:2183168 to 0x1bda000 <0x306b3680>
01   10/04/14 14:41:54.698   LuaInterface::CallFunction_Timer-5 function GCalMain failed /usr/lib/lua/json.lua:366: Unexpected character at Line 2 character 13: ] (93) when reading array ({ or [ or ' or " or number or boolean or null expected)
Context:

(I put some xxx in token  for confidentiality)
What about this :function GCalMain failed ??
The most  strange is everything was running perfectly 3 days ago.

Offline Stuart

  • Moderator
  • Hero Member
  • *****
  • Posts: 728
  • Karma: +71/-2
Re: GCAL3 - Google Calendar 3
« Reply #141 on: October 04, 2014, 01:23:48 pm »
Thanks guys -- this log info will be helpful.   I'll take a look later today and either have a fix or some instrumented code.  What it looks like is that there is a call 'hanging' .  This causes the semaphore to stay with the 'hung' plugin instance and block the others.

Offline Fear Na Boinne

  • Sr. Newbie
  • *
  • Posts: 49
  • Karma: +0/-0
Re: GCAL3 - Google Calendar 3
« Reply #142 on: October 04, 2014, 02:36:36 pm »
Just wanted to say Thanks for this plugin!   :D

Offline geoay

  • Jr. Member
  • **
  • Posts: 68
  • Karma: +0/-0
Re: GCAL3 - Google Calendar 3
« Reply #143 on: October 04, 2014, 05:26:50 pm »
It seems that if there is no event in the calendar for a period of 24 hours,  the Plug-in hangs..?
Not tested myself but viewed on the main French Home Automation forum.
If it can help.

Offline Stuart

  • Moderator
  • Hero Member
  • *****
  • Posts: 728
  • Karma: +71/-2
Re: GCAL3 - Google Calendar 3
« Reply #144 on: October 04, 2014, 10:27:19 pm »
50   10/04/14 14:41:54.697   luup_log:396: GCal3 gc_V 0.7.0:Calendar request status: HTTP/1.1 200 OK __LEAK__ this:73728 start:2183168 to 0x1bda000 <0x306b3680>
01   10/04/14 14:41:54.698   LuaInterface::CallFunction_Timer-5 function GCalMain failed /usr/lib/lua/json.lua:366: Unexpected character at Line 2 character 13: ] (93) when reading array ({ or [ or ' or " or number or boolean or null expected)

It seems that if there is no event in the calendar for a period of 24 hours,  the Plug-in hangs..?
Not tested myself but viewed on the main French Home Automation forum.
If it can help.

It looks like google calendar is returning something that is not being properly decoded - it's possible that there may be a language specific 'something' going on.

I'm running three plugin instances for testing and have not seen this issue and don't know how to recreate it .....

This patched version does two things (1) logs the raw calendar data (2) checks for an 'items' entry and (3) has some new (slightly experimental) code to remove any hanging semaphores during a restart.

My calendar - with no events - produces a log entry like this:
50      10/04/14 20:15:42.047   luup_log:10: GCal3 V 0.7.3:*************************************************************************** <0x2cc3f680>
50      10/04/14 20:15:42.047   luup_log:10: GCal3 V 0.7.3:{
 "items": []
}
 <0x2cc3f680>
50      10/04/14 20:15:42.047   luup_log:10: GCal3 V 0.7.3:***************************************************************************

These should get us much closer ....    please make sure gc_debug is set to 3 for each plugin and send the log file .....

EDIT: Attachment removed.
« Last Edit: October 06, 2014, 10:56:14 am by Stuart »

Offline aboyer

  • Sr. Newbie
  • *
  • Posts: 45
  • Karma: +0/-0
Re: GCAL3 - Google Calendar 3
« Reply #145 on: October 05, 2014, 07:38:19 pm »
Hi,
I have been using Google Calendar and PLEG to turn on a light in my bedroom in the morning using the following condition:

IsNight AND WorkDayMBRLightOn AND (GoogleCalendar ==0) AND (IsNight; WorkDayMBRLightOn)

If it is still dark outside (IsNight) and it is not a holiday or a day labelled as vacation in my google calendar, the light will turn on. I can't figure out what I should be replacing "GoogleCalendar ==0" now that I have upgraded to GCal3.

I thought I could use Trigger but that doesn't seem to work.

Thanks,
Antonio

Offline Stuart

  • Moderator
  • Hero Member
  • *****
  • Posts: 728
  • Karma: +71/-2
Re: GCAL3 - Google Calendar 3
« Reply #146 on: October 05, 2014, 08:11:21 pm »
50   10/04/14 14:41:54.697   luup_log:396: GCal3 gc_V 0.7.0:Calendar request status: HTTP/1.1 200 OK __LEAK__ this:73728 start:2183168 to 0x1bda000 <0x306b3680>
01   10/04/14 14:41:54.698   LuaInterface::CallFunction_Timer-5 function GCalMain failed /usr/lib/lua/json.lua:366: Unexpected character at Line 2 character 13: ] (93) when reading array ({ or [ or ' or " or number or boolean or null expected)

It seems that if there is no event in the calendar for a period of 24 hours,  the Plug-in hangs..?
Not tested myself but viewed on the main French Home Automation forum.
If it can help.

It looks like google calendar is returning something that is not being properly decoded - it's possible that there may be a language specific 'something' going on.

I'm running three plugin instances for testing and have not seen this issue and don't know how to recreate it .....

This patched version does two things (1) logs the raw calendar data (2) checks for an 'items' entry and (3) has some new (slightly experimental) code to remove any hanging semaphores during a restart.

My calendar - with no events - produces a log entry like this:
50      10/04/14 20:15:42.047   luup_log:10: GCal3 V 0.7.3:*************************************************************************** <0x2cc3f680>
50      10/04/14 20:15:42.047   luup_log:10: GCal3 V 0.7.3:{
 "items": []
}
 <0x2cc3f680>
50      10/04/14 20:15:42.047   luup_log:10: GCal3 V 0.7.3:***************************************************************************

These should get us much closer ....    please make sure gc_debug is set to 3 for each plugin and send the log file .....

I was looking at a log provided by Eldoctor62 and noticed that there is a problem with the info viewer log output
Unfortunately - each point where the calendar data should be - it is missing.  This seems to be a characteristic of the info viewer that I had not noticed before.
Can you use WinSCP or some other tool to get the log directly ?   /var/log/cmh/LuaUPnP.log


Offline Stuart

  • Moderator
  • Hero Member
  • *****
  • Posts: 728
  • Karma: +71/-2
Re: GCAL3 - Google Calendar 3
« Reply #147 on: October 05, 2014, 08:41:55 pm »

I was looking at a log provided by Eldoctor62 and noticed that there is a problem with the info viewer log output
Unfortunately - each point where the calendar data should be - it is missing.  This seems to be a characteristic of the info viewer that I had not noticed before.
Can you use WinSCP or some other tool to get the log directly ?   /var/log/cmh/LuaUPnP.log

Edit
Or use this version 0.7.4 .  I escaped the non alpha numeric characters - so it now prints the main detail in info viewer
Edit
Slight update to attachment

EDIT:
Attachment Removed
« Last Edit: January 28, 2016, 07:12:42 pm by Stuart »

Offline Eldoctor62

  • Sr. Newbie
  • *
  • Posts: 23
  • Karma: +0/-0
Re: GCAL3 - Google Calendar 3
« Reply #148 on: October 06, 2014, 04:06:19 am »
Hi, thanks Stuart

I installed the new file and I have reproduced the problem. The log was sent by message ;-)


Envoy? depuis mon iPhone

Offline Stuart

  • Moderator
  • Hero Member
  • *****
  • Posts: 728
  • Karma: +71/-2
Re: GCAL3 - Google Calendar 3
« Reply #149 on: October 06, 2014, 10:50:21 am »
Hi, thanks Stuart

I installed the new file and I have reproduced the problem. The log was sent by message ;-)


Envoy? depuis mon iPhone
@Eldoctor62 --

I sent you an IM - asking you send a log to my personal email.   The first log file did not show any errors BUT was also missing log information - I am guessing because google docs was trying to interpret the calendar data as format instructions ????   The second log file could not be read.