[chirp_devel] [bj-uv55] patch for initial support - need help from UV-5R experts/testers
[bj-uv55] initial channel editing support #1201 patch attached.
This is definately a UV-5R clone (in terms of architecture), but in a mobile form-factor. Therefore, there are several differences in terms of offsets of settings locations, id/band-range, etc in the memory map.
I have made a few changes to the uv5r.py driver which I am hoping wont impact other covered models, but ask for some help in testing, as I do not have an UV-5R (or similar) to do regression tests against.
Also, I'm trying to understand what to modify so that when opening a radio image file, it will recognize this image as being BJ-UV55.
I assume this has something to do with header bytes, but it wasnt so clear to me reading over the code.
I have also tried to simplify a few areas with list comprehension, like:
- if "BFB" not in radio_version and "82" not in radio_version and "USA" not in radio_version: + if not any(type in radio_version for type in ["BFB", "82", "USA", "BJ55"]):
however, it appears to me these should be simplified further to something like: if radio._basetype not in radio_version: // make better use of _basetype!
-Jens AF5MI
On Sun, Nov 10, 2013 at 8:08 PM, Jens J. kd4tjx@yahoo.com wrote:
[bj-uv55] initial channel editing support #1201 patch attached.
This is definately a UV-5R clone (in terms of architecture), but in a mobile form-factor. Therefore, there are several differences in terms of offsets of settings locations, id/band-range, etc in the memory map.
I have made a few changes to the uv5r.py driver which I am hoping wont impact other covered models, but ask for some help in testing, as I do not have an UV-5R (or similar) to do regression tests against.
Also, I'm trying to understand what to modify so that when opening a radio image file, it will recognize this image as being BJ-UV55.
I assume this has something to do with header bytes, but it wasnt so clear to me reading over the code.
I have also tried to simplify a few areas with list comprehension, like:
- if "BFB" not in radio_version and "82" not in radio_version and "USA"
not in radio_version:
- if not any(type in radio_version for type in ["BFB", "82", "USA",
"BJ55"]):
however, it appears to me these should be simplified further to something like: if radio._basetype not in radio_version: // make better use of _basetype!
-Jens AF5MI
Jens, Email an .img file from the BJ55 for me to look at. Thanks Jim KC9HI
sample radio image attached
On Sunday, November 10, 2013 7:41 PM, Jim Unroe rock.unroe@gmail.com wrote:
On Sun, Nov 10, 2013 at 8:08 PM, Jens J. kd4tjx@yahoo.com wrote:
[bj-uv55] initial channel editing support #1201
patch attached.
This is definately a UV-5R clone (in terms of architecture), but in a mobile form-factor. Therefore, there are several differences in terms of offsets of settings locations, id/band-range, etc in the memory map.
I have made a few changes to the uv5r.py driver which I am hoping wont impact other covered models, but ask for some help in testing, as I do not have an UV-5R (or similar) to do regression tests against.
Also, I'm trying to understand what to modify so that when opening a radio image file, it will recognize this image as being BJ-UV55.
I assume this has something to do with header bytes, but it wasnt so clear to me reading over the code.
I have also tried to simplify a few areas with list comprehension, like:
- if "BFB" not in radio_version and "82" not in radio_version and "USA" not in radio_version:
- if not any(type in radio_version for type in ["BFB", "82", "USA", "BJ55"]):
however, it appears to me these should be simplified further to something like: if radio._basetype not in radio_version: // make better use of _basetype!
-Jens AF5MI
Jens,
Email an .img file from the BJ55 for me to look at. Thanks
Jim KC9HI
On Sun, Nov 10, 2013 at 8:08 PM, Jens J. kd4tjx@yahoo.com wrote:
[bj-uv55] initial channel editing support #1201
I have also tried to simplify a few areas with list comprehension, like:
- if "BFB" not in radio_version and "82" not in radio_version and "USA"
not in radio_version:
- if not any(type in radio_version for type in ["BFB", "82", "USA",
"BJ55"]):
I would be happy to work on this with you. I'm not much of a python programmer. Anyway, "BJ55" will not work here because the area of memory we are looking at in the BJ55 is 14 spaces. "BJ55" won't be found and the check will fail with "Unsupported firmware version: ..." You might be able to get away with " " (4 spaces between the quotes).
Jim KC9HI
On Sun, Nov 10, 2013 at 9:19 PM, Jim Unroe rock.unroe@gmail.com wrote:
On Sun, Nov 10, 2013 at 8:08 PM, Jens J. kd4tjx@yahoo.com wrote:
[bj-uv55] initial channel editing support #1201
I have also tried to simplify a few areas with list comprehension, like:
- if "BFB" not in radio_version and "82" not in radio_version and
"USA" not in radio_version:
- if not any(type in radio_version for type in ["BFB", "82", "USA",
"BJ55"]):
I would be happy to work on this with you. I'm not much of a python programmer. Anyway, "BJ55" will not work here because the area of memory we are looking at in the BJ55 is 14 spaces. "BJ55" won't be found and the check will fail with "Unsupported firmware version: ..." You might be able to get away with " " (4 spaces between the quotes).
Jim KC9HI
Oh never mind. I see you are getting it from a different place... Jim
On Sun, Nov 10, 2013 at 8:08 PM, Jens J. kd4tjx@yahoo.com wrote:
Also, I'm trying to understand what to modify so that when opening a radio image file, it will recognize this image as being BJ-UV55.
#def _firmware_version_from_data(data, version_start = 0x1838, version_stop = 0x1848): def _firmware_version_from_data(data, version_start = 0x1938, version_stop = 0x193E): version_tag = data[version_start:version_stop] return version_tag
You will have to set it up so that is uses "version_start = 0x1938, version_stop = 0x193E" for the BJ55 and "version_start = 0x1838, version_stop = 0x1848" for everything else. I just made a quick substitution as above to check it out and it worked for me.
Jim KC9HI
Thanks Jim.
I see the key is in returning true for "match_model" method on your class when an image is run against all drivers.
I have also taken a first pass at refactoring some of this per-radio logic that I introduced in previous patch into subclass properties. I see some other opportunities to streamline this and make it more generic for forward and backward compatibility. Hopefully will ease the coming onslaught of "Attack of the Radio Clone Clones"
new patch attached...
On Sunday, November 10, 2013 9:49 PM, Jim Unroe rock.unroe@gmail.com wrote:
On Sun, Nov 10, 2013 at 8:08 PM, Jens J. kd4tjx@yahoo.com wrote:
Also, I'm trying to understand what to modify so that when opening a radio image file, it will recognize this image as being BJ-UV55.
#def _firmware_version_from_data(data, version_start = 0x1838, version_stop = 0x1848): def _firmware_version_from_data(data, version_start = 0x1938, version_stop = 0x193E): version_tag = data[version_start:version_stop] return version_tag
You will have to set it up so that is uses "version_start = 0x1938, version_stop = 0x193E" for the BJ55 and "version_start = 0x1838, version_stop = 0x1848" for everything else. I just made a quick substitution as above to check it out and it worked for me.
Jim KC9HI
On Fri, Nov 15, 2013 at 8:33 PM, Dan Smith dsmith@danplanet.com wrote:
new patch attached...
Jim, have you tested this latest one?
--Dan
Yes. Enough to see that I can still download and upload OK and all of the settings values appeared to be as they should.
Jim
participants (3)
-
Dan Smith
-
Jens J.
-
Jim Unroe