owntracks / talk

Questions, talk about OwnTracks
30 stars 4 forks source link

Lost my locations somewhere in the process of setting things up #159

Closed skorphil closed 5 months ago

skorphil commented 1 year ago

Hi. I ve been using Android app for awhile. But without connecting it to MQTT, because didn't have time to set it up. I ended up having about 600 endpoint queue.

Yesterday I set up Mosquitto server and all my locations were sent from android to MQTT server(so I had 0 endpoint queue). Today I set up OwnTracks recorder, connected it to Mosquitto server... aaand get nothing. All I have now in the OT-recorder is locations being recorded after I installed OT-Recorder.

1) Can I get all my old locations in OT-Recorder? 2) How to prevent data loss in the future? Do I have to set up mosquitto somehow?

jpmens commented 1 year ago

Sorry to hear that, but there's little we can do. I have to assume your Mosquitto wasn't set up with persistence, so there's little hope.

Generally the order is to set up an MQTT broker (such as Mosquitto), then the OwnTracks Recorder which will read from the broker and store in files on the file system, and then configure the phone to speak to the broker.

I'd like to recommend ensuring that a system reboot will bring up the services (Mosquitto, Recorder) so that you're safe for eventual restarts of the system.

skorphil commented 1 year ago

Persistence was true, but seems like it didn't help :/

pid_file /var/run/mosquitto.pid

persistence true
persistence_location /var/lib/mosquitto/

log_dest file /var/log/mosquitto/mosquitto.log

password_file /etc/mosquitto/passwd
allow_anonymous false
listener 1883

include_dir /etc/mosquitto/conf.d
jpmens commented 1 year ago

Did you change the QoS setting on Android before you began using the app, and if so, what did you set it to?

jpmens commented 1 year ago

Do you see a mosquitto.db file in the persistence directory? How large is it?

skorphil commented 1 year ago

Did you change the QoS setting on Android before you began using the app, and if so, what did you set it to?

I don't know how to change them. So probably I didn't.

Do you see a mosquitto.db file in the persistence directory? How large is it? it was 4kb

jpmens commented 5 months ago

Closing as answered, but feel free to report if you need assistance.