I was publishing message using Particle.publish command that repeat every 40 sec and was running successfully and message appear in Event Log without any message drop, after increase the publish time interval to 60 sec, It drops messages randomly but in most cases a message appear in Event log every 3 minutes in most cases and 2 minutes in rare cases.
I add some functions to code to investigate and figure problem plus adding solution found in other thread.
I first add
void setup()
{
Particle.keepAlive(20);
}
and did not solve the solution and I did not found "device came online" packet in Event log every 20 sec as programmed ("device came online" appear in Event log randomly) , then adding
void loop() {
Particle.process();
and also did not solve publish message or send "device came online" packet.
So I add check if publish successfully send message and so I add WITH_ACK flag.
temp = Particle.publish("Message", message,PRIVATE,WITH_ACK);
if (!temp) {
// get here if event publish did not work
#ifdef SERIAL_DEBUG
Serial.printlnf( "Error sending Message" );
#endif
}
and I found that some message packet did not appear in Event Log and error message appear in serial monitor terminal.
the Electron Version is v 0.6.2 with SYSTEM_MODE(SEMI_AUTOMATIC);