[chirp_devel] [PATCH] [UV-B5] Address "Radio NAK'd block at address 0x0f10" Error

Jim Unroe
Sat Feb 11 14:53:36 PST 2017


# HG changeset patch
# User Jim Unroe <rock.unroe at gmail.com>
# Date 1486851925 18000
# Node ID 4569107adfccc72db9d12d8ecfcb7b97cfe06c65
# Parent  4c1697b626b287b087787645aaa894d81800ed46
[UV-B5] Address "Radio NAK'd block at address 0x0f10" Error

This patch works around the no ACK issue caused by the Baofeng UV-B5 and
UV-B6 radios with 27 menus that do not support the Service Menu settings.

related to #2109 and others.

diff -r 4c1697b626b2 -r 4569107adfcc chirp/drivers/uvb5.py
--- a/chirp/drivers/uvb5.py	Wed Feb 08 23:13:46 2017 -0800
+++ b/chirp/drivers/uvb5.py	Sat Feb 11 17:25:25 2017 -0500
@@ -238,7 +238,16 @@
         radio.pipe.write(frame)
         ack = radio.pipe.read(1)
         if ack != "\x06":
-            raise errors.RadioError("Radio NAK'd block at address 0x%04x" % i)
+            # UV-B5/UV-B6 radios with 27 menus do not support service settings
+            # and will stop ACKing when the upload reaches 0x0F10
+            if i == 0x0F10:
+                # must be a radio with 27 menus detected - stop upload
+                break
+            else:
+                LOG.debug("Radio NAK'd block at address 0x%04x" % i)
+                raise errors.RadioError(
+                    "Radio NAK'd block at address 0x%04x" % i)
+        LOG.debug("Radio ACK'd block at address 0x%04x" % i)
         do_status(radio, "to", i)
 
 DUPLEX = ["", "-", "+", 'off', "split"]



More information about the chirp_devel mailing list