dtheriault / hydra

The Hydra Project
1 stars 1 forks source link

Add ability to dynamically change rtl_hpsdr.conf changes w/o restarting rtl_hpsdr #5

Closed dtheriault closed 9 years ago

dtheriault commented 9 years ago

I find this very useful as today if you quit rtl_hpsdr before cw skimmer, change .conf settings, then restart rtl_hpsdr, cw skimmer can throw exception. Then you often have to wait for telnet port to timeout before you can restart.

I had a version of this running early on when I was first playing around with parameters and freq_offsets. I spawned off a thread which looped once every few seconds, re parsed config file and applied changes to a few parameters such as freq_offset. Maybe re-parse every 15s or so ?

n1gp commented 9 years ago

Added this with minimal testing, should work, let me know how it works for you.

dtheriault commented 9 years ago

config_file changed, reloading...

Parsing config file /home/doug/configs/rtl_hpsdr.conf

Very cool, thanks !

dtheriault commented 9 years ago

Actually, offsets are not being updated I believe. Ie: I make a change, indeed it re-parses file, but when spots come in and I compare against RBN, I'm still off...

n1gp commented 9 years ago

Can you try it with cal not enabled, update offsets, and make sure those are what you see in the freq updates?

n1gp commented 9 years ago

I'm seeing issues even reading the offsets, will fix:

Requested 7 Activated 7 actual rcvr(s) Set rcvr 1 to freq 10000000 with offset 1406 Set rcvr 2 to freq 10000000 with offset 1406 Set rcvr 3 to freq 10000000 with offset 1406 Set rcvr 4 to freq 10000000 with offset 1406 Set rcvr 5 to freq 10000000 with offset 1406 Set rcvr 6 to freq 10000000 with offset 1406 Set rcvr 7 to freq 10000000 with offset 1406 Received Start command Set rcvr 1 to freq 1845500 with offset 1406 Set rcvr 2 to freq 3545500 with offset 1406 Set rcvr 3 to freq 7045500 with offset 1406 Set rcvr 4 to freq 10145500 with offset 1406 Set rcvr 5 to freq 14045500 with offset 1406 Set rcvr 6 to freq 18113500 with offset 1406 Set rcvr 7 to freq 21045500 with offset 1406

n1gp commented 9 years ago

Try it again, it's working for me. Make sure it's just the offsets -1147,123,blah and not 124899543,125000123,blah

dtheriault commented 9 years ago

Yes, I did change format to conf file so its now just the offsets and not full frequency values.

Its unclear if the updated config file takes affect in full but do see message saying its re-read. I do not see updates to offsets unless I initiate change in skimmer so we stop then restart the receivers. Are you printing out new values when center freq is re-tuned?

Its basically working though...

n1gp commented 9 years ago

It prints out the values now when it re-reads the config file. I'll get back to you later on the pcb layouts...

dtheriault commented 9 years ago

Working great, thanks !

dtheriault commented 9 years ago

After config file is re-parsed second or 'n' times, rtlsdr_set_center_freq is never called again. ie: re-parsing config file requires skimmer to set the freq so mcb.rcb[j].new_freq to trigger call to adj center freq.

Here I was making changes of +- 100Hz and my spots were still off same amount. Then read through code and realized re-parse while working, never called center freq again unless I triggered a change in skimmer.

I've got a modified version here that re-tunes center freq when freq_offset changes. Again, this is only useful change if you're using skimmer, cudaSDR would behave differently.

Any thoughts to using the ppm adjustment API vs. center freq tuning? Maybe we could reduce some of the additions in calculating center freq and improve performance a tad. Just a thought...

n1gp commented 9 years ago

I just addressed this issue, let me know if it fixes it.

I played with the PPM stuff a while back, but when I realized that the dongle frequency dances around so much with temperature changes, it didn't seem usable. As for the API, no but I'll take a look.

n1gp commented 9 years ago

Also added better versioning which includes the GIT hash:

mh@n1gp:~/RTL/LATEST_RTL/DT_GIT/medusa/software/librtlhpsdr/build$ ./src/rtl_hpsdr -v

GNU rtl_hpsdr Version 1.8 Date Built 14:36:02 Feb 26 2015 GIT Hash 693708e Copyright (C) 2014 Free Software Foundation, Inc. License GPLv3+: GNU GPL version 3 or later http://gnu.org/licenses/gpl.html This is free software: you are free to change and redistribute it. There is NO WARRANTY, to the extent permitted by law.

n1gp commented 9 years ago

The submit I made earlier to address the config file change wasn't enough, but it led me to find another bug where a freq change might not have gotten caught. After fixing that the config file change seems to be working for me and hopefully freq changes in general.

dtheriault commented 9 years ago

Added new function update_dongle() that can be called after parsing of the config file. This will update frequency, gain, gain mode, agc, direct mode settings on the dongle via rtl api calls. commit: 5c6ec7c

dtheriault commented 9 years ago

Closing this one as I believe its working now.

n1gp commented 9 years ago

Nice!

Date: Tue, 21 Apr 2015 08:26:20 -0700 From: notifications@github.com To: medusa@noreply.github.com CC: n1gp@hotmail.com Subject: Re: [medusa] Add ability to dynamically change rtl_hpsdr.conf changes w/o restarting rtl_hpsdr (#5)

Closing this one as I believe its working now.

— Reply to this email directly or view it on GitHub.