[chirp_devel] Baofeng UV-B5/B6 'Unsupported Model' Problem
Hi group,
I think I finally have a handle on what is causing the CHIRP 'Unsupported Model" problem with the UV-B5 and UV-B6 radios. Under certain conditions, one confirmed as receive CTCSS tones selections, things change that cause CHIRP to stop working with radio.
Here is the radio 'ident' check.
ident = radio.pipe.read(8) print util.hexprint(ident) if ident != "HKT511\x00\x04": raise errors.RadioError("Unsupported model")
The HKT511\x00\x04 ident is what is returned from a factory radio or a radio that has been reset. When you program certain receive CTCSS frequencies (and some other settings will cause this, too), the 'ident' changes to the following.
HKT511\x00\x00
This can be easily fixed by checking for both ident strings or by shorting the string to just 7 characters.
When this is done, CHIRP starts the download process, but then the clone process is ended with 'Unexpected respose'.
Here is where the process fails.
ecks = radio.pipe.read(1) if ecks != "x": raise errors.RadioError("Unexpected response")
What happens is when the 'ident' changes, the 'ecks' value changes too. I have seen as many as three different responses (including the original 'x').
The easiest 'fix' would be to just remove the check. Either Baofeng doesn't check or they know what to check for.
Another 'fix' would be to grab the first 'ack' and then use it to check the rest. Maybe something like this?
ack = radio.pipe.read(1) if i == 0 ack0 == ack if ack != ack0: raise errors.RadioError("Unexpected response")
Does anyone have any better ideas to work around this UV-B5/B6 quirk?
Thanks, Jim KC9HI
HKT511\x00\x00
This can be easily fixed by checking for both ident strings or by shorting the string to just 7 characters.
When this is done, CHIRP starts the download process, but then the clone process is ended with 'Unexpected respose'.
Well, you need to read all eight bytes, but make sure that the first seven are right. Maybe even just stick to the first six?
if not ident.startswith('HKT511'): raise ...
On Fri, Jul 26, 2013 at 8:31 PM, Dan Smith dsmith@danplanet.com wrote:
HKT511\x00\x00
This can be easily fixed by checking for both ident strings or by shorting the string to just 7 characters.
When this is done, CHIRP starts the download process, but then the clone process is ended with 'Unexpected respose'.
Well, you need to read all eight bytes, but make sure that the first seven are right. Maybe even just stick to the first six?
if not ident.startswith('HKT511'): raise ...
Perfect.
Got any thoughts about the second issue?
Jim
On Fri, Jul 26, 2013 at 9:42 PM, Dan Smith dsmith@danplanet.com wrote:
Got any thoughts about the second issue?
I thought the second issue was because you changed read(8) to read(7). Did I miss something?
No. The testing I have done for the first problem has been to just check for both strings.
The second part changes based on what settings have been programmed in the radio. I've seen at least 2 different values in addition to the original 'x'.
Jim
The second part changes based on what settings have been programmed in the radio. I've seen at least 2 different values in addition to the original 'x'.
Ah, I should have looked at the code, I thought you were making an example. If there are three known values, I'd just check for them. If there end up being lots, then maybe we should do something more like what you had where we try to capture the first one. Checking for any of the three is best done like this:
ack = radio.pipe.read(1) if ack not in ('x', 'y', 'z'): raise ...
On Fri, Jul 26, 2013 at 10:41 PM, Dan Smith dsmith@danplanet.com wrote:
The second part changes based on what settings have been programmed in the radio. I've seen at least 2 different values in addition to the original 'x'.
Ah, I should have looked at the code, I thought you were making an example. If there are three known values, I'd just check for them. If there end up being lots, then maybe we should do something more like what you had where we try to capture the first one. Checking for any of the three is best done like this:
ack = radio.pipe.read(1) if ack not in ('x', 'y', 'z'): raise ...
I'll do it this way with the 3 captured values that I have. I'll then do some more testing. If I get a failure because of a 4th value, I'll capture the first. Otherwise, I'll leave it alone.
This will get rid of a big annoyance and allow me to close a few issues.
Thanks, Jim
I'll do it this way with the 3 captured values that I have. I'll then do some more testing. If I get a failure because of a 4th value, I'll capture the first. Otherwise, I'll leave it alone.
Be sure to log the value of it's not one of the three so that it will show up clearly in the debug logs for us.
Thanks!
participants (2)
-
Dan Smith
-
Jim Unroe