Cant connect my esp8266 module with cayenne

I have been working on my IoT project and using cayenne as a cloud. I have been facing issues connecting my esp8266 module to cayenne. Technically it should redirect me to cayenne once i upload my code into the module but it dint redirect even though i uploaded the code in the module. I put the exact credentials as given to me in my code and still it dint work. please help me on it asap. would be grateful for the help
Below i have pasted my code for your reference
#include <CayenneMQTTESP8266.h>
#include <ESP8266WiFi.h>
#include <DHT.h>
#include <Adafruit_NeoPixel.h>
#ifdef AVR
#include <avr/power.h>
#endif

#define DHTPIN 4 // setting dht11 pin
#define DHTTYPE DHT11// setting type of the dht

#define PIN D5 // neopixel pin conected to d5
#define NUMPIXELS 12 // number of leds in neopixel ring
#define buzzer D7// set buzzer pin

DHT dht(DHTPIN, DHTTYPE);// object for dht11
Adafruit_NeoPixel pixels = Adafruit_NeoPixel(NUMPIXELS, PIN, NEO_GRB + NEO_KHZ800);// object for neopixel

char ssid = “”;
char password = “”;
char username = “2028fbc0-c42d-11e9…”;
char mqtt_password = “7f6f083633898…”;
char client_id = “61cae4d0-c…”;

const int LDRpin = A0;// ldr pin
const int PIRpin = D0;// pir pin
int LDRval = 0;// for reading ldr value
int PIRval = 0;// for reading pir value
int temp;// for reading temperature value from dht11
int hum;// for reading humidity value from dht11

int r,g,b;// variables for storing red green and blue led mix values
int Cmode;// variable for storing security mode activate or deactivate
int TURN;// variable for manuale mode
int SAFE_MODE;// variable for false safe mode

void setup()
{
pinM
}

hum = dht.readHumidity();// storing humidity value to hum variable
temp = dht.readTemperature();//storing temperature value to temp variable
LDRval = analogRead(LDRpin);// read and store ldr value
PIRval = digitalRead(PIRpin); // read and store pir value
Serial.println(PIRval);

// send all sensor values to cayenne
Cayenne.virtualWrite(0,temp);
Cayenne.virtualWrite(1,hum);
Cayenne.virtualWrite(2,LDRval);
Cayenne.virtualWrite(3,PIRval);

// checking temperature or humidity is in dangerous level
if(hum>85&&hum<15){
digitalWrite(buzzer,HIGH);
}
if(temp>40&&temp<10)
{
digitalWrite(buzzer,HIGH);
}

// checking false safe mode
if(SAFE_MODE==1)
{
digitalWrite(buzzer,LOW);
}

}

void setColor(int red,int green,int blue)
{
for(int i =0;i<=NUMPIXELS;i++)// set every led into the color
{
pixels.setPixelColor(i,pixels.Color(red,green,blue));// seting color neopixel

pixels.show();// activate neopixel

}
}

void setLight()// checking manual mode active or not
{

if(TURN==1)
{
manual();
}

else
{
if(PIRval>0)
{
setColor(r,g,b);
}
else if(LDRval<30)
{
setColor(r,g,b);
}

else if(PIRval<1&&LDRval>10)
{
setColor(0,0,0);
}

}
}

void buglerMode()// bugler mode’s function
{

if(SAFE_MODE==1)
{
digitalWrite(buzzer,LOW);
}

if(PIRval>0)

{

digitalWrite(buzzer,HIGH);
Serial.println(“bugler on”);
}

}

void manual()// manual mod’s function
{

setColor(r,g,b);
}

//recieve values from cayenne

CAYENNE_IN(4)

{

r= getValue.asInt();// recieve red value for neopixel from cayenne

}
CAYENNE_IN(5)
{

g= getValue.asInt();// recieve green value for neopixel from cayenne

}

CAYENNE_IN(6)
{

b= getValue.asInt();// recieve blue value for neopixel from cayenne

}

CAYENNE_IN(7)
{
Cmode =getValue.asInt();// recieve commands for security mode
Serial.println(Cmode);
}

CAYENNE_IN(8)
{
TURN = getValue.asInt();// recieve commands for manual mode
}

CAYENNE_IN(9)
{
SAFE_MODE = getValue.asInt();// recieve commands for false safe
}

can you share me the correct code? that code, first of all, won’t compile and upload onto your device.

it worked for me though. Freshly compiled the code now. again i have pasted the code below

#include <CayenneMQTTESP8266.h>
#include <ESP8266WiFi.h>
#include <DHT.h>
#include <Adafruit_NeoPixel.h>
#ifdef AVR
#include <avr/power.h>
#endif
#define DHTPIN 4 // setting dht11 pin
#define DHTTYPE DHT11// setting type of the dht
#define PIN D5 // neopixel pin conected to d5
#define NUMPIXELS 12 // number of leds in neopixel ring
#define buzzer D7// set buzzer pin
DHT dht(DHTPIN, DHTTYPE);// object for dht11
Adafruit_NeoPixel pixels = Adafruit_NeoPixel(NUMPIXELS, PIN, NEO_GRB + NEO_KHZ800);// object for neopixel
char ssid = “Glo”;
char password = “123456”;
char username = “2028fbc0-c42d-11e9-80af-177b80d8d7b2”;
char mqtt_password = “7f6f083633898d4a9741842d36d93f622acef44c”;
char client_id = “61cae4d0-c42d-11e9-b6c9-25dbdbf93e02”;
const int LDRpin = A0;// ldr pin
const int PIRpin = D0;// pir pin
int LDRval = 0;// for reading ldr value
int PIRval = 0;// for reading pir value
int temp;// for reading temperature value from dht11
int hum;// for reading humidity value from dht11
int r,g,b;// variables for storing red green and blue led mix values
int Cmode;// variable for storing security mode activate or deactivate
int TURN;// variable for manuale mode
int SAFE_MODE;// variable for false safe mode
void setup()
{
pinMode(LDRpin,INPUT);// …|
pinMode(PIRpin,INPUT);//…| Seting sensors and modules input or output
pinMode(buzzer,OUTPUT);//…|
dht.begin();// starting dht11 sensor
Serial.begin(9600);
Cayenne.begin(username,mqtt_password,client_id,ssid,password);// starting cayenne
pixels.begin(); // start neopixel ring
Serial.println(“FIRE FLY BOOTED”);
}
void loop()
{
Cayenne.loop();
// checking secuirity mode activated!
if(Cmode==1)
{
buglerMode();// if secuirity mode active will call bugler mode function
}
else if(Cmode<1){
setLight();// if not active then call setlight function
}
hum = dht.readHumidity();// storing humidity value to hum variable
temp = dht.readTemperature();//storing temperature value to temp variable
LDRval = analogRead(LDRpin);// read and store ldr value
PIRval = digitalRead(PIRpin); // read and store pir value
Serial.println(PIRval);
// send all sensor values to cayenne
Cayenne.virtualWrite(0,temp);
Cayenne.virtualWrite(1,hum);
Cayenne.virtualWrite(2,LDRval);
Cayenne.virtualWrite(3,PIRval);
// checking temperature or humidity is in dangerous level
if(hum>85&&hum<15){
digitalWrite(buzzer,HIGH);
}
if(temp>40&&temp<10)
{
digitalWrite(buzzer,HIGH);
}
// checking false safe mode
if(SAFE_MODE==1)
{
digitalWrite(buzzer,LOW);
}
}
void setColor(int red,int green,int blue)
{
for(int i =0;i<=NUMPIXELS;i++)// set every led into the color
{
pixels.setPixelColor(i,pixels.Color(red,green,blue));// seting color neopixel
pixels.show();// activate neopixel
}
}
void setLight()// checking manual mode active or not
{
if(TURN==1)
{
manual();
}
else
{
if(PIRval>0)
{
setColor(r,g,b);
}
else if(LDRval<30)
{
setColor(r,g,b);
}
else if(PIRval<1&&LDRval>10)
{
setColor(0,0,0);
}
}
}
void buglerMode()// bugler mode’s function
{
if(SAFE_MODE==1)
{
digitalWrite(buzzer,LOW);
}
if(PIRval>0)
{
digitalWrite(buzzer,HIGH);
Serial.println(“bugler on”);
}
}
void manual()// manual mod’s function
{
setColor(r,g,b);
}
//recieve values from cayenne
CAYENNE_IN(4)
{
r= getValue.asInt();// recieve red value for neopixel from cayenne
}
CAYENNE_IN(5)
{
g= getValue.asInt();// recieve green value for neopixel from cayenne
}
CAYENNE_IN(6)
{
b= getValue.asInt();// recieve blue value for neopixel from cayenne
}
CAYENNE_IN(7)
{
Cmode =getValue.asInt();// recieve commands for security mode
Serial.println(Cmode);
}
CAYENNE_IN(8)
{
TURN = getValue.asInt();// recieve commands for manual mode
}
CAYENNE_IN(9)
{
SAFE_MODE = getValue.asInt();// recieve commands for false safe
}
//------------------------GLO -v1.0----------------------------------------------

can you try this basic code Cayenne-MQTT-Arduino/ESP8266.ino at master · myDevicesIoT/Cayenne-MQTT-Arduino · GitHub

got errors while uploading

check if you have selected the device port in thr arduino ide tools.

sorry i had not. i did it and it got uploaded. still it did no redirect me to cayenne

add #define CAYENNE_DEBUG on top of your code and open serial monitor. Share what is the output there.

its blank bro

press the reset button on the esp.

It shows this

check your wifi credentials if they are correct. stuck at that means the device is not able to find the wifi or the wifi password for glo is wrong.

how do i do that? cause during the start i had just put char ssid as glo and password as 123456 in the code

Actually even though i have connected it to my computer, in my laptop wifi settings nothing reflects regarding the module like how it normally does for a wifi router

what do you mean by this? you need to add the valid ssid and password of your wifi router so that the esp connects to the internet.