Holy bananas I’m confused. First Reply is an update on progress
I want to be as thorough as I can in explaining this so I can attempt to write up a more comprehensive, simple step-by-step for the next guy…so, if you know how to do this and are willing to help, there’s a starbucks coffee in it for you
Tools:
MacBook OSX
HASS.IO - 0.56.2 on Pi3
MQTT add-on installed 1.0
iOS 11.0.2
OwnTracks 9.7.2
There are so many different conflicting pieces of information floating around and I’m simply trying to understand the basics of MQTT solely for the purpose of tracking my iPhone location with OwnTracks
In Hass.io, the following is set for Mosquitto options:
(never mind the indentations, I have it right in the setup):
{
“plain”: true, <— although I like bagels, I’m not certain
“ssl”: false, <— not sure what’s required to set SSL up
“anonymous”: false, <— I’m not completely useless…this makes sense
“logins”: [
{
“username”: “xxxxxxxx”, <— just made it up arbitrarily
“password”: “xxxxxxxx” <— same…
}
],
“customize”: {
“active”: true, < — I guess this enables the folder below?
“folder”: “mosquitto” <— not sure what this is for but I created the folder in samba share
},
“certfile”: “fullchain.pem”, <— wh…wha?
“keyfile”: “privkey.pem” <— ya…mind blown.
}
Network Host Ports are defaults at 1883 and 8883.
My router is port forwarding 1883 and 8883 to the Pi3 IP Address and DuckDNS is operating correctly (as far as I can tell…)
I don’t know what “Let’s Encrypt” is at this point, but Hass.io warns me not to enable it if I use DuckDNS. So, I abide.
Testing Mosquitto
When I restart the broker, I get this in the log:
starting version 3.2.2
1509137804: mosquitto version 1.4.12 (build date 2017-06-01 13:03:48+0000) starting
1509137804: Config loaded from /etc/mosquitto.conf.
1509137804: Opening ipv4 listen socket on port 1883.
1509137804: Opening ipv6 listen socket on port 1883.
1509137804: Warning: Mosquitto should not be run as root/administrator.
Seems to look good to me, except for that last line and the fact that I don’t really know what I’m doing. Not sure if that’s an error or general warning for the sake of warning.
OwnTracks on the iPhone
Not very well documented and a bit clunky…but I’ll do my best.
Settings Screen
- Mode = Private
- TrackerID = should something be here? It seems to have a little “04” below “Tracker.”
- Export Settings – Haven’t touched it.
- Publish Settings – Haven’t touched it.
- DeviceID – Should I put something here or just go with the long nasty key that’s shown in the app by default?
- Host – .duckdns.org
- Port – 1883 (Do I turn Websockets ON or leave it OFF?)
- Proto – This shows the number 4, which I believe is correct…but I don’t know about TLS.
- Authentication – ON
- UserID – the arbitrary user name I added in the Options for MQTT broker.
- Password – same…
- Secret encryption key <— Eh? Not sure
Status Info Screen
- Location – Seems to be +/- 26m in accuracy. Hurray.
- Connection – Parameters shown look something like this:
mqtt://[username]@http://[name].duckdns.org:1883 c0 k60 as [username]<device_id_string_from_settings_page>
- Status – I see "idle the operation couldn’t be completed. (kCFErrordomainCFNetwork error 1.) { “_kCFStreamErrorCodeKey” = 1; “_kCFStreamErrorDomainKey” = 12; }
This error occurs both when I use both the public URL and the IP Address.
HASS.IO Config
mqtt:
…broker: core-mosquitto (minus the elipsis naturally)
Question
From what you see here, what am I missing?
Thank you!