i was trying to connect my gsm module with cloudmqtt as shown here. but apparently it shows “Invalid protocol version 3 in CONNECT from 103.67.157.128.” what’s the correct version? and how can i include it?
this is the declaration part of my code
const char * __APN = "blweb";
const char * __usrnm = “”;
const char * __password = “”;
unsigned int Counter = 0;
unsigned long datalength, checksum, rLength;
unsigned short topiclength;
unsigned short topiclength2;
unsigned char topic[30];
char str[250];
unsigned char encodedByte;
int X;
unsigned short MQTTProtocolNameLength;
unsigned short MQTTClientIDLength;
unsigned short MQTTUsernameLength;
unsigned short MQTTPasswordLength;
unsigned short MQTTTopicLength;
const char * MQTTHost = “m14.cloudmqtt.com”;
const char * MQTTPort = “12079”;
const char * MQTTClientID = “iqbalpc”;
const char * MQTTTopic = “iqbal-test/testiqbal”;
const char * MQTTTopic2 = “SampleTopic2”;
const char * MQTTProtocolName = “MQTT”;
const char MQTTLVL = 0x03;
const char MQTTFlags = 0xC2;
const unsigned int MQTTKeepAlive = 60;
const char * MQTTUsername = “vyjqvhjo”;
const char * MQTTPassword = “FtSoD9s76Qo4”;
const char MQTTQOS = 0x00;
const char MQTTPacketID = 0x0001;