please help me with this. I have spent good two days on this with no success.
I am using Paho-Mqtt python client example. I also have HiveMq mqtt server on my digitalocean debian server. The client example code in python can connect and subscribe to digitalocean server IF I run it on my laptop or on my linux Debian machine. BUT. here is the BUT. when I run the client on digitalocean server (where hivemq mqtt server is) it can only connect and does not subscribe! I used both localhost and server IP, but still no luck.
However the same client code running on digitalocean server (along with hivemq mqtt server) can successfully connect and subscribe to external servers such as m2m.eclipse.org.
How do I know it doesn't subscribe but connects? well, it returns RC:0 on connect callback, but does not return anything on subscribe callback. (it should return 'Subscribe: 1' etc)
In conclusion: Clinet can connect but cannot subscribe when it is running on the same machine as the server.