Particle publish WITH_ACK still not working properly

This has been mentioned before here without resolution more than a year ago

Publishing WITH_ACK is not giving the desired results. The following code is very hit and miss when it comes to actually publishing the event but never fails the ACK portion.

SYSTEM_THREAD(ENABLED);

SYSTEM_MODE(MANUAL);

STARTUP(System.enableFeature(FEATURE_RETAINED_MEMORY));

retained int count = 0;

void setup() {
    count++;
    Particle.connect();
    while (!WiFi.ready()){
        delay(10);       
    }
    
    while (!Particle.connected()){
        delay(10);       
    }	
	 bool success = Particle.publish("JSTest", String(count), WITH_ACK);
	 if(!success) {
            RGB.control(TRUE);
            RGB.color(255,0,0);
            delay(250);
            RGB.control(FALSE);
        }  
	 //delay(3000);
	 Particle.disconnect();
	 System.sleep(SLEEP_MODE_DEEP,10);
}

It behaves the same with or without SYSTEM_THREAD(ENABLED) and the same on 0.7.0 and 0.8.0-rc.2. Adding the 3 second delay solves the issue but I thought that is what the WITH_ACK is supposed to do.

It will publish first time after the program is uploaded, then maybe 2 or 3 more times then skip many and start again at a count of 19 and skip a bunch more and start at 30, 31, 32, then skip a few more and start again around 60ish. Different every time, very intermittent.

Am I doing something else wrong or is this bug still being worked on?

Thanks,
Joerg

With long standing bugs it’s best to comment on the relevant GitHub issues (including closed ones to be reopened) or open a new one (possibly referencing closed issues)

Possible candidates
https://github.com/particle-iot/firmware/issues/1165
https://github.com/particle-iot/firmware/issues/1034

@ScruffR I appreciate your faith in me to poke around on github. I see the issues have for some reason been closed but obviously either not tested or broken again by someone else’s fixes elsewhere. I guess it is also possible that a hole has been dug that is nearly impossible to get out of. :grimacing:

I’m not proficient at that level so I though someone with more experience and applicable lingo than I open and close issues on Github. The last thing I want to do is irritate the particle team by breaking something when all considered I’m blown away with how well this whole ecosystem works.

My only suggestion would be to remove this functionality from the documentation when it clearly is not doing what is intended, saving a lot of head scratching and wasted time.

I’ve given it shot on github, hope I haven’t stepped on any toes.:no_mouth:

Thanks,
Joerg

Since I haven't tested it I trust that your experience is indicating a still open (or reemerged) bug and hence it should be fixed. I'm also convinced noone at Particle isn't offended by bringing up any issue since that will only help improving stability and user experience.

3 Likes