wansti / OwntracksOSM

Owntracks and OpenStreetMap based mapping and location sharing app for Samsung smartwatches
GNU General Public License v3.0
10 stars 6 forks source link

Owntracks OSM

Discontinued

Due to Samsung's move to the WearOS platform for their smartwatches I am discontinuing development on this project. I am happy to assist anyone who would like to pick it up and maintain it.

Overview

Owntracks OSM is a standalone, wearable mapping and location sharing app for Samsung Galaxy brand smartwatches. On its own, it can be used to view OpenStreetMap based maps on your watch and display your location using the watch's builtin GPS. In conjunction with an MQTT broker and the Owntracks protocol, it can be used to share your location with other users and display their locations on your watch in real time.

Why Owntracks for location sharing?

Owntracks is open source and privacy focused. Using a commercial location sharing service is impossible without sharing highly sensitive data with third parties. Owntracks lets you set up your own private location sharing server so all of your location data remains in your own hands. Since Owntracks OSM uses the builtin GPS of your smartwatch, it will work with location services on your phone turned off. Owntracks OSM is compatible with the official apps for Android and iOS so it is possible to share your location with users who do not own a Samsung smartwatch. Please refer to the Owntracks documentation and the Owntracks repository on Github for more information on the service.

Download

Owntracks OSM should appear in the Galaxy App Store for the following compatible devices:

Usage

Using Owntracks OSM as a Standalone App

Without an Owntracks server, you can still use the app as a free and open source OpenStreetMap client on your smartwatch. Using the location sharing features will require an Owntracks server.

Setting up an Owntracks Server

Owntracks uses an MQTT broker such as Mosquitto as its server to relay location messages between devices. Please refer to this manual on how to set up Mosquitto, configure it to be used with Owntracks, and set up users and access rights. The document is written for the Raspberry Pi and the Raspbian OS but it also works on other Debian-based Linux distros such as Ubuntu.

Owntracks OSM uses websockets to connect to the server so make sure you enable websocket support in your Mosquitto configuration. It is possible to add multiple listeners to your configuration so if you have already configured your server for Owntracks using a different protocol, you can simply add another websockets listener. Here is an example configuration that has websockets and TLS enabled (with a LetsEncrypt certificate) on port 8883, and an unencrypted MQTT listener on port 1883:

allow_anonymous false
password_file /etc/mosquitto/owntracks.pw
acl_file /etc/mosquitto/owntracks.acl

persistence_file owntracks.db

log_type error
log_type warning
log_type notice
log_type information
log_timestamp true
connection_messages true

# Unencrypted MQTT listener on port 1883
listener 1883

# TLS-encrypted websockets listener on port 8883
listener 8883
protocol websockets
certfile /etc/letsencrypt/live/<YOUR_SERVER_URL>/cert.pem
cafile /etc/letsencrypt/live/<YOUR_SERVER_URL>/chain.pem
keyfile /etc/letsencrypt/live/<YOUR_SERVER_URL>/privkey.pem

Main Screen

Upon opening the app on your watch you will be greeted with the map screen and a menu button. Use the touch screen to move the map and the bezel or two-finger pinch gesture to zoom. Press the menu button to bring up the menu where you will find the following functions (left to right):

The buttons on the smartwatch will do the following:

Server Settings

Press the Settings button in the main menu to bring up the configuration page. Here, you will find the following settings:

Using the Map

Once you press the connect button the watch's GPS will become active and your position will be displayed on the map (you may need to use the Cycle Markers button to see it). If the Owntracks server is configured correctly and reachable, markers and pins from retained messages and other users who are currently broadcasting will start appearing on the map. New incoming location updates will be displayed in real time.

The location sent by your watch's GPS will be shown as a black "shadow" marker. Your location as received by the Owntracks server will always be shown as a blue marker. The blue and black marker should always be at the same position; if they aren't, it's usually due to a connection problem (check the debug log for hints). Markers from other users will be displayed in other colours. The GPS' accuracy is shown as a circle around the marker's base. Press the marker on the touch screen to bring up additional information such as user name, time stamp, and the user's battery level.

Compatibility with Android/iOS Apps

Given a working Owntracks broker, users of the official Owntracks apps for Android and iOS should be able to see location updates from the watch (and vice versa) right away. If you are using both a phone and a watch under the same user name, make sure to set different device IDs for them and configure the server's access rights so other users can see them both.

Battery Life

Keeping the GPS on and maintaining an open internet connection to the server will obviously affect your watch's battery life. In our experience it is possible to use the app for several hours on a full charge and still get through the day with normal usage. If you leave the app running in the background to send location updates without using the map a single charge should last a day. Lowering the update frequency in the settings menu may improve your results.

Troubleshooting Connection Errors

The MQTT protocol is designed for environments with unstable connections (i.e. IoT scenarios). Owntracks OSM will always try to reconnect to the server if a connection is interrupted. If this fails, or you experience unreliable connections in general, here are a few things you can try:

Unsupported Features

Only "location" type messages are currently supported by Owntracks OSM. Other message types such as beacons, waypoints and encrypted payloads are not yet supported.