Persistent GCal issues

21 replies [Last post]
garrydwilms
Offline
United Kingdom
Joined: 31 Mar 2011

Hi All,

I have commented on this issue before but it is getting worse and my previous workaround is now also becoming unreliable, therefore I was wondering if somebody could help me to get to the bottom of the following issue.

I use google calendar to schedule switching my lights on and off. I used to just have an event with the same on/off time to make this happen (and hence one alias message was generated by the HAH) and all was good until a few months back when I noticed that I was missing some events.

This got worse until I was getting hardly any events triggered. To get round this I now schedule 10minute long events to ensure I get 10 attempts at generating the alias message and hence switch my lights either on or off accordingly. (xfx viewer shows I tended to get ~4 messages in any 10min period, ie 40% success rate)

This did get round the issue for a while but now even this does not gurantee the alias message being generated (i.e. sometimes I get no alias messages out of 10 attempts)

I want to use this feature for my heating in the winter but cannot currently rely on Cgal to generate the neccesary events.

Debugging shows the HAH to do the poll every 60 seconds as expected but returns no events from google calendar even when I know there are events present and correctly formatted.

I was therefore wondering if somebody could schedule a 10minute long alias event and monitor the results in xfx viewer to see how many events you get. At least this will let me know if it is an issue with my setup as a starting point.

PS I am currently on release 280 but have had the issue on earlier releases (not that I think the HAH is the issue, I think its Gcal related but nobody else seems to be having any issues!)

Many thanks for reading and any help you can offer

 

Garry

derek
Offline
Glasgow, United Kingdom
Joined: 26 Oct 2009
I'll check

Hi Garry,

I'll setup a few events on my calendar and will see what I get. The HAH code in this area hasn't changed for some time ... I wonder if Google modified something behind the scenes.

Brett is the expert on 'things calendar' - but has no internet connectivity just now (perhaps down to Irene).

Cheers,
Derek.

derek
Offline
Glasgow, United Kingdom
Joined: 26 Oct 2009
Good for me

I setup a Google calendar entry and then used xFx viewer to catch the events. Looks pretty good ... regular messages coming thru. I am running the very latest beta release of the HAH firmware (Build 280.6). It might be worth giving this a shot.

 

Cheers,
Derek.

xFx viewer output

brett
Offline
Providence, United States
Joined: 9 Jan 2010
update to 281

Gary,

Do update to 281 I updated the gcal library to a later release which may help.

http://www.homeautomationhub.com/content/release-281

I'm still off line due to the hurricane and I slurp an internet connection at cafe's when I can.

Brett

garrydwilms
Offline
United Kingdom
Joined: 31 Mar 2011
Thanks
Thanks for your time guys as always. Derek, Good to hear all is fine for you, suggesting something amiss with my setup. I will do as Brett suggests and go to new beta and maybe also a fresh calendar and see what happens. Cheers Garry
BoxingOrange
Offline
United Kingdom
Joined: 11 Jun 2010
Calendar Issues

Hi Gary,

Did you manage to get this resolved?  I've had similiar problems in the past and have had another look at it again after updating everything to the latest version, 282, but I'm still having the same issues.  If you didn't get it resolved perhaps we could work together to try and resolve it?

 

Karl

garrydwilms
Offline
United Kingdom
Joined: 31 Mar 2011
Not tried yet!

Karl,

I have updated to 281 but spent most of my free time this week flashing the new code onto my AVR which was a bit more exciting than messing with google!. On a plus note, this has now been running for nearly two days and RF still stable so looks like job done on that front.

I will hopefully get to play with Gcal over weekend although I do have a family wedding to fit in also!.

Once I have had chance to assess I'll get back to you and definatley we should try to sort this together, athough you may regret that when you realise my knowledge of coding is practically zero :).

 

Will update soon, thanks

Garry.

BoxingOrange
Offline
United Kingdom
Joined: 11 Jun 2010
Progress

I'm pleased that the RF is stable, I know Brett put a lot of work into this so he'll be pleased.  I'll try GCal over the weekend and try to get a set of tests/results together so that we can see what's going on.

Don't worry about your coding skills, they sound about the same as mine, persistence and patience will see us win ;)

 

Karl

brett
Offline
Providence, United States
Joined: 9 Jan 2010
Happy about RF

Glad the RF is now stable - Karl worked hard on testing this and getting the new firmware solid and found quite a few coding mistakes I'd made. AVR v3.3 has not had any reports of a problem to date.

Lets see if we can figure out this google thing.  I've also been thinking about writing a scheduler that uses the google events but runs locally on the box in a slighly different way in which it currently works.  This would make the system more reliable and also if the internet went down events will continue to fire (unlike now).

I got a really nice .NET calendar framework that I used in a previous project that never took off and I'm itching to use it somehow.

Sadly I'm still time poor but at least my network connection has been restored... the bastards unplugged me at the pole.  Siting some old work order from the previous tenants when the disconnected their service.   Geeez!

Brett

BoxingOrange
Offline
United Kingdom
Joined: 11 Jun 2010
Scheduler

I like the idea of a local scheduler, if this can be synced/updated with GCal it would be VERY good.  Is there still enough space on the HAH filesystem for this type of development or will we all need to start looking at mounting an external filesystem soon?

Karl

brett
Offline
Providence, United States
Joined: 9 Jan 2010
libgcal 0.9.7

The version of the gcal library that I use is 0.9.6 (2010-09-07) however many changes and bug fixes have been made since then and they have version 0.9.7 on their main branch.  However this has not been placed as a download see their defect 87

They have a number of bugs that are important to the problems you are seeing.

== libgcal 0.9.7 (2011-06-15) ==
- support for recurrent events (patch by Thies Schroder)
- support for multiple calendars (patch by Julien Kerihuel)
- support for basically all calendar fields (patch by Mathieu Bonnet)
- multiple bug fixes (thanks to Bob Bell and others)

What I've done it downloaded the GIT branch for the latest version and created my own 0.9.7 distribution.

I've compiled this up as BETA 283.1 once they release a 0.9.7 I'll switch out my interim build.

In the meantime can you reflash and see if the problems persist, I'm still betting it was their bug.

Brett

BoxingOrange
Offline
United Kingdom
Joined: 11 Jun 2010
Persistent little .....

I've flashed to 283.1, my gcal update frequency is 60 seconds, and I have an event in GoogleCal running from Sat, 10 September, 18:30 – 19:30, the title is "RF 2 OFF", there is no description.

Here's the output from a debug session :-

# xap-googlecal -d 8 -i br0

Google Calendar Connector for xAP v12
Copyright (C) DBzoo 2009-2010
[inf][init.c:116:discoverBroadcastNetwork] br0: address 192.168.1.15
[inf][init.c:128:discoverBroadcastNetwork] br0: netmask 255.255.255.0
[inf][init.c:135:discoverBroadcastNetwork] Autoconfig: xAP broadcasts on 192.168.1.255:3639
[ntc][init.c:52:discoverHub] Broadcast socket port 3639 in use
[inf][init.c:53:discoverHub] Assuming a hub is active
[ntc][init.c:62:discoverHub] Socket port 3640 in use
[inf][init.c:64:discoverHub] Discovered port 3641
[dbg][timeout.c:18:xapAddTimeoutAction] Add timeout. interval=60
[dbg][init.c:201:xapAddSocketListener] socket=4
[inf][googlecal.c:455:main] Connecting to google
[inf][filter.c:34:xapAddFilter] section=xap-header key=target value=dbzoo.livebox.GoogleCal
[inf][filter.c:34:xapAddFilter] section=xap-header key=class value=google.calendar
[inf][filter.c:34:xapAddFilter] section=event key=title value=XAP_FILTER_ANY
[inf][filter.c:34:xapAddFilter] section=event key=start value=XAP_FILTER_ANY
[inf][filter.c:195:xapAddFilterAction] section=event key=start value=XAP_FILTER_ANY data=0
[dbg][timeout.c:18:xapAddTimeoutAction] Add timeout. interval=60
[dbg][timeout.c:18:xapAddTimeoutAction] Add timeout. interval=60
[dbg][googlecal.c:196:googlePeriodEventCheck] Google query params: start-min=2011-09-10T19:10:00Z&start-max=2011-09-10T19:11:00Z&singleevents=true
[dbg][googlecal.c:200:googlePeriodEventCheck] Google returns no events
[inf][tx.c:19:xapSend] send
xap-hbeat
{
v=12
hop=1
uid=FF00DA00
class=xap-hbeat.alive
source=dbzoo.livebox.GoogleCal
interval=60
port=3641
pid=190
}

[dbg][rx.c:23:readXapData] Rx xAP packet
xap-hbeat
{
v=12
hop=1
uid=FF00DA00
class=xap-hbeat.alive
source=dbzoo.livebox.GoogleCal
interval=60
port=3641
pid=190
}

 

I'm getting heartbeats but no events.

 

Karl

garrydwilms
Offline
United Kingdom
Joined: 31 Mar 2011
Yeah I also still have issues (on 283.1)

I have updated to 283.1 and set a 1hr event up from 09:42 to 10:42. Title "rf 1 off" and Location "xap", description empty.

I got fairly regular events for the first 5 minutes then started to miss some as shown below.

debug info for the period where no events were generated shows identical results to Karl,

[dbg][googlecal.c:196:googlePeriodEventCheck] Google query params: start-min=2011-09-11T09:51:00Z&start-max=2011-09-11T09:52:00Z&singleevents=true
[dbg][googlecal.c:200:googlePeriodEventCheck] Google returns no events

but then at 09:54 results appear again, all this is from the same 1hr long event.

I will try next with several seperate 1 min long events and see what happens,

Thanks,

Garry.

 

garrydwilms
Offline
United Kingdom
Joined: 31 Mar 2011
283.1 and v3.4 avr issues

Totally unrelated to this topic but just noticed that communication with the hardware seems broken with the versions of firmware and avr shown above. no rf commands or 1 wire temps.

I've had to revert to 283 and 3.4 for now.

thanks

 

Garry

BoxingOrange
Offline
United Kingdom
Joined: 11 Jun 2010
Progress

I think I've managed to move forward with the issue, but not a solution.  I'm certain the issues is to do with timezones.

1.  The /etc/TZ file - In this post http://www.homeautomationhub.com/content/british-summer-time Brett is suggesting GMT0BST-1, I can't get this to work.

2. GoogleCal can also set a timezone, for the UK it defaults to (GMT +00:00) London, this doesn't work. 

3. I've noticed that if you refresh the HAH web GUI straight after a reboot the timezone changes between UTC and BST a few times, it then settles down to UTC.

As Brett has already said, I think it's a matter of getting the right timezones set. 

Derek, as your system is working could you post the contents of your /etc/TZ file and the timezone your GoogleCal is set to.  It would also be helpful to know what the web GUI is showing and comparing that to the results of the date command from a telnet session.

This is proving to be a right pain.

derek
Offline
Glasgow, United Kingdom
Joined: 26 Oct 2009
What's the Frequency, Garry?

If you are compiling our sketch & flashing your own AVR, you did remember to create a 'Board' in the Arduino environment with the correct frequency?

If not, the baud rate calc on the comms between the HAH and the PCB will be wrong. (We don't use the default 16MHz 'cos the link needs to run at 115200baud).

At first, it might 'look' as if it is working as the chip will send an initial message to the LCD (speed on this is not critical).

Derek.

BoxingOrange
Offline
United Kingdom
Joined: 11 Jun 2010
Testing

I haven't tested this combination yet.  Are you saying it's totally broken, ie not working after a reboot, or it breaks after a bit of time?   I should be able to test it later today, but I was hoping to resolve the GCal stuff first.

Perhaps best to start a new thread with the answers to my questions.

BoxingOrange
Offline
United Kingdom
Joined: 11 Jun 2010
More Progress

Here's a combination that I'm having some success with :-

GoogleCal timezone set to its defaults to (GMT +00:00) London <- I don't think this should be changed

/etc/TZ set to GMT0+1 <- We need to get this right

This does make all the times wrong on the HAH, both web and command line, BUT GoogleCal event DO work.

Any thoughts anyone?

Karl

derek
Offline
Glasgow, United Kingdom
Joined: 26 Oct 2009
My config

I have no /etc/TZ file.

My Google Calendar is set to '(GMT+00:00) London' - I only have one Google Calendar.

On the HAH ...

# date
Sun Sep 11 10:50:37 UTC 2011

... and on the Web UI

Time info

 

Derek.

 

BoxingOrange
Offline
United Kingdom
Joined: 11 Jun 2010
Confirmation

Can you confirm that the date and Web UI are the correct local time, I suspect they are 1 hour behind.

I'm at a point now that a /etc/TZ file containing GMT0+1 or no /etc/TZ file at all will enable xap-googlecal to find events, but NOT consistently.  I'm going to setup a series of consecutive events to see which ones get processed and try and find a pattern.

derek
Offline
Glasgow, United Kingdom
Joined: 26 Oct 2009
One hour behind

Local time here in Scotland is indeed one hour ahead of that shown on my web UI. I don't bother to adjust my HAH for BST. When the hour changes, the timing of events on GCal can be tweaked at the same time as I reset clocks & timers around the house.

Derek.

garrydwilms
Offline
United Kingdom
Joined: 31 Mar 2011
time zone settings

I do remeber playing with these previously but could not get the TZ file to work.

As you say the GUI is correct for a while then changes back to be an hour out after a short period of time, I then had to schedule google cal events an hour in advance of when I wanted them to get the to register.

I am therefroe now setup the same as Derek. This allows Google cal to see the events but sporadically as you have seen yourself and my HAH is an hour out during BST.

I will post seperatly re my 283.1 issues

 

 

Hardware Info