Posts

Showing posts from 2024

Whereabouts Clock Simplified

Image
 Whereabouts Clock (v6) When I published the last update to the Whereabouts Clock I knew that I would make another version that simplified the architecture.  Apple iOS supports the idea of location regions (home, work, etc.) and can notify an App when the user enters and exits a region.  This "presence" feature is utilized in Life360, OwnTracks, and others. Instead of looking up a user's location from a static database, we can leverage the built-in feature to tell the Arduino clock how to move and when.  There's no more polling a web page for updates or maintaining a database of locations. So how does the whole system work now? Devices with OwnTracks send location data (either standard location messages or transition events into/out of a known region) to the MQTT broker (Mosquitto).   These messages contain the region information setup on the device (more on that in a minute) The Mosquitto MQTT broker broadcasts these messages to its subscribers (other OwnTracks devic

Whereabouts Clock Update

Image
After a few months, Life360 has gone the way of Apple and locked down the API I used to get location data from the phones.  This is disappointing, but inevitable. I found on a forum for Home Assistant that the app OwnTracks might be a suitable alternative. It's a neat little app that will trigger the phone to send its location data via MQTT to a server that you specify. I had to rework the code a bit, but the new operation is as follows: OwnTracks on the phone will push location data per its configuration to the MQTT server (Docker container) The Mosquitto (MQTT Broker) container will receive the data and forward the data to its subscribers The MQTTWarn container is a subscriber and translates the received data and adds it to the MariaDB database The Apache web server hosts a Python CGI script that is checked each minute by the Arduino microcontroller.  If the data has changed, the hands are moved to the new location. The only exposed port to the Internet is TCP 1883 for MQTT