Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Can't see friends #610

Closed
djboardman opened this issue Nov 30, 2019 · 39 comments
Closed

Can't see friends #610

djboardman opened this issue Nov 30, 2019 · 39 comments

Comments

@djboardman
Copy link

Hi

I've done two installs of Mosquitto on raspberry pi, one from repository and one with a docker image. I have installed OwnTracks on 3 iPhones and connected the iPhones with 3 different users.

I can see messages coming from all 3 iPhones and MQTTInspector subscribes to owntracks/+/+ and can see messages from all three users.

But in the OwnTracks app on the 3 phones I don't get a list of friends, it only seems to see the logged in user's messages

In the latest install of Mosquitto I have no user passwords, ACL or TLS to see if I could get it working

My conf file just says:

persistence true
persistence_location /mosquitto/data/
log_dest file /mosquitto/log/mosquitto.log

I have a static IP address for the pi, port forwarding on 1883, and DuckDNS for dynamic dns

Is there any trouble shooting steps that I can take to see why the OwnTracks apps appear to only subscribe to their own user topic?

Or anything obvious in the set up I can check?

Thanks

@jpmens
Copy link
Member

jpmens commented Nov 30, 2019

I assume other than simple setup of host/port, user and device name, that you've done no customizing on the phones. I also assume, as you say MQTTinspector that these are iOS devices.

What I would do is use a command line to connect to your Mosquitto broker:

mosquitto_sub -v -t '#' -h ip-address-of-broker

(Note the # in quotes.)

When your phones publish (by hitting the up-arrow in the app) you should see their payloads. Verify that the topics shown (-v does this in the subscribe) match what you think they should be, e.g. owntracks/username/devicename and the payload should be JSON.

If you see all three phones that way, and the topics all begin with owntracks/ then we're good to go and the phones should see eachother.

In order to verify the subscription on the iOS phones, please go to the Settings screen (tap on (I)). Tap three times in the area marked "Status" and that will open the advanced settings.

Therein you should see subtopicBase; what's that set to?

@djboardman
Copy link
Author

djboardman commented Nov 30, 2019

Thanks for coming back so quickly...

The set up I've done on the phones is user and device name, I set my host, changed port to 1883, turned off TLS and turned off Authentication.

MQTTInspector is running on one of the same phones which is not connected to my wi fi

Mosquitto_sub is showing messages from two users (plus I've also set up a test user on on my iPad):

[redacted for privacy reasons by jpmens]

subTopicBase is set to:
owntracks/+/+ owntracks/+/+/event owntracks/+/+/info owntracks/david/iphone/cmd

Thanks

Dave

@jpmens
Copy link
Member

jpmens commented Nov 30, 2019

The payloads are sane and the publishes are as expected and are arriving at your broker from which it (the broker) will distribute each of the publishes to all devices subscribed to the topics. Your subTopicBase is correctly set to owntracks/+/+ (and others) which means these devices will get the messages.

I'm speaking out loud as a sort of check list -- ignore me. :-)

One thing's left to do: please swipe out (though I usually warn against that) the app on, say the iPad, and open OwnTracks on it again. Do your "friends" then appear?

@jpmens
Copy link
Member

jpmens commented Nov 30, 2019

Please show the content of the logfile at /mosquitto/log/mosquitto.log from the moment that iPad connects. (I've removed your MQTT payloads above to protect your privacy.)

@djboardman
Copy link
Author

djboardman commented Nov 30, 2019

I've swiped the iPad app out a couple of times

From the log when the iPad reconnects

1575118362: New connection from xx on port 1883.
1575118362: New client connected from xx as testuseripad (p2, c0, k60).

Thanks

Dave

@jpmens
Copy link
Member

jpmens commented Nov 30, 2019

Please add this to your mosquitto.conf and restart mosquitto:

connection_messages true
log_dest topic
log_type error
log_type warning
log_type notice
log_type information
log_type all
log_type debug
log_timestamp true

Then redo the iPad swipe thing.

@djboardman
Copy link
Author

djboardman commented Nov 30, 2019

Hi

Here's the new log with the iPad and iPhone (and you I think!)

1575120009: New connection from xx on port 1883.
1575120010: New client connected from xx as testuseripad (p2, c0, k60).
1575120010: Will message specified (32 bytes) (r0, q1).
1575120010: 	owntracks/testuser/ipad
1575120010: Sending CONNACK to testuseripad (1, 0)
1575120015: Received PUBLISH from testuseripad (d0, q1, r1, m2, 'owntracks/testuser/ipad', ... (184 bytes))
1575120015: Sending PUBACK to testuseripad (m2, rc0)
1575120034: New connection from xx on port 1883.
1575120034: New client connected from xx as davidiphone (p2, c0, k60).
1575120034: Will message specified (32 bytes) (r0, q1).
1575120034: 	owntracks/david/iphone
1575120034: Sending CONNACK to davidiphone (1, 0)
1575120040: Received PUBLISH from davidiphone (d0, q1, r1, m2, 'owntracks/david/iphone', ... (186 bytes))
1575120040: Sending PUBACK to davidiphone (m2, rc0)
1575120070: Received PINGREQ from testuseripad
1575120070: Sending PINGRESP to testuseripad
1575120076: Received PINGREQ from lens_XaB3ychc9wed9csHG1sA1QnbEIu
1575120076: Sending PINGRESP to lens_XaB3ychc9wed9csHG1sA1QnbEIu

@jpmens
Copy link
Member

jpmens commented Nov 30, 2019

Definitely not I ! the client lens_X... you are seeing is likely on your network.

@djboardman
Copy link
Author

Ah yes, I've got MQTT lens browser plugin!!!

@jpmens
Copy link
Member

jpmens commented Nov 30, 2019

Could you export the OwnTracks configuration from the iPad and send it to us at support@owntracks.org please? Together with your mosquitto.conf file.

@djboardman
Copy link
Author

Email sent. Thank you very much for your help with this

@jpmens
Copy link
Member

jpmens commented Nov 30, 2019

Do me another favor please: show me the mosquitto.log when you publish a position on your phone with the iPad connected as well.

@djboardman
Copy link
Author

djboardman commented Nov 30, 2019

Is it this?

1575121631: Received PUBLISH from testuseripad (d0, q1, r1, m3, 'owntracks/testuser/ipad', ... (186 bytes))
1575121631: Sending PUBACK to testuseripad (m3, rc0)
1575121634: Received PINGREQ from testuseripad
1575121634: Sending PINGRESP to testuseripad
1575121634: New connection from xx on port 1883.
1575121634: New client connected from xx as davidiphone (p2, c0, k60).
1575121634: Will message specified (32 bytes) (r0, q1).
1575121634: 	owntracks/david/iphone
1575121634: Sending CONNACK to davidiphone (1, 0)
1575121636: Received PINGREQ from lens_XaB3ychc9wed9csHG1sA1QnbEIu
1575121636: Sending PINGRESP to lens_XaB3ychc9wed9csHG1sA1QnbEIu
1575121640: Received PUBLISH from davidiphone (d0, q1, r1, m6, 'owntracks/david/iphone', ... (187 bytes))
1575121640: Sending PUBACK to davidiphone (m6, rc0)
1575121694: Received PINGREQ from testuseripad

@jpmens
Copy link
Member

jpmens commented Nov 30, 2019

Your two clients are connecting to the broker but are definitely not "talking" to eachother. Two more things please, before I lean back and think this through :-)

  1. which version of Mosquitto are you running? You said above you'd done two installs, one from repo and another from Docker. Are you running the repo version now?
  2. The Mosquitto persistence directory is configured as /mosquitto/data/. Would you please show me the output of ls -la /mosquitto/data/ ?

@djboardman
Copy link
Author

I'm using version 1.6.7 of Mosquitto from the docker image eclipse-docker

Here is my mosquitto/data directory which is mounted as a volume on the docker container:

total 12
drwxr-xr-x 2 1883 1883 4096 Nov 30 13:49 .
drwxr-xr-x 5 1883 1883 4096 Nov 29 22:23 ..
-rw------- 1 1883 1883  986 Nov 30 13:49 mosquitto.db

@jpmens
Copy link
Member

jpmens commented Nov 30, 2019

@ckrey I need your help, please.

I see neither Received SUBSCRIBE from the devices connecting to the broker, nor do we see Received PUBLISH when the iPad publishes to the iPhone and vice versa. Permissions on files look ok to me (I'm assuming mosquitto in the Docker container is running as user 1883 but that's likely irrelevant).

@jpmens jpmens transferred this issue from owntracks/talk Nov 30, 2019
@ckrey
Copy link
Member

ckrey commented Nov 30, 2019

pls check the sub setting in your config.
In one of the older versions there was a misspelling, which has now been corrected.
Either export sertings or tap 3 times on status screen to see and edit it.

@jpmens
Copy link
Member

jpmens commented Nov 30, 2019

@ckrey we've checked that:

"subTopic" : "",
"sub" : false,

@jpmens
Copy link
Member

jpmens commented Nov 30, 2019

@djboardman let's try setting that subTopicBase explicitly on your phone. In settings, three taps (you've been there), and then enter this as a single string into that field please (one space separates each topic):

owntracks/+/+ owntracks/+/+/event owntracks/+/+/info owntracks/david/iphone/cmd

Then, again looking at your mosquitto.log, swipe out the app on the iPhone and restart the app. Then, with the iPhone app open, open the iPad and hit publish please.

@ckrey
Copy link
Member

ckrey commented Nov 30, 2019

"sub": false means the client does not subscribe. Please change

@jpmens
Copy link
Member

jpmens commented Nov 30, 2019

@ckrey then we have a problem somewhere ... My own phone has "sub" : false, configured and I'm receiving updates

Sending PUBLISH to jpm-5s-t (d0, q1, r0, m28498, 'owntracks/qtri ...

However, my own subTopicBase is explicitly filled in.

@jpmens
Copy link
Member

jpmens commented Nov 30, 2019

@djboardman I think we've nailed the issue, and apologies that it took so long. I've been talking to @ckrey and have tested accordingly:

The value of sub in your devices is set to false as per the configuration you sent us. This should be set to true please which will cause the apps to SUBSCRIBE to the broker and receive messages published by friends.

In the past, the default for sub was unintentionally set to false when exported / reimported. I cannot say why you switch is disabled (unless you are a long-time user :-)

@djboardman
Copy link
Author

djboardman commented Nov 30, 2019

Success! At least with my iPhone. It took a while but after I switched Sub to “On” I can now see the other devices in Friends

I’ll try it on the iPad and other iPhones.

These devices have all been installed with Owntracks only since Wednesday and all came with Sub set to “Off” - I’d never used Owntracks before this week or did any export / import of config.

Hopefully with the changed settings Friends will start to appear on the other devices as well.

@jpmens and @ckrey thank you for you help with this

@jpmens
Copy link
Member

jpmens commented Nov 30, 2019

Glad you got it working, and sorry that you caught us with that bug.

If you swipe your apps out and have them reconnect you ought to quickly see your friends on them. Please do note that this whole swipe-out thing should be done for testing only; generally it is not recommended at all to swipe out apps on iO.

@bodomenke
Copy link

Dear all, I just stumbled into this discussion via Google search, because I have the same issue like @djboardman.

I have a mosquitto version 1.3.5 running since years - not config change over there - and just reinstalled my Owntracks clients on iOS. Out of a sudden my friends where gone, while I still see their messages, when I connect to mosquito via MQTT Explorer (Mac)...

I understand that there is an issues with Sub set to False. I testwise exported by Owntracks config and saw indeed that Sub is set to false.
I never used Export/Import Settings before for my OwnTracks config. So I am wondering how my Owntracks client could get the wrong Sub configuration.

Anyhow, I will now change the Sub to True an re-import the settings. Let's see, if it works afterwards.

@bodomenke
Copy link

Success. This worked out after wiping Owntracks, reinstalling and reimporting the config with Sub set to True. Thank you all for fiddling this out. Bodo

@jpmens
Copy link
Member

jpmens commented Dec 11, 2019

@bodomenke glad you got it working again; sorry about the confusion. Next time, by the way, you can tap 3x on Settings which opens the advanced settings, and scroll down for the dialog for that particular or other settings. No need to wipe everything. :-)

@bodomenke
Copy link

@jpmens Wow. An easteregg in Owntracks. Thanks for letting me know! This makes things much easier of course! :-)

@jpmens
Copy link
Member

jpmens commented Dec 11, 2019

@bodomenke look at the calendar: it's a christmas egg. :-))

@bodomenke
Copy link

@jpmens You are so right. I am behind in time. :-D

@cthierman
Copy link

Hi @jpmens,

If it helps, I can also confirm that I too had this issue. Thankfully I stumbled on this posting after about 1 week trying to figure out what the issue was. By turning sub to true, and restarting, that has also fixed the issue.

I too only just installed Owntracks on two iphones and 1 iPad in the last 2 weeks. I have never imported or exported any configs.

Sounds like the default for sub is still false and should probably get changed.

This is great to see it working now... Thanks

@ckrey
Copy link
Member

ckrey commented Dec 16, 2019

@cthierman thanks for checking again. There will be an updated version 13.1.7 in the app store shortly

@bodomenke
Copy link

@ckrey This is good news. And btw, this is also a good time to say "thank you" for your and @jpmens efforts for keeping up this really great app.
My home automation relies on owntracks and mqtt. I am using it since years and I am always happy to have it. Without you guys many use cases would not be possible.
Unfortunately my dev experience is not sufficient to do more to support this great piece of open software.
Have a great holiday session! Best, Bodo :-)

@jpmens
Copy link
Member

jpmens commented Dec 17, 2019

Thank you, @bodomenke, for your kind words; it's a pleasure to hear that!

@martinlindjarv
Copy link

Has same kind of problem today morning that steps count didn't reach to openhab ... searched and tried to figure out what's wrong ... after finding topic #611 it linked here ... tired and after closing and opening again pedometer is working again :)
Last night my openhab and mosquitto got a update and problem raised after upgrade ...
I think i count as "long time user" :) because first log of steps is from january 2017 :)

It's hard work to develop and coordinate such a excellent software! I do like to join with @bodomenke "thank you" for @jpmens!

@jpmens
Copy link
Member

jpmens commented Dec 18, 2019

Thanks for the kind words for our small project, but keep in mind please, that it is @ckrey who does all the work on the iOS app! :-)

@cherub-i
Copy link

cherub-i commented Jan 2, 2020

Hello @jpmens and @ckrey,
I too stumbled on this thread as I had the same problem (now - solved, hooray!).
But the reason I am commenting, is to say thank you for this wonderful app.
I especially like the good documentation which got me going really quickly when I first set it up about 2 years ago and the flexibility which comes with using MQTT as its communicatoins protocol.
It's a shame, that it needs one small bug and the good example from @bodomenke (thank you for that!) for me to come forward and say something positive - I will try to get better at that in 2020.

@gregbert42
Copy link

This also solved my issue. Seems to be systematic across all my family’s iPhones.

@jpmens
Copy link
Member

jpmens commented Jan 7, 2020

@gregbert42 it was a bug, yes; we're sorry about the confusion. Glad you've solved it. FWIW, the issue has meanwhile been resolved and has been available in the app store for a bit now.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

8 participants