scanno / nl.scanno.mqttbroker

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Owntracks Client hit and miss since this week

BBEHannes opened this issue · comments

Hello,

Not sure if this is the right place to post the issue but on the Owntracks Client page i cannot create an issue... sorry if this is the wrong topic.

I have been a very happy user of MQTT Broker and Owntracks Client on Homay for almost a year. In that time I have had 0 wrong geo location misses.
However, starting from this week I have had strange problems. Sometimes I see myself returning home even though I am already home and another time i see no message when I leave, whilst my partner's phone (in the same car as mine) is correctly showing going out of the Home zone at the exact same time. Not sure what has been updated but I'd appreciate looking into it.

One of the strange issues from the logs (when everyone is at home and has not moved from the couch in a while);

Here we see that the geo location is still\already set to "Home"

20181223-00:23:53 getUserArray called
20181223-00:23:57 getLogLines called
20181223-00:24:28 OnMessage called
20181223-00:24:28 received '{"batt":100,"lon":xxxx,"acc":1924,"p":xxxx,"vac":13,"inregions":["Home"],"lat":xxxx,"conn":"w","tst":xxx,"alt":-2,"_type":"location","tid":"br"}' on 'owntracks/Bas/bas'
20181223-00:24:28 We have received a location message
20181223-00:24:28 Set battery percentage for Bas to 100%
20181223-00:24:28 inregions: Home
20181223-00:24:28 region Home
20181223-00:24:43 getUserArray called
20181223-00:24:54 getUserArray called
20181223-00:24:58 getLogLines called
20181223-00:25:58 OnMessage called

\

Then, a couple of minutes later, almost same lon\lat and for a strange reason it starts setting me to "Home" anyway (no other related logs in between this time);

20181223-00:31:52 OnMessage called
20181223-00:31:52 received '{"batt":100,"lon":xxxx,"acc":65,"p":xxxx,"vac":10,"inregions":["Home"],"lat":xxxx,"conn":"w","tst":xx,"alt":-2,"_type":"location","tid":"br"}' on 'owntracks/Bas/bas'
20181223-00:31:52 We have received a location message
20181223-00:31:52 Set battery percentage for Bas to 100%
20181223-00:31:52 inregions: Home
20181223-00:31:52 region Home
20181223-00:31:52 isAccurate
20181223-00:31:52 Listener enterGeofence_AC called
20181223-00:31:52 state.topic = owntracks/Bas/bas topic = undefined
20181223-00:31:52 received user Bas trigger user: Bas
20181223-00:31:52 Received Fence = Home trigger fence = Home
20181223-00:31:52 triggerFence = equal
20181223-00:31:52 Listener enterGeofence_AC called
20181223-00:31:52 state.topic = owntracks/Bas/bas topic = undefined
20181223-00:31:52 received user Bas trigger user: Jurjen
20181223-00:33:23 OnMessage called
20181223-00:33:23 received '{"tst":"xx","_type":"lwt"}' on 'owntracks/Bas/bas'
20181223-00:33:30 getLogLines called
20181223-00:33:46 getUserArray called
20181223-00:33:49 getLogLines called

Again, this also has hit and misses when leaving where it doesn't register. It worked flawlessly until this week.

Hope you can assist.

Hmm. I implemented a fallback just in case enter / leave events were missed. Seems its backfiring in some situations.

Thanks for the swift response!

Never had any misses before :). Indeed looks like a possible cause. Anything i can do to assist/provide additional logging?

Hope you can fix it :).

You know how to install a app from the commandline?
I mean download from github and install manually?

Oh and i did not realise that issues was turned of in the owntracks repo. Its turned on now.

Unfortunately I have not gotten any experience with installing from the command line. Of course, feel free to enlighten me.

Ps; I just arrived home and it worked properly, however what I noticed is that the "fence" in the Owntracks Client under User Data does not show either of the users as "Home".

Even though the broker shows the fencing is working properly and transitioning the user to Home;

20181223-15:53:05 Packet published {"t":"c","tst":xxxx,"acc":xxxx,"_type":"transition","event":"enter","lon":xxxx,"lat":xxxxx,"wtst":xxxx,"tid":"JL","desc":"Home"}

And a couple of hours later it sets the "Fence" to Home successfully with another transition state mentioned above.
I think this might be it; It doesn't change the actual Fence state to Home initially even though the geo tracking works properly and tracing shows it entered the Home location properly. I can totally imagine that if the “fence” was not updated to “Home” in the Owntracks Client app, it will not see when someone is leaving because for the app it never officially marked me Home in the first place.

Does this help in pinpointing :)?

depends... The acc field contains the accuracy of the GPS fix. If that is larger then the value you specified in settings, it will be ignored. This was done to prevent accidental triggers due to location drifting.

So if the first event had a bad accuracy and the second event an acceptable one, then that would be the explanation

So where does it get the transition Home state from then as in the logs per above? Apparently it is something different than what the app fence sees as home?

Fact is that I can see myself arriving as per the logs (and the owntracks “enter geofence card” is triggered too) but the application doesn’t say that I am in the “home” fence...?

Anyway, I had it set to 200M but changed it to 300 this week to see if that mattered due to the problems seen. Unfortunately no difference.

Another finding. I was at home, fence also set to "home". And then all of a sudden I noticed it removed the "Home" Fence but never triggered the "Leave Geofence Trigger". This is what the logs say;

20181223-21:18:10 received '{"tst":xxx,"acc":65,"_type":"location","alt":-2,"lon":xxxx,"vac":10,"p":xxx,"lat":xxx,"batt":42,"conn":"w","tid":"JL"}' on 'owntracks/Jurjen/Jurjen'
20181223-21:18:10 We have received a location message
20181223-21:18:10 Set battery percentage for Jurjen to 42%
20181223-21:18:10 handleLocationMessage - no inregions field, fence = Home
20181223-21:18:10 generateLeaveEvent - for Jurjen
20181223-21:18:10 Listener leaveGeofenceAC called
20181223-21:18:10 state.topic = owntracks/Jurjen/Jurjen topic = undefined
20181223-21:18:10 received user Jurjen trigger user: Jurjen
20181223-21:18:10 Received Fence = trigger fence = Home
20181223-21:18:10 Listener leaveGeofenceAC called
20181223-21:18:10 state.topic = owntracks/Jurjen/Jurjen topic = undefined
20181223-21:18:10 received user Jurjen trigger user: Bas
20181223-21:19:08 getUserArray called
20181223-21:19:12 getLogLines called
20181223-21:19:25 getUserArray called
20181223-21:19:29 getLogLines called

Again, this never triggered the Leave Geofence Trigger card but it removed the "Home" fence from the App.

Made the change i made regarding the location messages optional in version 2.2.2 of Owntracks and is pending approval. Please let me know if that solves the issue.

Couldn’t have asked for a better Christmas gift, thanks a bunch :)!!!

Version 2.2.2 is published

Thanks! Installed and by default the check box is unchecked, which in my case should be perfect :)!

Ps, what is this other new option (in seconds.. and then blank)? Anything I need to configure? Can’t really see any place that explains the release notes like other apps have.

Thanks Santa!

That field is for setting the keepalive timeout. Its 60 seconds by default. Some people have problems with CloudMQTT dropping the connection. Seems like on some homeys the keepalive signal does not get send (or too late) causing the MQTT broker to disconnect. Setting a higher number of seconds can reduce the chance of this happening.

As per update; Up until now everything is as solid as it was before 2.2.1 :)! Keeping you posted if anything changes.

Thanks!