hamarituc / lbgpsdo

Configuration Utility for Leo Bodnar GPSDO
GNU General Public License v3.0
16 stars 8 forks source link

Failing to modify parameters #3

Open BatchDrake opened 1 year ago

BatchDrake commented 1 year ago

Device is https://www.leobodnar.com/shop/index.php?main_page=product_info&cPath=107&products_id=301

This is the error I get when I attempt to modify anything:

(metalloid) % sudo python3 lbgpsdo.py modify --disable-out1                 
Parameter error:
fosc:   Oscillator frequency is   6.100 GHz, but must be in the range of 4.85 GHz to 5.67 GHz.
(metalloid) % sudo python3 lbgpsdo.py m --ignore-freq-limits  --disable-out1
Traceback (most recent call last):
  File "/home/waldo/Documents/Desarrollo/lbgpsdo/lbgpsdo.py", line 1468, in <module>
    args.func(args)
  File "/home/waldo/Documents/Desarrollo/lbgpsdo/lbgpsdo.py", line 1050, in command_modify
    d.write(ignore_freq_limits = args.ignore_freq_limits)
  File "/home/waldo/Documents/Desarrollo/lbgpsdo/lbgpsdo.py", line 936, in write
    self.device.send_feature_report(bytes(buf))
  File "/usr/local/lib/python3.11/dist-packages/hid/__init__.py", line 181, in send_feature_report
    return self.__hidcall(hidapi.hid_send_feature_report,
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/dist-packages/hid/__init__.py", line 148, in __hidcall
    raise HIDException(err)
hid.HIDException: ioctl (SFEATURE): Protocol error

Details are the following:

(metalloid) % sudo python3 lbgpsdo.py d                     
Device information
------------------
VID, PID:     0x2211:0x1dd2
Device:       /dev/hidraw5
Product:      mini GPS Reference Clock
Manufacturer: Leo Bodnar Electronics
S/N:          ACBF7CECE0
Firmware:     1.23

Device status
-------------
Loss count:   0
SAT lock:     LOCKED
PLL lock:     LOCKED

Output settings
---------------
Output 1:     10.000 MHz
Output 2:     10.000 MHz
Phase:         0.000 °  
Drive level:      32 mA 

PLL settings
------------
N3     =       1  Input divider factor
N2_HS  =      10  Feedback divider factor
N2_LS  =    6250  
N1_HS  =       5  Output common divider factor
NC1_LS =     122  Output 1 divider factor
NC2_LS =     122  Output 2 divider factor
SKEW   =      +0  Clock skew
BWSEL  =       9  Loop bandwith code

Frequency plan
--------------
fin    =                           97600 Hz     GPS reference frequency
f3     =      97600/   1 Hz =      97600 Hz     Phase detector frequency
fosc   = 6100000000/   1 Hz = 6100000000 Hz  !! Oscillator frequency
fout1  =   10000000/   1 Hz =   10000000 Hz     Output 1 frequency
fout2  =   10000000/   1 Hz =   10000000 Hz     Output 2 frequency
phase  =          0/   1 s  =      0.000 s      Phase offset output 1 --> 2
       =          0/   1 °  =      0.000 °      Phase angle w.r.t output 2
pres   =      50000/  61 ps =    819.672 ps     Phase offset resolution
       =        180/  61 °  =      2.951 ° 

Errors
------
fosc:   Oscillator frequency is   6.100 GHz, but must be in the range of 4.85 GHz to 5.67 GHz.
BatchDrake commented 1 year ago

Hi again,

It turns out that modify works roughly with a 1% chance. This is what I ended up doing to modify my GPSDO settings:

i=0; while ! python3 lbgpsdo.py m --ignore-freq-limits --fin 5000000 --n3 5 --n2-hs 10 --n2-ls 580 --n1-hs 5 --nc1-ls 58 --bw 5; do i=`expr $i + 1`; done; echo "$i attempts until setting"
hamarituc commented 1 year ago

Hi again,

It turns out that modify works roughly with a 1% chance. This is what I ended up doing to modify my GPSDO settings:

i=0; while ! python3 lbgpsdo.py m --ignore-freq-limits --fin 5000000 --n3 5 --n2-hs 10 --n2-ls 580 --n1-hs 5 --nc1-ls 58 --bw 5; do i=`expr $i + 1`; done; echo "$i attempts until setting"

I can confirm this behavior and experienced it from time to time by myself. The chances depend on the internal state of the GPSDO (maybe the lock status). Sometimes nearly all attempts will fail, while otherwise they will succeed. Until now I wasn't able to identify the root cause, but I'm trying to work on it if time permits.

Was the output of your GPSDO locked to the GPS signal when you experienced the error?

If you discover some regularities, don't hesitate to share. I have currently no idea where to look for.

BatchDrake commented 1 year ago

Yep, locked to the GPS. Is the Windows / macOS config tool open source? Maybe there's something silly we are missing out. This is something that also happens with lb-gps-linux, and the problem always occur in the ioctl.

Argonghost commented 9 months ago

Hi @BatchDrake @hamarituc ..

I just got this software working on my Linux pc. how exactly do i modify the output frequency???? is i=0; while ! python3 lbgpsdo.py m --ignore-freq-limits --fin 5000000 --n3 5 --n2-hs 10 --n2-ls 580 --n1-hs 5 --nc1-ls 58 --bw 5; do i=expr $i + 1; done; echo "$i attempts until setting" seriously the only way? I literally only want to the change the output frequency to 40 MHz as i intend to inject this into an SDR

hamarituc commented 9 months ago

Hi @BatchDrake @hamarituc ..

I just got this software working on my Linux pc. how exactly do i modify the output frequency???? is i=0; while ! python3 lbgpsdo.py m --ignore-freq-limits --fin 5000000 --n3 5 --n2-hs 10 --n2-ls 580 --n1-hs 5 --nc1-ls 58 --bw 5; do i=expr $i + 1; done; echo "$i attempts until setting" seriously the only way? I literally only want to the change the output frequency to 40 MHz as i intend to inject this into an SDR

Please follow issue #6 as your issue is not related to the problem filed by @BatchDrake