{"id":1935,"date":"2018-09-14T18:51:35","date_gmt":"2018-09-14T17:51:35","guid":{"rendered":"https:\/\/www.thenaylors.co.uk\/wordpress\/?p=1935"},"modified":"2018-11-29T17:00:34","modified_gmt":"2018-11-29T17:00:34","slug":"owntracks-and-mosquitto","status":"publish","type":"post","link":"https:\/\/www.thenaylors.co.uk\/wordpress\/owntracks-and-mosquitto\/","title":{"rendered":"Owntracks and Mosquitto"},"content":{"rendered":"<p>Came across Owntracks and decided that it would be fun to have my own Mosquitto repository.<\/p>\n<p>Followed instructions here &#8230;.<br \/>\n<a href=\"https:\/\/www.digitalocean.com\/community\/questions\/how-to-setup-a-mosquitto-mqtt-server-and-receive-data-from-owntracks\" target=\"_blank\" rel=\"noopener\">https:\/\/www.digitalocean.com\/community\/questions\/how-to-setup-a-mosquitto-mqtt-server-and-receive-data-from-owntracks<\/a><\/p>\n<p>They work fine with the exception of needing to install mosquitto-clients to get the mosquitto_sub command working and leaving off the ip address in the mosquitto.conf file from the listener entry. Looking at the log later on the connection is from the ip address of the router on the local lan for external connections and that probably was the address needed to get things working if an ip address was used.<\/p>\n<p>So when I tested and changed the location and config items multiple items are written to the mosquitto database. This then looks bad in the recorder as there are loads of entries which don&#8217;t look pretty!<br \/>\nThese are in var \/ spool \/ owntracks \/ recorder \/ store and then either last or rec. If you remove all entries except the ones you want from both then things look pretty again.<\/p>\n<p>It is also worth installing mqtt-spy from mqhive &#8211; <a href=\"http:\/\/kamilfb.github.io\/mqtt-spy\/\">http:\/\/kamilfb.github.io\/mqtt-spy\/<\/a>\u00a0and publishing a null record without any data or retain so that the mosquitto database does not have then entries any more.<\/p>\n<p>the mosquitto database is normally in var\/lib\/mosquitto but the location can be changed in the mosquitto.conf or conf.d file in etc\/mosquitto.<\/p>\n<p>Now it got tricker when I wanted to publish the steps from my iPhone. Publishing a command did nothing. \u00a0I found this comment on GitHub &#8230;. &#8221;<\/p>\n<p>Remote commands need to be enabled with remoteConfig: export your configuration, add <code>cmd: true<\/code>, and re-import (e.g. by sending the <code>.otrc<\/code> file to iOS and open in OwnTracks).<\/p>\n<p>Once you&#8217;ve done that, you can send remote commands. Note though, that the iOS app is put to sleep by the OS which means that when it&#8217;s in the background you will have to wait until it wakes up for the command to take effect \/ be processed; this can take a while. Hence we suggest you post commands to iOS with QoS=2&#8243;<\/p>\n<p>So I did this and all is well.<\/p>\n<p>mosquitto_pub -q 2 -h xxxx -p 8883 -t owntracks\/owntracks\/michael-iPhone6s\/cmd -u owntracks -P xxx -m &#8216;{&#8220;_type&#8221; : &#8220;cmd&#8221;, &#8220;action&#8221;: &#8220;reportSteps&#8221;}&#8217;<\/p>\n<p>and this opened the BBC new in the Featured tab. \u00a0Cool&#8230;.<\/p>\n<p>mosquitto_pub -q 2 -h xxx -p 8883 -t owntracks\/owntracks\/michael-iPhone6s\/cmd -u owntracks -P xxx -m &#8216;{&#8220;action&#8221;: &#8220;action&#8221;, &#8220;url&#8221;: &#8220;http:\/\/news.bbc.co.uk&#8221;, &#8220;_type&#8221;: &#8220;cmd&#8221;}&#8217;<\/p>\n<p>I was a bit puzzled about why the topic was owntracks\/owntracks but on further reading of the documentation the default topic is owntracks\/username\/devicename and as I was using a username of owntracks the second pat of the topic derived from that.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Came across Owntracks and decided that it would be fun to have my own Mosquitto repository. Followed instructions here &#8230;. https:\/\/www.digitalocean.com\/community\/questions\/how-to-setup-a-mosquitto-mqtt-server-and-receive-data-from-owntracks They work fine with the exception of needing to install mosquitto-clients to get the mosquitto_sub command working and leaving off the ip address in the mosquitto.conf file from the listener entry. Looking at the &hellip; <\/p>\n<p class=\"link-more\"><a href=\"https:\/\/www.thenaylors.co.uk\/wordpress\/owntracks-and-mosquitto\/\" class=\"more-link\">Continue reading<span class=\"screen-reader-text\"> &#8220;Owntracks and Mosquitto&#8221;<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[2],"tags":[],"class_list":["post-1935","post","type-post","status-publish","format-standard","hentry","category-linux-nas"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v24.4 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>Owntracks and Mosquitto - Michael Naylor<\/title>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/www.thenaylors.co.uk\/wordpress\/owntracks-and-mosquitto\/\" \/>\n<meta property=\"og:locale\" content=\"en_GB\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Owntracks and Mosquitto - Michael Naylor\" \/>\n<meta property=\"og:description\" content=\"Came across Owntracks and decided that it would be fun to have my own Mosquitto repository. Followed instructions here &#8230;. https:\/\/www.digitalocean.com\/community\/questions\/how-to-setup-a-mosquitto-mqtt-server-and-receive-data-from-owntracks They work fine with the exception of needing to install mosquitto-clients to get the mosquitto_sub command working and leaving off the ip address in the mosquitto.conf file from the listener entry. Looking at the &hellip; Continue reading &quot;Owntracks and Mosquitto&quot;\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.thenaylors.co.uk\/wordpress\/owntracks-and-mosquitto\/\" \/>\n<meta property=\"og:site_name\" content=\"Michael Naylor\" \/>\n<meta property=\"article:published_time\" content=\"2018-09-14T17:51:35+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2018-11-29T17:00:34+00:00\" \/>\n<meta name=\"author\" content=\"admin\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:creator\" content=\"@mjnaylor\" \/>\n<meta name=\"twitter:site\" content=\"@mjnaylor\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"admin\" \/>\n\t<meta name=\"twitter:label2\" content=\"Estimated reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"2 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\/\/www.thenaylors.co.uk\/wordpress\/owntracks-and-mosquitto\/#article\",\"isPartOf\":{\"@id\":\"https:\/\/www.thenaylors.co.uk\/wordpress\/owntracks-and-mosquitto\/\"},\"author\":{\"name\":\"admin\",\"@id\":\"https:\/\/www.thenaylors.co.uk\/wordpress\/#\/schema\/person\/af4669b3ebc6341a4c069ea3381181ad\"},\"headline\":\"Owntracks and Mosquitto\",\"datePublished\":\"2018-09-14T17:51:35+00:00\",\"dateModified\":\"2018-11-29T17:00:34+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\/\/www.thenaylors.co.uk\/wordpress\/owntracks-and-mosquitto\/\"},\"wordCount\":459,\"commentCount\":0,\"publisher\":{\"@id\":\"https:\/\/www.thenaylors.co.uk\/wordpress\/#\/schema\/person\/22e1ad271f44b7f71c8e1fbf982dcbe5\"},\"articleSection\":[\"Linux NAS\"],\"inLanguage\":\"en-GB\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\/\/www.thenaylors.co.uk\/wordpress\/owntracks-and-mosquitto\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\/\/www.thenaylors.co.uk\/wordpress\/owntracks-and-mosquitto\/\",\"url\":\"https:\/\/www.thenaylors.co.uk\/wordpress\/owntracks-and-mosquitto\/\",\"name\":\"Owntracks and Mosquitto - Michael Naylor\",\"isPartOf\":{\"@id\":\"https:\/\/www.thenaylors.co.uk\/wordpress\/#website\"},\"datePublished\":\"2018-09-14T17:51:35+00:00\",\"dateModified\":\"2018-11-29T17:00:34+00:00\",\"breadcrumb\":{\"@id\":\"https:\/\/www.thenaylors.co.uk\/wordpress\/owntracks-and-mosquitto\/#breadcrumb\"},\"inLanguage\":\"en-GB\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/www.thenaylors.co.uk\/wordpress\/owntracks-and-mosquitto\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/www.thenaylors.co.uk\/wordpress\/owntracks-and-mosquitto\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/www.thenaylors.co.uk\/wordpress\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Owntracks and Mosquitto\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/www.thenaylors.co.uk\/wordpress\/#website\",\"url\":\"https:\/\/www.thenaylors.co.uk\/wordpress\/\",\"name\":\"Michael Naylor\",\"description\":\"Things which interest me.\",\"publisher\":{\"@id\":\"https:\/\/www.thenaylors.co.uk\/wordpress\/#\/schema\/person\/22e1ad271f44b7f71c8e1fbf982dcbe5\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/www.thenaylors.co.uk\/wordpress\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-GB\"},{\"@type\":[\"Person\",\"Organization\"],\"@id\":\"https:\/\/www.thenaylors.co.uk\/wordpress\/#\/schema\/person\/22e1ad271f44b7f71c8e1fbf982dcbe5\",\"name\":\"Michael Naylor\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-GB\",\"@id\":\"https:\/\/www.thenaylors.co.uk\/wordpress\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/secure.gravatar.com\/avatar\/2aa27338833977999b7baeb1ee9e723e?s=96&d=mm&r=g\",\"contentUrl\":\"https:\/\/secure.gravatar.com\/avatar\/2aa27338833977999b7baeb1ee9e723e?s=96&d=mm&r=g\",\"caption\":\"Michael Naylor\"},\"logo\":{\"@id\":\"https:\/\/www.thenaylors.co.uk\/wordpress\/#\/schema\/person\/image\/\"},\"sameAs\":[\"http:\/\/www.thenaylors.co.uk\/wordpress\"]},{\"@type\":\"Person\",\"@id\":\"https:\/\/www.thenaylors.co.uk\/wordpress\/#\/schema\/person\/af4669b3ebc6341a4c069ea3381181ad\",\"name\":\"admin\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-GB\",\"@id\":\"https:\/\/www.thenaylors.co.uk\/wordpress\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/secure.gravatar.com\/avatar\/71e280edd2a51a46cd545022235cdf48?s=96&d=mm&r=g\",\"contentUrl\":\"https:\/\/secure.gravatar.com\/avatar\/71e280edd2a51a46cd545022235cdf48?s=96&d=mm&r=g\",\"caption\":\"admin\"},\"url\":\"https:\/\/www.thenaylors.co.uk\/wordpress\/author\/admin\/\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Owntracks and Mosquitto - Michael Naylor","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/www.thenaylors.co.uk\/wordpress\/owntracks-and-mosquitto\/","og_locale":"en_GB","og_type":"article","og_title":"Owntracks and Mosquitto - Michael Naylor","og_description":"Came across Owntracks and decided that it would be fun to have my own Mosquitto repository. Followed instructions here &#8230;. https:\/\/www.digitalocean.com\/community\/questions\/how-to-setup-a-mosquitto-mqtt-server-and-receive-data-from-owntracks They work fine with the exception of needing to install mosquitto-clients to get the mosquitto_sub command working and leaving off the ip address in the mosquitto.conf file from the listener entry. Looking at the &hellip; Continue reading \"Owntracks and Mosquitto\"","og_url":"https:\/\/www.thenaylors.co.uk\/wordpress\/owntracks-and-mosquitto\/","og_site_name":"Michael Naylor","article_published_time":"2018-09-14T17:51:35+00:00","article_modified_time":"2018-11-29T17:00:34+00:00","author":"admin","twitter_card":"summary_large_image","twitter_creator":"@mjnaylor","twitter_site":"@mjnaylor","twitter_misc":{"Written by":"admin","Estimated reading time":"2 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/www.thenaylors.co.uk\/wordpress\/owntracks-and-mosquitto\/#article","isPartOf":{"@id":"https:\/\/www.thenaylors.co.uk\/wordpress\/owntracks-and-mosquitto\/"},"author":{"name":"admin","@id":"https:\/\/www.thenaylors.co.uk\/wordpress\/#\/schema\/person\/af4669b3ebc6341a4c069ea3381181ad"},"headline":"Owntracks and Mosquitto","datePublished":"2018-09-14T17:51:35+00:00","dateModified":"2018-11-29T17:00:34+00:00","mainEntityOfPage":{"@id":"https:\/\/www.thenaylors.co.uk\/wordpress\/owntracks-and-mosquitto\/"},"wordCount":459,"commentCount":0,"publisher":{"@id":"https:\/\/www.thenaylors.co.uk\/wordpress\/#\/schema\/person\/22e1ad271f44b7f71c8e1fbf982dcbe5"},"articleSection":["Linux NAS"],"inLanguage":"en-GB","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/www.thenaylors.co.uk\/wordpress\/owntracks-and-mosquitto\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/www.thenaylors.co.uk\/wordpress\/owntracks-and-mosquitto\/","url":"https:\/\/www.thenaylors.co.uk\/wordpress\/owntracks-and-mosquitto\/","name":"Owntracks and Mosquitto - Michael Naylor","isPartOf":{"@id":"https:\/\/www.thenaylors.co.uk\/wordpress\/#website"},"datePublished":"2018-09-14T17:51:35+00:00","dateModified":"2018-11-29T17:00:34+00:00","breadcrumb":{"@id":"https:\/\/www.thenaylors.co.uk\/wordpress\/owntracks-and-mosquitto\/#breadcrumb"},"inLanguage":"en-GB","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.thenaylors.co.uk\/wordpress\/owntracks-and-mosquitto\/"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/www.thenaylors.co.uk\/wordpress\/owntracks-and-mosquitto\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/www.thenaylors.co.uk\/wordpress\/"},{"@type":"ListItem","position":2,"name":"Owntracks and Mosquitto"}]},{"@type":"WebSite","@id":"https:\/\/www.thenaylors.co.uk\/wordpress\/#website","url":"https:\/\/www.thenaylors.co.uk\/wordpress\/","name":"Michael Naylor","description":"Things which interest me.","publisher":{"@id":"https:\/\/www.thenaylors.co.uk\/wordpress\/#\/schema\/person\/22e1ad271f44b7f71c8e1fbf982dcbe5"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.thenaylors.co.uk\/wordpress\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-GB"},{"@type":["Person","Organization"],"@id":"https:\/\/www.thenaylors.co.uk\/wordpress\/#\/schema\/person\/22e1ad271f44b7f71c8e1fbf982dcbe5","name":"Michael Naylor","image":{"@type":"ImageObject","inLanguage":"en-GB","@id":"https:\/\/www.thenaylors.co.uk\/wordpress\/#\/schema\/person\/image\/","url":"https:\/\/secure.gravatar.com\/avatar\/2aa27338833977999b7baeb1ee9e723e?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/2aa27338833977999b7baeb1ee9e723e?s=96&d=mm&r=g","caption":"Michael Naylor"},"logo":{"@id":"https:\/\/www.thenaylors.co.uk\/wordpress\/#\/schema\/person\/image\/"},"sameAs":["http:\/\/www.thenaylors.co.uk\/wordpress"]},{"@type":"Person","@id":"https:\/\/www.thenaylors.co.uk\/wordpress\/#\/schema\/person\/af4669b3ebc6341a4c069ea3381181ad","name":"admin","image":{"@type":"ImageObject","inLanguage":"en-GB","@id":"https:\/\/www.thenaylors.co.uk\/wordpress\/#\/schema\/person\/image\/","url":"https:\/\/secure.gravatar.com\/avatar\/71e280edd2a51a46cd545022235cdf48?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/71e280edd2a51a46cd545022235cdf48?s=96&d=mm&r=g","caption":"admin"},"url":"https:\/\/www.thenaylors.co.uk\/wordpress\/author\/admin\/"}]}},"_links":{"self":[{"href":"https:\/\/www.thenaylors.co.uk\/wordpress\/wp-json\/wp\/v2\/posts\/1935","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.thenaylors.co.uk\/wordpress\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.thenaylors.co.uk\/wordpress\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.thenaylors.co.uk\/wordpress\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.thenaylors.co.uk\/wordpress\/wp-json\/wp\/v2\/comments?post=1935"}],"version-history":[{"count":8,"href":"https:\/\/www.thenaylors.co.uk\/wordpress\/wp-json\/wp\/v2\/posts\/1935\/revisions"}],"predecessor-version":[{"id":2035,"href":"https:\/\/www.thenaylors.co.uk\/wordpress\/wp-json\/wp\/v2\/posts\/1935\/revisions\/2035"}],"wp:attachment":[{"href":"https:\/\/www.thenaylors.co.uk\/wordpress\/wp-json\/wp\/v2\/media?parent=1935"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.thenaylors.co.uk\/wordpress\/wp-json\/wp\/v2\/categories?post=1935"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.thenaylors.co.uk\/wordpress\/wp-json\/wp\/v2\/tags?post=1935"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}