Particle breathing cyan and green

Hey! I’ve recently acquired my Particle photon and was trying to set it up and flash code. It was successful the first time and I connected it with my project and seemed to work. But I needed to add an LCD with I2C and though making the changes in the code by including Liquid crystal I2C library would help. But I didn’t enter the wire begin () line and flashed it. It started breathing green. I tried to change the code and add the original one and bring it to safe mode and was successful. But after that, it just started breathing cyan then green then rapidly blinking cyan and repeat. I can’t seem to put it in safe mode or DFU mode at all. I’ve tried accessing it via CLI but on Mac, it’s not working. I don’t know what else to do.
I’ve enclosed the original code :


#include <LiquidCrystal.h>

LiquidCrystal lcd(6, 5, 0, 1, 2, 3);
float reading = 0;
float Temperature = 0;
float temp1 = 0;
float volts = 0;
float value = 0;
float volt  = 0;
float lux  = 0;
byte degree[8] =
              {
                0b00011,
                0b00011,
                0b00000,
                0b00000,
                0b00000,
                0b00000,
                0b00000,
                0b00000
              };

void setup() {
  Serial.begin(9600);
  lcd.begin(16,2);
  lcd.createChar(1, degree);
  lcd.setCursor(0,0);
  lcd.print("IoT Solar Param.r ");
  lcd.setCursor(0,1);
  lcd.print("  Monitoring   ");
  delay(2000);
  lcd.clear();
  lcd.setCursor(0,0);
  lcd.print("By Jasmine & Tanushree ");
  delay(2000);
  lcd.clear();
  pinMode(A0, INPUT);
  pinMode(A1, INPUT);
  pinMode(A2, INPUT);
}

void loop() {
  /*---------Temperature-------*/
  reading=analogRead(A2);
  Temperature=(reading*3.3*100)/4096;
   delay(10);
  /*---------Voltage----------*/
  temp1=analogRead(A1);
  volts= (temp1*3.3)/4096;
  delay(10);
  /*-----Light Intensity------*/
  lux=analogRead(A0);
  //volt=(value/1023.0)*5;
  //lux=((2500/volt)-500)/3.3;
  delay(10);
 /*------Display Result------*/
  lcd.clear();
  lcd.setCursor(0,0);
  lcd.print("T:");
  lcd.print((int)Temperature);
  lcd.write(1);
  lcd.print("C");
  lcd.setCursor(8,0);
  lcd.print("V:");
  lcd.print(volts);
  lcd.setCursor(0,1);
  lcd.print("Intens: ");
  lcd.print((int)lux);
  lcd.print(" Lux");
  //Serial.println((int)Temp);
  // Serial.println(volts);
  // Serial.println((int)lux);
  //delay(500);
 Particle.publish("Voltage", String(volts));
 Particle.publish("Temperature", String(Temperature));
 Particle.publish("Light Intensity", String(lux));
 delay(2000);
 Particle.process();
}

If anyone could suggest something it’d be of great help

Welcome to the community :+1:

The I2C lines on the Photon are D0/D1 and you are using 0/1 in your instantiation of lcd.
I don’t think that’s supposed to be.
BTW, we recommend you use the pin labels (D1, D2, …) rather than anonymous pin numbers (1, 2, …).

How are you trying?

You are also calling Particle.publish() three times with only 2 seconds between, this will eventually lead to your code running into the rate limit of 1 publish per second.
I’d suggest you unify your three readings into one single publish like this

  char data[64];
  snprintf(data, sizeof(data), "%.1f V, %.1f °C, %.1f lux", volts, Temperature, lux);
  Particle.publish("redings", data);
  delay(2000); // 1000 should be enough for the rate limit

This library also doesn’t appear to support an I2C display.

Okay I’ll try to change that in the code . As for I2C, we didn’t use those pin labels but flashed the code and now it’s not connecting to the cloud to change the code.I’ve tried holding Setup and Reset buttons down, releasing reset and holding Setup button but it never goes magenta or yellow…it just rapidly blinks cyan and then breathes cyan and green.

This could indicate a bad SETUP button. Maybe pressing it a bit harder may help.
Alternatively you could try bridging the soldering pad 26 to GND.

Or if you had a fairly recent device OS on the device you can use CLI particle usb dfu to send the device into DFU Mode via USB or particle usb safe-mode for Safe Mode).

The device is fairly recent. I can’t seem to use the CLI on MAC so I’ll try again on Windows and see if it works.

I’ve tried using through CLI but it’s displaying an error USB not supported