@bantonsson I think the problem can be here, if the write fails I don't think that the lastAck should be cleared (same thing in old code)