Hi Group,
I've been trying to figure out the best way to add CHIRP support for the Baofeng UV-5RAX dual-band radios that cover 136-174 MHz and 220-260 MHz.
I have been thinking that I just need a way to figure out a way to detect if the radio is a VHF/UHF model or a VHF/220 model and then use that to select between the following rf.valid_bands.
rf.valid_bands = [(136000000, 174000000), (400000000, 520000000)] # VHF/UHF
rf.valid_bands = [(136000000, 174000000), (220000000, 260000000)] # VHF/VHF220
I think I have a way to detect the difference. Below are the 1st 16 bytes of Baofeng UV-5R radios. The BFB231 is representative of firmware version BFB230 through BFB281 where the firmware verson was identified.
BFB231 (136-174/400-520) 00 01 02 03 04 05 06 07 08 09 0A 0B 0C 0D 0E 0F AA 42 46[42]32 33 31 DD 00 25 60 13 00 25 60 13 ªBFB231Ý.%`..%`.
The BFB291 is representative of firmware versions BFB291 and later. The format was revised to contain the lower and upper limits of each band.
BFB291 (136-174/400-520) 00 01 02 03 04 05 06 07 08 09 0A 0B 0C 0D 0E 0F AA 36 74[04]00 05 20 DD 00 25 60 13 00 25 60 13 ª6t... Ý.%`..%`.
The BFB296 is representative of firmware versions from a VHF/220 radio.
BFB296 (136-174/220-260) 00 01 02 03 04 05 06 07 08 09 0A 0B 0C 0D 0E 0F AA 36 74[02]20 02 60 DD FF FF FF FF FF FF FF FF ª6t. .`Ýÿÿÿÿÿÿÿÿ
Note the byte that I have surrounded with square brackets. On firmware BFB290 and lower, this will always be '42'. On firmware for a VHF/UHF radio, this will always be '04' or '05'. And finally on a VHF/220 radio this will always be '02'.
So if some way byte 0x0003 could be read so that rf.valid_bands can be set to
rf.valid_bands = [(136000000, 174000000), (400000000, 520000000)]
except when 0x0003=02 then it would be set to
rf.valid_bands = [(136000000, 174000000), (220000000, 260000000)]
Does this make sense? How would I go about it? is there a better way?
It was discussed that the VHF/220 radio could be handled as a different Baofeng model. I guess I'm not opposed to that if that is what the consensus is. How would that be done?
Thanks in advance.
Jim KC9HI