I wanted to know a simple way to validate that the data from a particle.subscribe call from a 2nd Photon is being received. I have set up the 1st Photon to monitor temperature & humidity, send the data to the Particle Cloud and Ubidots using particle.publish. In the CLI, I can subscribe and view the data as it is published by the 1st Photon, so I know the event is publishing. Is there a simple way to verify that the 2nd Photon is receiving the data from the subscription? The simple code I’ve implemented on the 2nd Photon is:
int i = 0;
void myHandler(const char *event, const char *data)
{
i++;
Serial.print(i);
Serial.print(event);
Serial.print(", data: ");
if (data)
Serial.println(data);
else
Serial.println("NULL");
}
void setup()
{
Particle.subscribe("AbsoulteHumidity_Photon1", myHandler, MY_DEVICES);
Serial.begin(9600);
}
The publish code is:
//Publish to Particle
Particle.publish("AbsoluteHumidity_Photon1", String(humidity_a), 60, PRIVATE);
There is no output from the serial monitor, which leads me to believe that the subscription is not functioning properly. Any direction is welcome. Thanks!