[chirp_devel] Random double ACK during upload
I am working with a radio that I am having a problem with the upload procedure. Normally, after a "frame" is sent, the radio replies with an ACK and the programming software sends the next "frame", another ACK is received and so on.
The problem is that randomly the radio with reply with 2 ACKs instead of 1. Currently my upload progresses fine until the double ACK is encountered.
My upload code is below. Does anyone have any suggestions for how I can bypass these occasional extra ACKs?
Thanks in advance, Jim
def _upload(radio): """Upload procedure"""
MEM_SIZE = 0x7000
# put radio in program mode and identify it _do_ident(radio)
# UI progress status = chirp_common.Status() status.cur = 0 status.max = MEM_SIZE / BLOCK_SIZE status.msg = "Cloning to radio..." radio.status_fn(status)
# the fun start here for addr in range(0, MEM_SIZE, BLOCK_SIZE): # sending the data data = radio.get_mmap()[addr:addr + BLOCK_SIZE]
frame = _make_frame("W", addr, BLOCK_SIZE, data)
_send(radio, frame)
# receiving the response ack = _rawrecv(radio, 1) if ack != "\x06": msg = "Bad ack writing block 0x%04x" % addr raise errors.RadioError(msg)
# UI Update status.cur = addr / BLOCK_SIZE status.msg = "Cloning to radio..." radio.status_fn(status)
_exit_program_mode(radio)
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.
From: Jim Unroe via chirp_devel chirp_devel@intrepid.danplanet.com To: chirp-devel chirp_devel@intrepid.danplanet.com Sent: Thursday, June 16, 2016 9:08 PM Subject: [chirp_devel] Random double ACK during upload
I am working with a radio that I am having a problem with the upload procedure. Normally, after a "frame" is sent, the radio replies with an ACK and the programming software sends the next "frame", another ACK is received and so on.
The problem is that randomly the radio with reply with 2 ACKs instead of 1. Currently my upload progresses fine until the double ACK is encountered.
My upload code is below. Does anyone have any suggestions for how I can bypass these occasional extra ACKs?
Thanks in advance, Jim
def _upload(radio): """Upload procedure"""
MEM_SIZE = 0x7000
# put radio in program mode and identify it _do_ident(radio)
# UI progress status = chirp_common.Status() status.cur = 0 status.max = MEM_SIZE / BLOCK_SIZE status.msg = "Cloning to radio..." radio.status_fn(status)
# the fun start here for addr in range(0, MEM_SIZE, BLOCK_SIZE): # sending the data data = radio.get_mmap()[addr:addr + BLOCK_SIZE]
frame = _make_frame("W", addr, BLOCK_SIZE, data)
_send(radio, frame)
# receiving the response ack = _rawrecv(radio, 1) if ack != "\x06": msg = "Bad ack writing block 0x%04x" % addr raise errors.RadioError(msg)
# UI Update status.cur = addr / BLOCK_SIZE status.msg = "Cloning to radio..." radio.status_fn(status)
_exit_program_mode(radio) _______________________________________________ chirp_devel mailing list chirp_devel@intrepid.danplanet.com http://intrepid.danplanet.com/mailman/listinfo/chirp_devel Developer docs: http://chirp.danplanet.com/projects/chirp/wiki/Developers
participants (2)
-
af5mi@yahoo.com
-
Jim Unroe