# Particle publish WITH\_ACK still not working properly

**URL:** <https://community.particle.io/t/particle-publish-with-ack-still-not-working-properly/41922>\
**Category:** Troubleshooting\
**Created:** [May 20, 2018, 3:12am UTC](https://community.particle.io/t/particle-publish-with-ack-still-not-working-properly/41922 "2018-05-20T03:12:29Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Jseiler](https://sea2.discourse-cdn.com/flex026/user_avatar/community.particle.io/jseiler/32/6428_2.png) [@Jseiler](https://community.particle.io/u/Jseiler)\
**Post date:** [May 20, 2018, 3:12am UTC](https://community.particle.io/t/particle-publish-with-ack-still-not-working-properly/41922/1 "2018-05-20T03:12:29Z")

</div>

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

> [@Particle publish with WITH\_ACK not working properly?](https://community.particle.io/t/particle-publish-with-with-ack-not-working-properly/30582):
>
> hello, to save battery we want the photon to deep sleep as much as possible. the 0.6.1 Particle.publish option WITH\_ACK should finish the publish before returning according the documentation. but the code below does not publish anything (most of the time, on occasion it will publish). only when i add back the 3 seconds delay it will consistently publish the event. we do see the publish taking much longer (\> 100 ms) with the WITH\_ACK compared to without (\< 10 ms). are we doing something wrong?…

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.

```cpp
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

---

<div class="post-metadata">

**Author:** ![ScruffR](https://sea2.discourse-cdn.com/flex026/user_avatar/community.particle.io/scruffr/32/6952_2.png) [@ScruffR](https://community.particle.io/u/ScruffR)\
**Post date:** [May 20, 2018, 3:31am UTC](https://community.particle.io/t/particle-publish-with-ack-still-not-working-properly/41922/2 "2018-05-20T03:31:35Z")

</div>

With long standing bugs it’s best to comment on the relevant [GitHub issues](https://github.com/particle-iot/firmware/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/1165)  
[https://github.com/particle-iot/firmware/issues/1034](https://github.com/particle-iot/firmware/issues/1034)

---

<div class="post-metadata">

**Author:** ![Jseiler](https://sea2.discourse-cdn.com/flex026/user_avatar/community.particle.io/jseiler/32/6428_2.png) [@Jseiler](https://community.particle.io/u/Jseiler)\
**Post date:** [May 20, 2018, 4:51am UTC](https://community.particle.io/t/particle-publish-with-ack-still-not-working-properly/41922/3 "2018-05-20T04:51:23Z")

</div>

@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. 😬

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.😶

Thanks,  
Joerg

---

<div class="post-metadata">

**Author:** ![ScruffR](https://sea2.discourse-cdn.com/flex026/user_avatar/community.particle.io/scruffr/32/6952_2.png) [@ScruffR](https://community.particle.io/u/ScruffR)\
**Post date:** [May 20, 2018, 5:41am UTC](https://community.particle.io/t/particle-publish-with-ack-still-not-working-properly/41922/4 "2018-05-20T05:41:43Z")

</div>

> [@Jseiler](#):
>
> hope I haven’t stepped on any toes.😶

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.
