OH1 OwnTracks... not getting anywhere

I personally am running 1.8.3. Sounds like Fredrik has got his issue sorted. Since you have proven that your MQTT broker is receiving those messages I think the only thing left is your item config (but I am not sure what).

Can you post your full items config currently? I would suggest paring it right back to a single Switch item to remove any confusion and see if we can make any progress with that.

… was only asking… :slight_smile:

.sitemap

        Switch item=GeoLoc_MaxHome	icon="present"

.items

Switch   GeoLoc_MaxHome		"Max @ Home [%s]"		{mqttitude="mosquitto:owntracks/owntracks/maxg-iphone/event:Home"}

logback.xml

<logger name="org.openhab.binding.mqttitude" level="TRACE" />

no entry related to mqttitude in openhab.conf
mosquitto (has been and) is running nicely
mqttitude does not seem to process the messages.

After reducing the items config to one switch, I rebooted the rPi (just to be sure)

On a side note: if you have 1.8.3 running, why not check the log level by adding TRACE to the logger, and see, what the outcome of openhab.log is. Even if I set it to TRACE it says DEBUG in the log. (The same with the EXEC and Yahoo weather binding); so I doubt that the openhab.log will show TRACE as a word; whether this affects its inner working; e.g. whether it does actually do TRACE I cannot tell.

In any case, thank you for your continued help with this issue.

@westermarck: As you can see in a previous post, I have done exactly the same. In my case (as I suspect in yours) mosquitto is working. But the mqttitude binding, despite subscribing to the OwnTracks topic does not seem to process any of it.

And you are still seeing the mqttitude debug message that it is subscribing to the appropriate topic?

yes…

2017-01-18 07:54:27.398 [INFO ] [penhab.io.rest.RESTApplication] - Stopped REST API
2017-01-18 07:55:03.650 [INFO ] [.o.core.internal.CoreActivator] - openHAB runtime has been started (v1.8.3).
2017-01-18 07:55:08.763 [INFO ] [o.o.i.s.i.DiscoveryServiceImpl] - mDNS service has been started
2017-01-18 07:55:09.003 [INFO ] [o.o.i.s.i.DiscoveryServiceImpl] - Service Discovery initialization completed.
2017-01-18 07:55:09.025 [INFO ] [.io.transport.mqtt.MqttService] - MQTT Service initialization completed.
2017-01-18 07:55:09.030 [INFO ] [o.i.t.m.i.MqttBrokerConnection] - Starting MQTT broker connection 'mymosquitto'
2017-01-18 07:55:18.396 [INFO ] [penhab.io.rest.RESTApplication] - Started REST API at /rest
2017-01-18 07:55:23.961 [INFO ] [.o.u.w.i.servlet.WebAppServlet] - Started Classic UI at /classicui/openhab.app
2017-01-18 07:55:26.686 [INFO ] [c.internal.ModelRepositoryImpl] - Loading model 'max01.items'
2017-01-18 07:55:27.326 [INFO ] [c.internal.ModelRepositoryImpl] - Loading model 'lights.items'
2017-01-18 07:55:27.522 [INFO ] [c.internal.ModelRepositoryImpl] - Loading model 'groups.items'
2017-01-18 07:55:27.666 [INFO ] [c.internal.ModelRepositoryImpl] - Loading model 'openings.items'
2017-01-18 07:55:29.441 [DEBUG] [.m.internal.MqttitudeActivator] - Mqttitude binding has been started.
2017-01-18 07:55:29.504 [DEBUG] [.b.m.internal.MqttitudeBinding] - Registering Mqttitude consumer for owntracks/owntracks/maxg-iphone/event (on mosquitto)
2017-01-18 07:55:29.507 [DEBUG] [.b.m.internal.MqttitudeBinding] - Activating Mqttitude binding
2017-01-18 07:55:29.728 [INFO ] [.b.a.internal.bus.AstroBinding] - AstroConfig[latitude=-27.3164855,longitude=152.3701568,interval=60,systemTimezone=Austral$
2017-01-18 07:55:29.742 [INFO ] [.p.rrd4j.internal.RRD4jService] - Removing invalid defintion component = null heartbeat = 0 min/max = 0.0/0.0 step = 0 0 ar$
2017-01-18 07:55:29.905 [INFO ] [c.internal.ModelRepositoryImpl] - Loading model 'logging.persist'
2017-01-18 07:55:30.024 [INFO ] [c.internal.ModelRepositoryImpl] - Loading model 'mapdb.persist'
2017-01-18 07:55:30.064 [INFO ] [c.internal.ModelRepositoryImpl] - Loading model 'db4o.persist'
2017-01-18 07:55:30.105 [INFO ] [c.internal.ModelRepositoryImpl] - Loading model 'rrd4j.persist'
2017-01-18 07:55:30.659 [INFO ] [c.internal.ModelRepositoryImpl] - Loading model 'exec.persist'
2017-01-18 07:55:30.808 [WARN ] [o.p.m.i.MqttPersistenceService] - mqtt-persistence:broker
2017-01-18 07:55:30.812 [WARN ] [o.p.m.i.MqttPersistenceService] - mqtt-persistence:topic
2017-01-18 07:55:30.815 [WARN ] [o.p.m.i.MqttPersistenceService] - mqtt-persistence:message
2017-01-18 07:55:31.285 [INFO ] [o.o.b.w.i.common.WeatherConfig] - LocationConfig[providerName=YAHOO,language=en,updateInterval=10,latitude=<null>,longitude$
2017-01-18 07:55:32.750 [INFO ] [.b.a.internal.job.JobScheduler] - Scheduled a daily job at midnight for astro calculation
2017-01-18 07:55:32.765 [INFO ] [.b.a.internal.job.JobScheduler] - Scheduled astro job with interval of 60 seconds

I am at a loss then sorry :frowning:

That’s OK… appreciate your help…

Will move to plan B – calculating the distance, etc via captured mosquitto strings and rules :slight_smile:

Maybe you (or someone else) can clarify one thing:
If logging is set to TRACE (n logbakc.xml), does it show as TRACE or DEBUG in the openhab.log?

I am close to 100% certain it will be shown as TRACE.

It is a shame, as this binding has been working flawlessly for me for years. Can’t understand why you are having such troubles!

Have you tried to do what I did in the mqttitude.conf in order for it to pick up the configuration changes?

I removed the values (commenting them out is not the same). I ended up with a mqttitude.conf that only contains the following:

home.lat=
home.lon=
geofence=

Be aware you are on OH 2 and I am on OH1 = different binding versions.
I did the mosquitto item and it works…
… and have no entries related to mqttitude in the openhab.conf
But why not; will try the empty entries :slight_smile:

@ben_jones12: don’t stress about it; I feel you’ve done the best you could…
sometimes there things beyond what we see…

OK, added the mqttitude section in openhab.conf with uncommented parameters and leaving them ‘empty’… result:

after restart with mqttitude empty values
2017-01-18 10:32:47.913 [INFO ] [.io.transport.mqtt.MqttService] - MQTT Service initialization completed.
2017-01-18 10:32:47.918 [INFO ] [o.i.t.m.i.MqttBrokerConnection] - Starting MQTT broker connection 'mymosquitto'
2017-01-18 10:33:07.715 [DEBUG] [.m.internal.MqttitudeActivator] - Mqttitude binding has been started.
2017-01-18 10:33:07.777 [DEBUG] [.b.m.internal.MqttitudeBinding] - Registering Mqttitude consumer for owntracks/owntracks/maxg-iphone/event (on mosquitto)
2017-01-18 10:33:07.780 [DEBUG] [.b.m.internal.MqttitudeBinding] - Activating Mqttitude binding
2017-01-18 10:33:07.785 [DEBUG] [.b.m.internal.MqttitudeBinding] - Mqttitude binding configuration updated, no 'home' location specified. All item bindings must be configured with a <region>.
2017-01-18 10:33:07.792 [DEBUG] [.b.m.internal.MqttitudeBinding] - Unregistering Mqttitude consumer for owntracks/owntracks/maxg-iphone/event (on mosquitto)
2017-01-18 10:33:07.802 [DEBUG] [.b.m.internal.MqttitudeBinding] - Registering Mqttitude consumer for owntracks/owntracks/maxg-iphone/event (on mosquitto)
2017-01-18 10:33:08.974 [WARN ] [o.p.m.i.MqttPersistenceService] - mqtt-persistence:broker
2017-01-18 10:33:08.975 [WARN ] [o.p.m.i.MqttPersistenceService] - mqtt-persistence:topic
2017-01-18 10:33:08.977 [WARN ] [o.p.m.i.MqttPersistenceService] - mqtt-persistence:message

msoquitto log:

1484699546: Socket error on client openhab, disconnecting.
1484699568: New connection from 127.0.0.1 on port 1883.
1484699568: New client connected from 127.0.0.1 as openhab (c1, k60).
1484699760: New connection from ::1 on port 1883.
1484699760: New client connected from ::1 as mosqpub/14933-rpiautoma (c1, k60).
1484699760: Client mosqpub/14933-rpiautoma disconnected.
1484699793: New connection from ::1 on port 1883.

… in essence no change, and no TRACE messages or further DEBUG messages when publishing the owntracks messages…

I say: let’s give it a rest… and I do Plan B :slight_smile:

Hang on - your item binding is using mosquitto as the broker name, but it looks like the MQTT binding is named mymosquitto in your log above?

1 Like

I do not understand the inner workings of OH or mqtt… but the mosquitto.log shows and entry at epoch 1484699760 (18 January 2017 10:36:00 GMT+10:00) connecting and disconnecting a mosqoub on rpiAutomation… could this a problem.
I did not define this name; so it must be auto assigned??
Is this relevant?

Can you try…

Switch   GeoLoc_MaxHome		"Max @ Home [%s]"		{mqttitude="mymosquitto:owntracks/owntracks/maxg-iphone/event:Home"}

Well… we crossed posts… and I did it again; embarrassed myself to the max!
When I noted the entry in the mosquitto.log I went checking; I usually copy existing working bits and modify them (to avoid typos); the entries were:

Switch   GeoLoc_MaxHome		"Max @ Home [%s]"		{mqttitude="mosquitto:owntracks/owntracks/maxg-iphone/event:Home"}
//String mqttitudeTest "mqttitudeTest [%s]"			{mqtt="<[mymosquitto:owntracks/owntracks/maxg-iphone/event:state:default]"}

and should be

Switch   GeoLoc_MaxHome		"Max @ Home [%s]"		{mqttitude="**my**mosquitto:owntracks/owntracks/maxg-iphone/event:Home"}
//String mqttitudeTest "mqttitudeTest [%s]"			{mqtt="<[mymosquitto:owntracks/owntracks/maxg-iphone/event:state:default]"}

as usual, copying these to the other itesm home2 home3 we had at the beginning, I copied the mistake, hence the thing does not work.

I do apologise, and at the same time thank you @ben_jones12 in particular!
The learning: go with a comb over each word (literally) before posting!

Just to state the obvious for the record: mqttitude works!

Happy days! And don’t feel too bad, you are not the first and won’t be the last to comb over such a simple mistake (I myself have done it many times in the past!).

Just glad we got it working.

2 Likes

For completeness sake: I can now confirm seeing TRACE messages as TRACE in the openhub.log.

The following can be seen in the openhab.log with logging set to TRACE when receiving an Owntracks command:

2017-01-18 10:57:48.199 [TRACE] [b.m.internal.MqttitudeConsumer] - Message received on topic owntracks/owntracks/maxg-iphone/event: {"desc":"Home","t":"c","tst":1484616290,"acc":50,"lon":152.3871252314675,"_type":"transition","wtst":1484570767,"lat":-27.32542779299181,"event":"leave","tid":"MG"}
2017-01-18 10:57:49.231 [TRACE] [b.m.internal.MqttitudeConsumer] - Checking item GeoLoc_MaxHome...
2017-01-18 10:57:49.233 [DEBUG] [b.m.internal.MqttitudeConsumer] - GeoLoc_MaxHome has left region Home
2017-01-18 10:58:12.255 [TRACE] [b.m.internal.MqttitudeConsumer] - Message received on topic owntracks/owntracks/maxg-iphone/event: {"desc":"Home","t":"c","tst":1484616288,"acc":30,"lon":152.3707630859244,"_type":"transition","wtst":1484570767,"lat":-27.31735945681791,"event":"enter","tid":"MG"}
2017-01-18 10:58:12.287 [TRACE] [b.m.internal.MqttitudeConsumer] - Checking item GeoLoc_MaxHome...
2017-01-18 10:58:12.289 [DEBUG] [b.m.internal.MqttitudeConsumer] - GeoLoc_MaxHome has entered region Home

I strongly hope this threat will provide (at least) some guidance to someone encountering a problem with mqttitude 1.8.3!

Hey @Max_G, how do you convert mosquitto log epoch to real time (date, hour…) ?

thanks!

Haven’t done it – was actually thinking about the same today…
Try: Display/Convert Epoch as DateTime
or: Converting Unix Timestamp into DateTime item

Hi Max_G
did you solve this issue with events and owntracks?

Well, it is working… get OwnTracks GPS data via iPhone -> hole in firewall for port 1883; and an see the track in OwnTracks web… but have not done anything further with OH.

1 Like