Cloudmqtt shows invalid protocol level

i was trying to connect my gsm module with cloudmqtt as shown here. but apparently it shows “Invalid protocol version 3 in CONNECT from” 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 = “”;
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;

The protocol name that worked for me when using cloudmqtt is MQIsdp. You can try that in protocol name field. I think latest is 3.1.1