-
Notifications
You must be signed in to change notification settings - Fork 125
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
MQTT/Push Notifications not working with public address/domain #63
Comments
If your server is behind a firewall, you cannot bind a socket to the external address. There are two possible options.
See more details here: https://qa.h-mdm.com/1714/ |
Hi @h-mdm, We tried both the solutions out there, but adding the internal address as our domain name would possibly be the same thing as binding to the internal address. We tried sending push notifications to all our devices from the admin panel, but none of them seem to be received on the other end unfortunately. The device configuration gets loaded, and the manually added apps get installed, but after that passing updates/adding new applications/sending push notifications don't work. By any chance, do we need to make any additional setup for them on server/android side? (just in case if we are missing out on something) |
Make sure you see in logs that Headwind MDM is bound to port 31000. You can also check the MQTT traffic by tcpdump. |
The port does seem to get bind on port 31000 for MQTT as per the startup logs (for the domain name too). We get these logs from tcpdump at port 31000 when we send a push message of type "custom message" with title/type "Hello World" and payload "Test Message" and to a specific device that's currently active. (Also, just in case if this is relevant, please note that we are using the second option mentioned in this comment - #63 (comment)) It does seem to be able to send the required packets from server, really unsure if the firewall or app configuration needs to be changed in any way. Does the At the moment, we are testing the app on a Pixel device running Android 7, and here's how the notification panel looks: |
Hi @h-mdm, Here is some additional information we came across, Hovering over the installation status of the device under test (a red circle) of a brings up this pop-up - |
I see that you're using some technical domain name instead of the IP address. Please use IP address (IPv4) instead, like this: <Parameter name="mqtt.server.uri" value="172.31.43.138:31000"/> The local IP address can be found by a command ip addr show |
We tried adding an app with the admin panel to check if it installs as per what the GUI/docs suggest, but then unfortunately the app doesn't get installed on the client device nor does it actually receive any push notifications sent to it.
On further debugging, we went through the logs and realized that the binding of the MQTT connection itself threw an
java.net.Exception
with the domain name we were using publicly for our https server/admin panel. I tried using the public IP of our machine, it threw the same exception again.Public address -
Public domain name -
However, when I instead used the server machine's private IP or
localhost
instead of the public IP/domain name the MQTT connection no longer throws an Exception.But then we come back to the same issue of not being able to send push notifications to any of the setup devices, which is most likely because the client device isn't able to interact with the server at port 31000 of our server.
Our firewall does allow TCP connections at port 31000, but this issue still occurs unfortunately
We verified the public address and domain multiple times too, but they were the same once we used on our browser.
Our main
ROOT.xml
that we updated to vary the MQTT address/uri (with public address that does not work):(The initial value for mqtt.server.uri - the domain name for the admin panel too throws the same error as public address along with the domain name instead)
Please help us out with setting up Push notifications/MQTT server correctly and do let us know if any other information is required
Thanks a lot for coming up with this open-source project, and for your valuable help and time!
The text was updated successfully, but these errors were encountered: