Hi,
let's back to the track
I'm publishing from my Photon for years with no problem at all !!!
but I just checking for Particle.connected() something like this:
if (Particle.connected()) Particle.publish("All_data", status, 60, PRIVATE);
and the status is formatted like this:
snprintf(status, sizeof(status),"{\"sensor_data\": %s, \"extender_data\": %s, \"FIRMWARE_CLASS\": \"%s\", \"Ver\": %f, \"wifi_name\": \"%s\", \"wifi_sig_str\": %d }"
,msg
,msg2
,FIRMWARE_CLASS
,FIRMWARE_VERSION
, WiFi.SSID()
,(int8_t)WiFi.RSSI());
all of this is in function
void publishStatus()
then I call this
publishStatus();
within the loop every 2 sec
#define DEBUG_INTERVAL_SECS 2
int n = 0;
unsigned long interval = 0;
void publishStatus(){
snprintf(status, sizeof(status),"{\"sensor_data\": %s, \"extender_data\": %s, \"FIRMWARE_CLASS\": \"%s\", \"Ver\": %f, \"wifi_name\": \"%s\", \"wifi_sig_str\": %d }",msg, msg2, FIRMWARE_CLASS, FIRMWARE_VERSION, WiFi.SSID(), (int8_t)WiFi.RSSI());
if (Particle.connected()) Particle.publish("All_data", status, 60, PRIVATE);
}
void setup(){
some setup stuff .....
....
....
}
void loop(){
if (millis() - interval > 1000) {
interval = millis();
some other stuff .....
....
....
n++;
if (n > DEBUG_INTERVAL_SECS ){
n = 0;
publishStatus();
}
some other stuff .....
....
....
}
}
So as @ScruffR mentioned we will need to see your code to determinate what's going on