owntracks / ios

OwnTracks' iPhone App
http://owntracks.org
Other
338 stars 91 forks source link

owntracks on iOS stopped receiving positions after eclipse-mosquitto upgrade #611

Closed ghost closed 4 years ago

ghost commented 4 years ago

Hi there,

I host my own eclipse-mosquitto broker on a docker instance (eclipse-mosquitto:latest) and after an image upgrade on the 4th of December, owntracks stopped working. I see clients are connected to the broker, however on the iOS app, everything has been frozen as of 4th, just before the image upgrade.

What could be the issue?

Best,

Savas

jpmens commented 4 years ago

This sounds very much like the sub problem described in https://github.com/owntracks/ios/issues/610#issuecomment-559972747

Please verify by tapping 3x on settings that the SUB switch is enabled.

ghost commented 4 years ago

I enabled SUB and I can see some of my contacts' locations updated.

Do I need to implement this solution in each and every device?

ckrey commented 4 years ago

yes or you wait for the next update version

ghost commented 4 years ago

I'll wait for an updated version

luca-angemi commented 3 years ago

Hi guys, after reinstalling I had the same issue and moving sub to True worked.

Now there is another problem (not sure if it's related). Friends are updating only if I swipe away the app and reopening it. Am I missing something?

Apologies if this isn't the right place to address this issue.

jpmens commented 3 years ago

This issue is a year old ...

If Sub is false, you're not subscribing. If you swipe out the app you are effectively killing it; we recommend you don't do that.

How are your friends publishing their data? Which apps, versions?

luca-angemi commented 3 years ago

Thanks for the prompt reply.

Both apps are iOS v. 13.3.6 with both Sub set to True.

jpmens commented 3 years ago

So, phone1 open on map or Friends list and phone2 publishes a position (up arrow on map) and you don't see its position or publishing time change/show on phone1?

luca-angemi commented 3 years ago

Correct. I only see the update if I kill the app.

jpmens commented 3 years ago

Which MQTT broker are you using? Can you see the publish and the subscribe in its logs and can you show us the logs, please?

luca-angemi commented 3 years ago

I'm using mosquitto.

Here the logs of the mentioned test.

1608138960: New connection from xx.xxx.xxx.xxx on port 1883.
[INFO] found luca on local database
1608138962: New client connected from xx.xxx.xxx.xxx as lucaiphone (p2, c0, k60, u'luca').
1608138968: Client lucaiphone disconnected.
1608138968: New connection from xx.xxx.xxx.xxx on port 1883.
1608138968: New client connected from xx.xxx.xxx.xxx as lucaiphone (p2, c0, k60, u'luca').
1608139013: Client lucaiphone disconnected.
1608139065: New connection from yyy.yyy.yyy.yyy on port 1883.
[INFO] found maca on local database
1608139067: New client connected from yyy.yyy.yyy.yyy as macaiphone (p2, c0, k60, u'maca').
1608139069: Client macaiphone disconnected

(edited for formatting and removal of IP addresses by JPM)

luca-angemi commented 3 years ago

Thanks for editing it.

jpmens commented 3 years ago

Those logs show connection messages only. Please add log_type debug to mosquitto.conf and try again after restarting/reloading Mosquitto. I'm looking for PUBLISH and SUBSCRIBE type messages.

luca-angemi commented 3 years ago

Ok, managed to get proper logs.

1608147076: Sending CONNACK to macaiphone (0, 0)
1608147084: Received PUBLISH from macaiphone (d0, q1, r1, m41, 'owntracks/maca/iphone', ... (232 bytes))
1608147084: Sending PUBACK to macaiphone (m41, rc0)
1608147084: Sending PUBLISH to 0e4pnP2KQEYYEB9P5cm3Vu (d0, q1, r0, m7, 'owntracks/maca/iphone', ... (232 bytes))
1608147084: Received PUBACK from 0e4pnP2KQEYYEB9P5cm3Vu (Mid: 7, RC:0)
1608147091: Received PINGREQ from lucaiphone
1608147091: Sending PINGRESP to lucaiphone
1608147105: Received DISCONNECT from lucaiphone
1608147107: Will message specified (32 bytes) (r0, q1).
1608147107:     owntracks/luca/iphone
1608147107: Sending CONNACK to lucaiphone (0, 0)
1608147107: Received SUBSCRIBE from lucaiphone
1608147107:     owntracks/+/+ (QoS 1)
1608147107: Sending SUBACK to lucaiphone
1608147107: Sending PUBLISH to lucaiphone (d0, q1, r1, m1, 'owntracks/maca/iphone', ... (232 bytes))
1608147107: Sending PUBLISH to lucaiphone (d0, q1, r1, m2, 'owntracks/luca/iphone', ... (241 bytes))
1608147107: Received SUBSCRIBE from lucaiphone
1608147107:     owntracks/+/+/event (QoS 1)
1608147107: Sending SUBACK to lucaiphone
1608147107: Received SUBSCRIBE from lucaiphone
1608147107:     owntracks/+/+/info (QoS 1)
1608147107: Sending SUBACK to lucaiphone
1608147107: Received SUBSCRIBE from lucaiphone
1608147107:     owntracks/luca/iphone/cmd (QoS 1)
1608147107: Sending SUBACK to lucaiphone
1608147107: Received PUBACK from lucaiphone (Mid: 1, RC:0)
1608147107: Received PUBACK from lucaiphone (Mid: 2, RC:0)

as I was not receiving the update I killed the app and received the update at 1608147105

jpmens commented 3 years ago

Before you edited the last comment I see in the notification email

Denied PUBLISH from macaiphone (d0, q1, r1, m31, 'owntracks/maca/iphone', ... (148 bytes))

This indicates ACL problems on your Mosquitto broker.

luca-angemi commented 3 years ago

Yes, I had forgotten to add those users to the file. Latest comments are with correct ACL and the iOS app is updated only after a kill.

jpmens commented 3 years ago

@luca-angemi we need more info. Show us your Mosquitto ACLs please, and show us logs during which both phones initially connect, subscribe, publish, etc.