What does xenon fast flashing green mean?

It seems the discussion from this thread

has continued here.

@peekay123 you may find this interesting.

From the above mentioned discussion, X1 is the only device now running in threaded mode and this has no bearing on the following.

I did some more testing last night with a heartbeat signal originating on X3 endpoint and counted on X1 endpoint, setup is roughly linear as follows. X=Xenon, A=Argon, X1 cannot hear X3 inferred because removing X2, X3 never connects to the mesh, constantly flashing rapid green with intermittent yellow/orange/red. Put X2 back and X3 immedately breaths cyan.

X1-----15ft----A-----20ft-----X2-----15ft-----X3

Heartbeat (X3) is once a second using mesh.publish which includes a count as data and flashing the blue LED. X1 counts the number of received publishes and displays this and the count from the published data on the OLED display.

Started running with all units breathing cyan last night around 9pm. At 5am this morning the display is no longer counting, all units are breathing cyan but X3 is no longer sending publishes but worse than that it is no longer running the application code as the blue led is no longer flashing. Code is Tinker with a 1 second millis() counter to publish and flash the LED. X1 is running the OLED example with the extra counter code, everything else is running Tinker.

This morning the display on X1 was still counting seconds but heartbeat counts had stopped. Seconds counter read 33115, a bit more than 9 hours, Heartbeat count was 25185 and heartbeat data was 25322. The discrepancy shows some hearbeat publishes were missed but the heartbeat data shows X3 stopped sending heartbeats after 7hrs and 2 minutes.

As a second weirdness last night, when I went to OTA flash X3 I kept getting failed to flash from the web IDE. I moved X3 to within a foot or so of the Argon and still nothing after 5 tries, no response from X3. I opened the phone app to try tinker, it said it was on line but no response from trying to use tinker, could not set any pin to read or write. I thought maybe I don't have the right device. Opened the console and X3 is online, since it's running the latest firmware I tried running diagnostics which came back success. Then I signaled the device, X3 responded and the console immediately showed device came online, strange since it didn't go offline and passed diagnostics. Right after this OTA flashing was successful. This behaviour may be related to X3 no longer running the application code this morning but still showing as being online. Just tried now and it is also not responding to tinker. Tried diagnostics and it is passing as well. I'll have to try the signalling option when I get home tonight so I can observe what is happening and see if that magically makes it start sending heartbeats again. I'll report the results tonight.

The heartbeat code is as follows, simply added to tinker. I don't think I've done anything to cause it to stop running after 7hrs. only added variables and a few lines to loop()

unsigned long heartbeatTimer = millis();
uint32_t heartbeatCounter = 0;
bool ledState = FALSE;

/* Function prototypes -------------------------------------------------------*/
int tinkerDigitalRead(String pin);
int tinkerDigitalWrite(String command);
int tinkerAnalogRead(String pin);
int tinkerAnalogWrite(String command);

/* This function is called once at start up ----------------------------------*/
void setup()
{
	//Setup the Tinker application here

	//Register all the Tinker functions
	Particle.function("digitalread", tinkerDigitalRead);
	Particle.function("digitalwrite", tinkerDigitalWrite);
	Particle.function("analogread", tinkerAnalogRead);
	Particle.function("analogwrite", tinkerAnalogWrite);
	
	pinMode(D7, OUTPUT);

}

/* This function loops forever --------------------------------------------*/
void loop()
{
    if (millis() - heartbeatTimer >= 1000) {
        ledState = !ledState;
        digitalWrite(D7, ledState);
        heartbeatCounter++;
        Mesh.publish("BunnyHop", String(heartbeatCounter));
        heartbeatTimer = millis();
    }
	//This will run in a loop
}

/*******************************************************************************
 * Function Name  : tinkerDigitalRead
 * Description    : Reads the digital value of a given pin
 * Input          : Pin
 * Output         : None.
 * Return         : Value of the pin (0 or 1) in INT type
                    Returns a negative number on failure
 *******************************************************************************/
int tinkerDigitalRead(String pin)
{
	//convert ascii to integer
	int pinNumber = pin.charAt(1) - '0';
	//Sanity check to see if the pin numbers are within limits
	if (pinNumber< 0 || pinNumber >7) return -1;

	if(pin.startsWith("D"))
	{
		pinMode(pinNumber, INPUT_PULLDOWN);
		return digitalRead(pinNumber);
	}
	else if (pin.startsWith("A"))
	{
		pinMode(pinNumber+10, INPUT_PULLDOWN);
		return digitalRead(pinNumber+10);
	}
	return -2;
}

/*******************************************************************************
 * Function Name  : tinkerDigitalWrite
 * Description    : Sets the specified pin HIGH or LOW
 * Input          : Pin and value
 * Output         : None.
 * Return         : 1 on success and a negative number on failure
 *******************************************************************************/
int tinkerDigitalWrite(String command)
{
	bool value = 0;
	//convert ascii to integer
	int pinNumber = command.charAt(1) - '0';
	//Sanity check to see if the pin numbers are within limits
	if (pinNumber< 0 || pinNumber >7) return -1;

	if(command.substring(3,7) == "HIGH") value = 1;
	else if(command.substring(3,6) == "LOW") value = 0;
	else return -2;

	if(command.startsWith("D"))
	{
		pinMode(pinNumber, OUTPUT);
		digitalWrite(pinNumber, value);
		return 1;
	}
	else if(command.startsWith("A"))
	{
		pinMode(pinNumber+10, OUTPUT);
		digitalWrite(pinNumber+10, value);
		return 1;
	}
	else return -3;
}

/*******************************************************************************
 * Function Name  : tinkerAnalogRead
 * Description    : Reads the analog value of a pin
 * Input          : Pin
 * Output         : None.
 * Return         : Returns the analog value in INT type (0 to 4095)
                    Returns a negative number on failure
 *******************************************************************************/
int tinkerAnalogRead(String pin)
{
	//convert ascii to integer
	int pinNumber = pin.charAt(1) - '0';
	//Sanity check to see if the pin numbers are within limits
	if (pinNumber< 0 || pinNumber >7) return -1;

	if(pin.startsWith("D"))
	{
		return -3;
	}
	else if (pin.startsWith("A"))
	{
		return analogRead(pinNumber+10);
	}
	return -2;
}

/*******************************************************************************
 * Function Name  : tinkerAnalogWrite
 * Description    : Writes an analog value (PWM) to the specified pin
 * Input          : Pin and Value (0 to 255)
 * Output         : None.
 * Return         : 1 on success and a negative number on failure
 *******************************************************************************/
int tinkerAnalogWrite(String command)
{
	//convert ascii to integer
	int pinNumber = command.charAt(1) - '0';
	//Sanity check to see if the pin numbers are within limits
	if (pinNumber< 0 || pinNumber >7) return -1;

	String value = command.substring(3);

	if(command.startsWith("D"))
	{
		pinMode(pinNumber, OUTPUT);
		analogWrite(pinNumber, value.toInt());
		return 1;
	}
	else if(command.startsWith("A"))
	{
		pinMode(pinNumber+10, OUTPUT);
		analogWrite(pinNumber+10, value.toInt());
		return 1;
	}
	else return -2;
}
1 Like