I'm trying to get the MQTT server from cloudMQTT work for me (while everything works with my home mqtt server).
I see in their documentation :
I get error in the initialization line:
Changed to tcp instead of mqtt, with this it passes the initialization but fails on client.connect, I get success = false in client_connect sub:
With ssl it is the same as in tcp.
Help please !
I see in their documentation :
I put the data of my project there in this b4a line:You are sometimes forced to format a connection URL while connecting via client libraries, it should look like mqtt://userassword@serverort .
B4X:
Private link As String = "mqtt://tfmntyfc:Z_IGRhMnk05F@m21.cloudmqtt.com:19289"
B4X:
client.Initialize("client",link, "WT"&Rnd(1,10000 ) )
*** Service (starter) Create ***
Error occurred on line: 19 (Starter)
java.lang.IllegalArgumentException: mqtt://tfmntyfc:Z_IGRhMnk05F@m21.cloudmqtt.com:19289
at org.eclipse.paho.client.mqttv3.MqttConnectOptions.validateURI(MqttConnectOptions.java:470)
at org.eclipse.paho.client.mqttv3.MqttAsyncClient.<init>(MqttAsyncClient.java:273)
at org.eclipse.paho.client.mqttv3.MqttAsyncClient.<init>(MqttAsyncClient.java:167)
at anywheresoftware.b4j.objects.MqttAsyncClientWrapper.Initialize(MqttAsyncClientWrapper.java:42)
...
Changed to tcp instead of mqtt, with this it passes the initialization but fails on client.connect, I get success = false in client_connect sub:
** Activity (main) Resume **
permit audio
(UnknownHostException) java.net.UnknownHostException: tfmntyfc:Z_IGRhMnk05F@m21.cloudmqtt.com
(UnknownHostException) java.net.UnknownHostException: tfmntyfc:Z_IGRhMnk05F@m21.cloudmqtt.com
Error occurred on line: 46 (Starter)
java.lang.reflect.InvocationTargetException
at java.lang.reflect.Method.invoke(Native Method)
at anywheresoftware.b4a.shell.Shell.runGoodChain(Shell.java:463)
at anywheresoftware.b4a.shell.Shell.raiseEventImpl(Shell.java:285)
at anywheresoftware.b4a.shell.Shell.raiseEvent(Shell.java:249)
at java.lang.reflect.Method.invoke(Native Method)
...
With ssl it is the same as in tcp.
Help please !