<html><head></head><body><div style="color:#000; background-color:#fff; font-family:lucida console, sans-serif;font-size:16px"><div id="yui_3_16_0_ym19_1_1466164138870_6242" dir="ltr">I think I have seen this on some other drivers (maybe yaesu or baofeng?). I thought the ugly, but acceptably working solution, was to just chew the extra ack if encountered. This is assuming that you read, or flush, the entire receive buffer from radio, rather than just one byte, after sending a "frame" and checking the first byte received is ack.</div><div id="yui_3_16_0_ym19_1_1466164138870_6419" dir="ltr"><br></div><div id="yui_3_16_0_ym19_1_1466164138870_6196" class="qtdSeparateBR"><br><br></div><div style="display: block;" id="yui_3_16_0_ym19_1_1466164138870_6282" class="yahoo_quoted"> <div id="yui_3_16_0_ym19_1_1466164138870_6281" style="font-family: lucida console, sans-serif; font-size: 16px;"> <div id="yui_3_16_0_ym19_1_1466164138870_6280" style="font-family: HelveticaNeue, Helvetica Neue, Helvetica, Arial, Lucida Grande, sans-serif; font-size: 16px;"> <div id="yui_3_16_0_ym19_1_1466164138870_6291" dir="ltr"> <font id="yui_3_16_0_ym19_1_1466164138870_6299" face="Arial" size="2"> <hr id="yui_3_16_0_ym19_1_1466164138870_6298" size="1"> <b><span style="font-weight:bold;">From:</span></b> Jim Unroe via chirp_devel <chirp_devel@intrepid.danplanet.com><br> <b><span style="font-weight: bold;">To:</span></b> chirp-devel <chirp_devel@intrepid.danplanet.com> <br> <b><span style="font-weight: bold;">Sent:</span></b> Thursday, June 16, 2016 9:08 PM<br> <b><span style="font-weight: bold;">Subject:</span></b> [chirp_devel] Random double ACK during upload<br> </font> </div> <div id="yui_3_16_0_ym19_1_1466164138870_6279" class="y_msg_container"><br>I am working with a radio that I am having a problem with the upload<br>procedure. Normally, after a "frame" is sent, the radio replies with<br>an ACK and the programming software sends the next "frame", another<br>ACK is received and so on.<br><br>The problem is that randomly the radio with reply with 2 ACKs instead<br>of 1. Currently my upload progresses fine until the double ACK is<br>encountered.<br><br>My upload code is below. Does anyone have any suggestions for how I<br>can bypass these occasional extra ACKs?<br><br>Thanks in advance,<br>Jim<br><br>def _upload(radio):<br> """Upload procedure"""<br><br> MEM_SIZE = 0x7000<br><br> # put radio in program mode and identify it<br> _do_ident(radio)<br><br> # UI progress<br> status = chirp_common.Status()<br> status.cur = 0<br> status.max = MEM_SIZE / BLOCK_SIZE<br> status.msg = "Cloning to radio..."<br> radio.status_fn(status)<br><br> # the fun start here<br> for addr in range(0, MEM_SIZE, BLOCK_SIZE):<br> # sending the data<br> data = radio.get_mmap()[addr:addr + BLOCK_SIZE]<br><br> frame = _make_frame("W", addr, BLOCK_SIZE, data)<br><br> _send(radio, frame)<br><br> # receiving the response<br> ack = _rawrecv(radio, 1)<br> if ack != "\x06":<br> msg = "Bad ack writing block 0x%04x" % addr<br> raise errors.RadioError(msg)<br><br> # UI Update<br> status.cur = addr / BLOCK_SIZE<br> status.msg = "Cloning to radio..."<br> radio.status_fn(status)<br><br> _exit_program_mode(radio)<br>_______________________________________________<br>chirp_devel mailing list<br><a ymailto="mailto:chirp_devel@intrepid.danplanet.com" href="mailto:chirp_devel@intrepid.danplanet.com">chirp_devel@intrepid.danplanet.com</a><br><a href="http://intrepid.danplanet.com/mailman/listinfo/chirp_devel" target="_blank">http://intrepid.danplanet.com/mailman/listinfo/chirp_devel</a><br>Developer docs: <a href="http://chirp.danplanet.com/projects/chirp/wiki/Developers" target="_blank">http://chirp.danplanet.com/projects/chirp/wiki/Developers</a><br><br><br></div> </div> </div> </div></div></body></html>