sergev / baoclone

A command-line utility for saving, restoring and modifying the configuration of Baofeng handheld radios.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Incorrect VFO offset value

GoogleCodeExporter opened this issue · comments

What steps will reproduce the problem?
1.In VFO mode, VFO A; set offset (menu 26) to any nymber, exaple 00.600
2.In SFT-D (menu 25) set it to - (negative)
3.Download the device configuration.
4.Look at device.conf at VFO setup/data
5.The ofsset value is always + and multiplied by 10. Example:
6.THe VFO B, I set offset to +1.600

 A  VHF  136.0250 +6          -       -    2.5  High  Wide   -  
 B  UHF  470.6250 +16         -       -    2.5  High  Wide   -  


What is the expected output? What do you see instead?
The expected output is

 A  VHF  136.0250 -0.600          -       -    2.5  High  Wide   -  
 B  UHF  470.6250 +1.600         -       -    2.5  High  Wide   -  

 I have no problem with Channel Mode setup.

What version of the product are you using? On what operating system?
GNU/Linux Slacware64, and using baoclone version git-current  d2c4a4b 2013-11-01

Please provide any additional information below.
I am using Baofeng A52, which has similar internal with  GT-3 . Firmware 
version is BFS311. 

I attached the device.img for your reference.

I am very happy with baoclone, I made compiled my country's repeaters which are 
102, and using sed and awk, I can create a table which baoclone can parse in 
juse less than a second. :) 


BTW, please remove -m32 for CC parameters in Makefile, so, it can be compiled 
with 64 bit gcc in 64bit GNU/Linux.
--- Makefile.orig       2014-03-31 10:59:54.660769094 +0800
+++ Makefile    2014-03-31 10:59:54.661769094 +0800
@@ -1,4 +1,4 @@
-CC             = gcc -m32
+CC             = gcc 

 VERSION         = 1.4
 CFLAGS         = -g -O -Wall -Werror -DVERSION='"$(VERSION)"'


Thank you.

Original issue reported on code.google.com by bahat...@gmail.com on 31 Mar 2014 at 3:03

Attachments:

Herei is my WIP patch for the problem.

--- uv-5r_orig.c        2014-04-01 12:59:07.300091237 +0800
+++ uv-5r.c     2014-04-01 12:56:43.637081256 +0800
@@ -538,10 +538,10 @@
           (vfo->freq[5] & 15) * 1000 +
           (vfo->freq[6] & 15) * 100 +
           (vfo->freq[7] & 15) * 10;
-    *offset = (vfo->offset[0] & 15) * 100000000 +
-              (vfo->offset[1] & 15) * 10000000 +
-              (vfo->offset[2] & 15) * 1000000 +
-              (vfo->offset[3] & 15) * 100000;
+    *offset = (vfo->offset[0] & 15) * 10000000 +
+              (vfo->offset[1] & 15) * 1000000 +
+              (vfo->offset[2] & 15) * 100000 +
+              (vfo->offset[3] & 15) * 10000;
     decode_squelch (vfo->rxtone, rx_ctcs, rx_dcs);
     decode_squelch (vfo->txtone, tx_ctcs, tx_dcs);
     *lowpower = vfo->lowpower;

As we can see, the original code have extra 0, which is about 10x of correct 
value. The correct value for OFFSET is  12.340 MHz. 


Remaining is the  SFT-D (shift UP(+) and DOWN (-) value. I don't know where 
this information is located.

Thank you.

Original comment by bahat...@gmail.com on 1 Apr 2014 at 5:18

After several testings; download each SFT-D changes and did the comparison, and 
here is my finding.

VFO A
Offset  OFF  +      -
0x0E42 0x00 0x01  0x02
0x0F25 0x00 0x10  0x20


VFO B
Offset  OFF  +      -
0x0E42 0x00 0x01  0x02
0x0F45 0x00 0x10  0x20


Thank you.

Original comment by bahat...@gmail.com on 1 Apr 2014 at 9:19