Zerotier and MQTT - Assistance required

For anything else on your mind

Moderators: HeneryH, TimG

Post Reply
User avatar
TimG
Posts: 2841
Joined: Tue Jun 18, 2019 10:45 am
Location: Nottinghamshire, UK.

Zerotier and MQTT - Assistance required

Post by TimG » Thu Mar 23, 2023 9:15 pm

Hi all,

I installed Zerotier (free) as I want to simplify remote mobile phone use of my home servers. For my BI5 server, I was using OpenVPN but it is a bear to set up and use. I followed this Youtube video and managed to get the BI5 Android app working through ZT to my BI5 server without having to open any ports or use OpenVPN. Smooth.

Then I tried to get Owntracks (Android mobile) to send MQTT co-ordinates to my Homeseer HS4 pc for geofencing. This was previously working well with a DDNS address back to the router, and port forwarding tcp 1883 to the HS4 pc, but I don't like port forwarding so it has to go.

So, knowing that ZT is working on the mobile phone, all I thought I had to do was change the existing android DDNS "Host" address in Owntracks to the new ZT IP address for the HS4 pc. However I can't find the right combination of juju to get MQTT working through ZT. The interwebs don't make any mention of this, so it either works for everybody else and I'm an idiot, or I'm a world leading Engineer on the cusp of a great discovery. Well I don't believe the latter either, so what am I missing ? Do I need to bridge the HS4 pc ZT IP with the existing home LAN IP ? I already tried firewall off after adding rules. I'm running out of ideas :(

Too tired now, I'll try bridging tomorrow if there are no other ideas.
Forum Moderator.
User avatar
TimG
Posts: 2841
Joined: Tue Jun 18, 2019 10:45 am
Location: Nottinghamshire, UK.

Re: Zerotier and MQTT - Assistance required

Post by TimG » Fri Mar 24, 2023 7:39 pm

I got a bit further. After checking that I could ping all of my other ZT devices from the Homeseer pc, I tried adding the ZT IP as well as 127.0.0.1 to Homeseer mcsMQTT. It needs 127 to force it to use the inbuilt MQTT broker. This almost works, and I could see traffic on the mobile phone topics, but it wasn't up to date info from the mobile phones.

Does anybody have MQTT working via ZT ? I'm sure it's really simple and I'll kick myself when the answer appears :oops:

Definitely not working. I just tried spoofing the android gps to move me from home to work. Life360 shows I've moved, but the MQTT based Owntracks doesn't.
Forum Moderator.
User avatar
TimG
Posts: 2841
Joined: Tue Jun 18, 2019 10:45 am
Location: Nottinghamshire, UK.

Re: Zerotier and MQTT - Assistance required [Solved]

Post by TimG » Sat Apr 01, 2023 1:10 pm

With the thought that the Homeseer MQTT broker "mcsMQTT" may not be as full of features as the normal MQTT brokers, I today installed Eclipse Mosquitto on the Homeseer pc. It was a slight pain to get going, as I had to create a config file and manually open incoming and outgoing ports 1883 within my LAN for the Mosquitto pc, but it could then be seen chugging away on MQTT Explorer.

Then I saw Owntracks appear - and it is the live data from my mobile phone via Zerotier :D

Happy Engineer :lol:

So, Zerotier has allowed me to close all WAN ports, and I can now view BI5 remotely, as well as use Owntracks Geofencing. Now to find out if Zerotier runs the mobile phone battery down !
Forum Moderator.
poodad
Posts: 6
Joined: Fri Dec 23, 2022 6:35 pm

Re: Zerotier and MQTT - Assistance required

Post by poodad » Thu Apr 06, 2023 3:20 pm

I use OPNSense as my home router, and I install ZeroTier there. My phones connect to the router and it's just like my phone is on my home network.
User avatar
TimG
Posts: 2841
Joined: Tue Jun 18, 2019 10:45 am
Location: Nottinghamshire, UK.

Re: Zerotier and MQTT - Assistance required

Post by TimG » Thu Apr 06, 2023 4:45 pm

Interesting...

I'll be back later :idea:
Forum Moderator.
Post Reply