Ewon Technical Forum

Full Version: Getting Started with MQTT on your Flexy using JAVA.
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Pages: 1 2
Hi,

Do you well call the DefaultEventHandler.runEventManager(); function in the main class ??
You can send your project via private message if you want, I will check it.

Simon
MyCode


 MyMQTTClient Mqtt_c = new MyMQTTClient(
        Sys.getItem("SerNum"),
        "879a42555ead4dc799a2dd0ed14adddd.s1.eu.hivemq.cloud"
      );

      Mqtt_c.setOption("port", "8883");
      Mqtt_c.setOption("username", "test");
      Mqtt_c.setOption("password", "test");
      Mqtt_c.setOption("log", "1");
      Mqtt_c.connect();

      Mqtt_c.subscribe("/topic/readmsg", 0);



don't know where am I doing wrong??


Default code is working fine i.e,

MyMQTTClient Mqtt_c = new MyMQTTClient(
        Sys.getItem("SerNum"),
        ""ewonsupport.biz""
      );

      Mqtt_c.setOption("port", "1883");
      Mqtt_c.setOption("log", "1");
      Mqtt_c.connect();

      Mqtt_c.subscribe("/topic/readmsg", 0);

on debugging I found out that data is getting sent at mqtt without any problem but my hive server is mqtts protocol..
how to connect on mqtts ..
Hi,

First of all, the Flexy is currently not compatible with HiveMQ.
However the next firmware for Flexy will fix the problem. It is expected to get it end of August/Beg of September.

To set the MQTTs, you actually must define a least the CA certificate used to sign the MQTT broker certificate using the
Mqtt_c.setOption("cacert", "/usr/letsencrypt.crt");

You can find an example on https://techforum.ewon.biz/thread-939.ht...azure+java
Pages: 1 2