[chirp_devel] [PATCH] [vx8] #129, #1735 (same issue): fix for incorrect channel initializations
# HG changeset patch # User Bernhard Hailer ham73tux@gmail.com # Date 1577395355 28800 # Thu Dec 26 13:22:35 2019 -0800 # Node ID 826a0f4b373066fb73e255e1f82b1cf190830763 # Parent c3c7ee53893ff6ff83798bd9cc0a424dae201d3f [vx8] #129, #1735 (same issue): fix for incorrect channel initializations
Users complained that under certain circumstances 2m repeaters with negative offsets were not programmed correctly and resulted in a frequency offset or even an incorrect transmit/receive mode. Both issues #129 and #1735 essentially describe that same problem for the Yaesu VX-8. I ran into the same issue with a VX-8DR I just got - which made me dig into Chirp :-)
Two bytes were found to be initialized differently when manually programmed, both were marked "unknown". After a few experiments these bytes could be (at least partially) identified. (A side product was that I found the bit responsible for narrowband transmit - that will be used in another patch fixing issue #1615 to enable this radio for Chirp's "NFM" mode).
Tested with a VX-8DR.
73 Bernhard AE6YN
diff --git a/chirp/drivers/vx8.py b/chirp/drivers/vx8.py --- a/chirp/drivers/vx8.py +++ b/chirp/drivers/vx8.py @@ -152,7 +152,9 @@
#seekto 0x328A; struct { - u8 unknown1; + u8 unknown1a:2, + half_deviation:1, + unknown1b:5; u8 mode:2, duplex:2, tune_step:4; @@ -167,7 +169,12 @@ tone:6; u8 unknown6:1, dcs:7; - u8 unknown7[3]; + u8 pr_frequency; + u8 unknown7; + u8 unknown8a:3, + unknown8b:1, + rx_mode_auto:1, + unknown8c:3; } memory[900];
#seekto 0xC0CA; @@ -494,7 +501,9 @@
def _wipe_memory(mem): mem.set_raw("\x00" * (mem.size() / 8)) - mem.unknown1 = 0x05 + mem.pr_frequency = 0x1d # default PR frequency of 1600 Hz + mem.unknown8b = 1 # This bit must be 1, but its meaning is unknown + mem.rx_mode_auto = 1 # rx auto mode bit defaults to 1
@directory.register @@ -701,6 +710,7 @@ _mem.duplex = DUPLEX.index(mem.duplex) _mem.mode = MODES.index(mem.mode) _mem.dcs = chirp_common.DTCS_CODES.index(mem.dtcs) + # Radio doesn't do that when programmed manually, but tox needs it: _mem.tune_step = STEPS.index(mem.tuning_step) if mem.power: _mem.power = 3 - POWER_LEVELS.index(mem.power)
@directory.register @@ -701,6 +710,7 @@ _mem.duplex = DUPLEX.index(mem.duplex) _mem.mode = MODES.index(mem.mode) _mem.dcs = chirp_common.DTCS_CODES.index(mem.dtcs)
# Radio doesn't do that when programmed manually, but tox needs it:
Did you mean to remove this? It's adding a comment but not making any change, so I thought maybe it was residue. Also, it doesn't really make sense -- tox is just a venv manager for a test harness. Perhaps you mean something in one of the tests "needs" something, but I'm not sure what that would be. The tests are just asking the driver to store and retrieve things into the memory, so the *tests* don't really need anything specific.
Can you either remove this line if not relevant, or re-word it to be more informative?
Otherwise the change looks good to me, thanks for figuring that out!
--Dan
Hi Dan,
sure, this can be removed. I originally wanted to remove the line below, but then tox failed because it expected some other values than just a default. Do you want me to submit a patch, or can you do it while adding to the branch?
Actually, we should find a way to use a default step value when a channel is freshly used, otherwise the previously used values (memory residues) will be written. As you stated yourself, VX-8 does a pretty poor job in cleaning memories when a channel is erased.
73 Bernhard
On 02-Jan-20 14:26, Dan Smith via chirp_devel wrote:
@directory.register @@ -701,6 +710,7 @@ _mem.duplex = DUPLEX.index(mem.duplex) _mem.mode = MODES.index(mem.mode) _mem.dcs = chirp_common.DTCS_CODES.index(mem.dtcs)
# Radio doesn't do that when programmed manually, but tox needs it:
Did you mean to remove this? It's adding a comment but not making any change, so I thought maybe it was residue. Also, it doesn't really make sense -- tox is just a venv manager for a test harness. Perhaps you mean something in one of the tests "needs" something, but I'm not sure what that would be. The tests are just asking the driver to store and retrieve things into the memory, so the *tests* don't really need anything specific.
Can you either remove this line if not relevant, or re-word it to be more informative?
Otherwise the change looks good to me, thanks for figuring that out!
--Dan _______________________________________________ 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
sure, this can be removed. I originally wanted to remove the line below, but then tox failed because it expected some other values than just a default. Do you want me to submit a patch, or can you do it while adding to the branch?
If you can shoot me a fresh one with that line removed, that'd be my preference.
Actually, we should find a way to use a default step value when a channel is freshly used, otherwise the previously used values (memory residues) will be written. As you stated yourself, VX-8 does a pretty poor job in cleaning memories when a channel is erased.
The set_memory() routine should always set the tune step in the radio memory the first time it goes from empty to used, so I'm not sure this is really a problem. However, get_memory() should definitely gracefully handle the case where those bits are in an unsupported value.
Thanks!
--Dan
participants (2)
-
Bernhard Hailer
-
Dan Smith