Hello,
I have a Ewon Flexy205 and I sending MQTT data. It needs BASIC (or java) code for do it.
I have problems with the code in the MQTT connection with my HIVEMQ cloud.
I wanna put a code thats is working actually for connection with IoTHub Azure. I need to know what I have to addpat for HIVEMQ cloud.
THE CODE IS:
CONNECTMQTT:
MQTT “OPEN”, SerNum$ , MQTTBrokerURL$
MQTT “SETPARAM”, “PORT”, MQTTPort$
MQTT “SETPARAM”, “LOG”, “1”
MQTT “SETPARAM”, “KEEPALIVE”, “20”
MQTT “SETPARAM”, “TLSVERSION”, “tlsv1.2”
MQTT “SETPARAM”, “PROTOCOLVERSION”, “3.1.1”
MQTT “SETPARAM”, “cafile”,"/usr/BaltimoreCyberTrustRoot.pem"
MQTT “SETPARAM”, “CertFile”,"/usr/"+DeviceId$+".crt"
MQTT “SETPARAM”, “KeyFile”,"/usr/"+DeviceId$+".key"
//AZURE//
MQTT “SETPARAM”,“Username”,IotHubName$+ “.azure-devices.net/”+DeviceId$+"/api-version=2016-11-14"
MQTT “SETPARAM”,“Password”,“HostName=”+IotHubName$+";DeviceID="+DeviceId$+";x509=true"
MQTT “SETPARAM”, “WILLTOPIC”, “/willtopic”
MQTT “SETPARAM”, “WILLPAYLOAD”, “Flexy " + SerNum$ + " is disconnected”
MQTT “SUBSCRIBE”,TopicToSubscribe$,1
//Launch the MQTT process in the background
SETSYS PRG,“RESUMENEXT”,1 //Continue in case of error at MQTT “CONNECT”
MQTT “CONNECT”
END CODE
Can anyone help me to adapt this code to HIVE connetion
Thanks so much
Jose