Project

General

Profile

Support #493

Cannot connect to CloudMQTT

Added by janno over 4 years ago. Updated over 4 years ago.

Status:
Closed
Priority:
Normal
Assignee:
Category:
DomotiGa3
Target version:
Start date:
11/12/2014
Due date:
% Done:

100%

Estimated time:
Resolution:
Fixed

Description

Hello, I try to connect to CloudMQTT (so not a local install). I filled in the server/port/client name/user/pass but I get a respons after enabling the MQTT module that the TCP interface is connected. This message is seen on both DomotGa client and server. On the server I then see a message[MQTT] Not connected to MQTT broker, cannot publish! I tried looking at tcpdump and there is in fact a active TCP session... Also subscribing does not seem to work.
I can connect to CloudMQTT via the mosquito_sub client from the command prompt of the same machine with no problem. Any idea what could be wrong? Is it the client server setup?

History

#1 Updated by Alexie over 4 years ago

Do you have a tcpdump of the request or how we can test it ourselves? ;-)

#2 Updated by janno over 4 years ago

In the mail.

#3 Updated by rdnzl over 4 years ago

I suspect the username and/or password are not correctly sent/encoded.

#4 Updated by Alexie over 4 years ago

I have to agree with that, Wireshark can't make much of the connect mqtt message ;-) No username or password visible, just "malformed packet".

#5 Updated by Alexie over 4 years ago

  • Status changed from New to In Progress
  • Assignee set to Alexie

Ok, see the problem i think :-)

According to the specs the request should be as follows (variable data):
<len 2-bytes><client id><len 2-bytes><username><len 2-bytes><password>

Only DomotiGa seems to send:
<len 2-bytes><client id><username><password>

This is most likely why it works, if you don't enable username/password ... I will try to fix it tonight.

#6 Updated by rdnzl over 4 years ago

Ok, I will submit some fixes to the reconnect code, if cloud MQTT broker disconnects because of auth issues, enable reconnect timer, not try to connect every second until disk is full ;-)

#7 Updated by rdnzl over 4 years ago

I have it working, sorry could help looking into it :)

2014/11/18 15:29:31 [MQTT] Connection accepted by server.
2014/11/18 15:29:31 [MQTT] < 90 03 00 0A 00
2014/11/18 15:29:31 [MQTT] Subscription ack packet.

Will be in beta shortly.

#8 Updated by Alexie over 4 years ago

  • Category set to DomotiGa3
  • Assignee changed from Alexie to rdnzl
  • Target version set to 1.0.019

No worries ... :P If it works, it works ...

We should backport some fixes or make 1.0.019 available soon ;-)

#9 Updated by rdnzl over 4 years ago

I was just thinking about that!
I want to release sooner that I did in the past to clear my head ;-)

#10 Updated by janno over 4 years ago

Thank you very much guys, this part works great. The only thing missing is OwnTracks support for "Waypoints". Waypoints are positions on the map with a radius. they act like regions. I use for instance two regions: One with a radius of 25km around home. If I enter that region a waypoint update is pushed and I want my house to prepare itself for my arrival (heating on). Then another waypoint with a radius of 100 meter around my house which will tell Domotiga I'm (coming) home. Lights on etc. At this moment location updates of OwnTracks are understood by Domotiga. Waypoints not yet. Waypoints are pushed one level deeper than the location data: location/janno/waypoints: {"rad":"100","tst":"1416432793","vel":0,"_type":"waypoint","alt":0,"lon":"1.23456","vac":0,"cog":0,"lat":"52.12345","tid":"NO","desc":"thuis"}
To conclude: this issue can be closed. The other thing is a new feature request so if you are motivated... ;)

#11 Updated by rdnzl over 4 years ago

Please open a new ticket for the request.
Funny enough DomotiGa also knows waypoints, they are called makers (see edit menu), but since the latitude plugin was removed they sit there unused.
How do you like to see waypoints implemented? A seperate waypoint device?
https://github.com/owntracks/owntracks/wiki/Waypoints

#12 Updated by Alexie over 4 years ago

  • Status changed from In Progress to Resolved
  • % Done changed from 0 to 100
  • Resolution set to Fixed

Put it on resolved, just until Janno opens a new feature request ;)

#13 Updated by Alexie over 4 years ago

  • Status changed from Resolved to Feedback

Feature request is opened, i will close this one now.

#14 Updated by Alexie over 4 years ago

  • Status changed from Feedback to Closed

(wrong dropbox item - sorry)

Also available in: Atom PDF