Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Transition from RTLSDR "bundle" to a HackRF One - Decode Rate 1/sec #173

Closed
bctrainers opened this issue Jan 31, 2018 · 11 comments
Closed

Comments

@bctrainers
Copy link

Hey,

My HackRF One came in the other day, got it hooked up this evening with everything configured with what i believe is correct.

Gave it a good spin on my windows machine with SDR#, didn't notice notable drift - even after six hours of running.

However, with the latest trunk-recorder revision, this is the result....

putty_2018-01-30_23-17-19

root@box006:/home/radio/trunk-build# hackrf_info
hackrf_info version: unknown
libhackrf version: unknown (0.5)
Found HackRF
Index: 0
Serial number: [redacted]56b35f
Board ID Number: 2 (HackRF One)
Firmware Version: 2018.01.1 (API:1.02)
Part ID Number: 0xa000cb3c 0x006e4756

The config.json file...

{
    "sources": [{
        "center": 855100000,
        "rate": 16000000,
        "error": 0,
        "ppm": 0,
        "gain": 48,
        "ifGain": 24,
        "bbGain": 28,
        "debugRecorders": 0,
        "digitalRecorders": 16,
        "digitalLevels": 8,
        "modulation": "qpsk",
        "driver": "osmosdr",
        "device": "hackrf=56b35f"
    }],
    "systems": [{
        "control_channels": [853775000],
        "sysId": "688",
        "sysSite": "401",
        "type": "p25",
        "shortName": "MJoCo",
        "recordUnknown": "true",
        "callLog": "true",
        "audioArchive": "true",
        "autoRetune": 1,
        "talkgroupsFile": "../trunk-build-thm/kc_marrs_joco_tgs.csv"
    }],
    "captureDir": "/home/radio/trunk-build/recs/",
    "callTimeout": 2,
    "logFile": 1
}

Some of the config.json variables may have residual from the tree-house-man trunk-recorder fork.

The text output from running ./recorder...

root@box006:/home/radio/trunk-build# ./recorder
linux; GNU C++ version 6.2.0 20161027; Boost_106200; UHD_003.009.005-0-unknown

[2018-01-30 23:22:42.609293] (info)   Using Config file: ./config.json

[2018-01-30 23:22:42.609676] (info)
-------------------------------------
SYSTEMS
-------------------------------------
0
[2018-01-30 23:22:42.609715] (info)

System Number: 1
-------------------------------------
1
[2018-01-30 23:22:42.609728] (info)   Short Name: MJoCo
[2018-01-30 23:22:42.609738] (info)   System Type: p25
[2018-01-30 23:22:42.609746] (info)   Control Channels:
[2018-01-30 23:22:42.609780] (info)   8.53775e+08
[2018-01-30 23:22:42.609822] (info)   API Key:
[2018-01-30 23:22:42.609832] (info)   Upload Script:
[2018-01-30 23:22:42.609863] (info)   Call Log: true
[2018-01-30 23:22:42.609906] (info)   Audio Archive: true
[2018-01-30 23:22:42.609917] (info)   Loading Talkgroups...
[2018-01-30 23:22:42.614725] (info)   Read 826 talkgroups.
[2018-01-30 23:22:42.614757] (info)   Talkgroups File: ../trunk-build-thm/kc_marrs_joco_tgs.csv
[2018-01-30 23:22:42.614771] (info)   Record Unkown Talkgroups: true
[2018-01-30 23:22:42.614783] (info)   Talkgroup Display Format: Id
[2018-01-30 23:22:42.614803] (info)   Hide Encrypted Talkgroups: false
[2018-01-30 23:22:42.614813] (info)   Hide Unkown Talkgroups: false
[2018-01-30 23:22:42.614822] (info)
[2018-01-30 23:22:42.614830] (info)

-------------------------------------
SOURCES
-------------------------------------

[2018-01-30 23:22:42.614864] (info)   Driver: osmosdr
[2018-01-30 23:22:42.614875] (info)   Center: 8.551000e+08
[2018-01-30 23:22:42.614902] (info)   Rate: 16000000
[2018-01-30 23:22:42.614923] (info)   Error: 0
[2018-01-30 23:22:42.614935] (info)   PPM Error: 0
[2018-01-30 23:22:42.614946] (info)   Gain: 48
[2018-01-30 23:22:42.614957] (info)   IF Gain: 24
[2018-01-30 23:22:42.614969] (info)   BB Gain: 28
[2018-01-30 23:22:42.614980] (info)   LNA Gain: 0
[2018-01-30 23:22:42.615022] (info)   MIX Gain: 0
[2018-01-30 23:22:42.615033] (info)   Squelch: 0
[2018-01-30 23:22:42.615054] (info)   Idle Silence: false
[2018-01-30 23:22:42.615062] (info)   Digital Recorders: 16
[2018-01-30 23:22:42.615073] (info)   Debug Recorders: 0
[2018-01-30 23:22:42.615083] (info)   Analog Recorders: 0
[2018-01-30 23:22:42.615096] (info)   Modulation: qpsk
[2018-01-30 23:22:42.615106] (info)   Source Device: hackrf=56b35f
gr-osmosdr v0.1.x-xxx-xunknown (0.1.5git) gnuradio 3.7.10
built-in source types: file osmosdr fcd rtl rtl_tcp plutosdr miri hackrf bladerf rfspace airspy airspyhf soapy redpitaya
Using HackRF One with firmware 2018.01.1
[2018-01-30 23:22:42.619339] (info)   SOURCE TYPE OSMOSDR (osmosdr)
[2018-01-30 23:22:42.619360] (info)   Setting sample rate to: 16000000
[2018-01-30 23:22:42.620972] (info)   Actual sample rate: 16000000
[2018-01-30 23:22:42.621002] (info)   Tunning to 8.551000e+08
[2018-01-30 23:22:42.622066] (info)   Gain Stage: RF supported values: 0 14
[2018-01-30 23:22:42.622129] (info)   Gain Stage: IF supported values: 0 8 16 24 32 40
[2018-01-30 23:22:42.622157] (info)   Gain Stage: BB supported values: 0 2 4 6 8 10 12 14 16 18 20 22 24 26 28 30 32 34 36 38 40 42 44 46 48 50 52 54 56 58 60 62
[2018-01-30 23:22:42.622167] (info)   Max Freqency: 8.631000e+08
[2018-01-30 23:22:42.622185] (info)   Min Freqency: 8.471000e+08
[2018-01-30 23:22:42.622467] (info)   IF Gain set to: 24
[2018-01-30 23:22:42.623202] (info)   BB Gain set to: 28
[2018-01-30 23:22:42.623640] (info)   Gain set to: 14
[2018-01-30 23:22:42.629204] (info)      P25 Recorder Initial Rate: 484848 Resampled Rate: 30303 Initial Decimation: 33 Decimation: 16 System Rate: 30000 ARB Rate: 0.99
[2018-01-30 23:22:42.629235] (info)   P25 Recorder Taps - initial: 2425 channel: 1469 ARB: 735 Total: 4629
Project 25 IMBE Encoder/Decoder Fixed-Point implementation
Developed by Pavel Yazev E-mail: [email protected]
Version 1.0 (c) Copyright 2009
This program comes with ABSOLUTELY NO WARRANTY.
This is free software, and you are welcome to redistribute it
under certain conditions; see the file ``LICENSE'' for details.
[2018-01-30 23:22:42.635101] (info)      P25 Recorder Initial Rate: 484848 Resampled Rate: 30303 Initial Decimation: 33 Decimation: 16 System Rate: 30000 ARB Rate: 0.99
[2018-01-30 23:22:42.635127] (info)   P25 Recorder Taps - initial: 2425 channel: 1469 ARB: 735 Total: 4629
[2018-01-30 23:22:42.640709] (info)      P25 Recorder Initial Rate: 484848 Resampled Rate: 30303 Initial Decimation: 33 Decimation: 16 System Rate: 30000 ARB Rate: 0.99
[2018-01-30 23:22:42.640736] (info)   P25 Recorder Taps - initial: 2425 channel: 1469 ARB: 735 Total: 4629
[2018-01-30 23:22:42.646376] (info)      P25 Recorder Initial Rate: 484848 Resampled Rate: 30303 Initial Decimation: 33 Decimation: 16 System Rate: 30000 ARB Rate: 0.99
[2018-01-30 23:22:42.646416] (info)   P25 Recorder Taps - initial: 2425 channel: 1469 ARB: 735 Total: 4629
[2018-01-30 23:22:42.652018] (info)      P25 Recorder Initial Rate: 484848 Resampled Rate: 30303 Initial Decimation: 33 Decimation: 16 System Rate: 30000 ARB Rate: 0.99
[2018-01-30 23:22:42.652057] (info)   P25 Recorder Taps - initial: 2425 channel: 1469 ARB: 735 Total: 4629
[2018-01-30 23:22:42.657707] (info)      P25 Recorder Initial Rate: 484848 Resampled Rate: 30303 Initial Decimation: 33 Decimation: 16 System Rate: 30000 ARB Rate: 0.99
[2018-01-30 23:22:42.657747] (info)   P25 Recorder Taps - initial: 2425 channel: 1469 ARB: 735 Total: 4629
[2018-01-30 23:22:42.663432] (info)      P25 Recorder Initial Rate: 484848 Resampled Rate: 30303 Initial Decimation: 33 Decimation: 16 System Rate: 30000 ARB Rate: 0.99
[2018-01-30 23:22:42.663485] (info)   P25 Recorder Taps - initial: 2425 channel: 1469 ARB: 735 Total: 4629
[2018-01-30 23:22:42.669205] (info)      P25 Recorder Initial Rate: 484848 Resampled Rate: 30303 Initial Decimation: 33 Decimation: 16 System Rate: 30000 ARB Rate: 0.99
[2018-01-30 23:22:42.669246] (info)   P25 Recorder Taps - initial: 2425 channel: 1469 ARB: 735 Total: 4629
[2018-01-30 23:22:42.674953] (info)      P25 Recorder Initial Rate: 484848 Resampled Rate: 30303 Initial Decimation: 33 Decimation: 16 System Rate: 30000 ARB Rate: 0.99
[2018-01-30 23:22:42.674993] (info)   P25 Recorder Taps - initial: 2425 channel: 1469 ARB: 735 Total: 4629
[2018-01-30 23:22:42.680700] (info)      P25 Recorder Initial Rate: 484848 Resampled Rate: 30303 Initial Decimation: 33 Decimation: 16 System Rate: 30000 ARB Rate: 0.99
[2018-01-30 23:22:42.680740] (info)   P25 Recorder Taps - initial: 2425 channel: 1469 ARB: 735 Total: 4629
[2018-01-30 23:22:42.686571] (info)      P25 Recorder Initial Rate: 484848 Resampled Rate: 30303 Initial Decimation: 33 Decimation: 16 System Rate: 30000 ARB Rate: 0.99
[2018-01-30 23:22:42.686612] (info)   P25 Recorder Taps - initial: 2425 channel: 1469 ARB: 735 Total: 4629
[2018-01-30 23:22:42.692332] (info)      P25 Recorder Initial Rate: 484848 Resampled Rate: 30303 Initial Decimation: 33 Decimation: 16 System Rate: 30000 ARB Rate: 0.99
[2018-01-30 23:22:42.692385] (info)   P25 Recorder Taps - initial: 2425 channel: 1469 ARB: 735 Total: 4629
[2018-01-30 23:22:42.698237] (info)      P25 Recorder Initial Rate: 484848 Resampled Rate: 30303 Initial Decimation: 33 Decimation: 16 System Rate: 30000 ARB Rate: 0.99
[2018-01-30 23:22:42.698278] (info)   P25 Recorder Taps - initial: 2425 channel: 1469 ARB: 735 Total: 4629
[2018-01-30 23:22:42.704150] (info)      P25 Recorder Initial Rate: 484848 Resampled Rate: 30303 Initial Decimation: 33 Decimation: 16 System Rate: 30000 ARB Rate: 0.99
[2018-01-30 23:22:42.704176] (info)   P25 Recorder Taps - initial: 2425 channel: 1469 ARB: 735 Total: 4629
[2018-01-30 23:22:42.710013] (info)      P25 Recorder Initial Rate: 484848 Resampled Rate: 30303 Initial Decimation: 33 Decimation: 16 System Rate: 30000 ARB Rate: 0.99
[2018-01-30 23:22:42.710052] (info)   P25 Recorder Taps - initial: 2425 channel: 1469 ARB: 735 Total: 4629
[2018-01-30 23:22:42.715805] (info)      P25 Recorder Initial Rate: 484848 Resampled Rate: 30303 Initial Decimation: 33 Decimation: 16 System Rate: 30000 ARB Rate: 0.99
[2018-01-30 23:22:42.715844] (info)   P25 Recorder Taps - initial: 2425 channel: 1469 ARB: 735 Total: 4629
[2018-01-30 23:22:42.717949] (info)
-------------------------------------


[2018-01-30 23:22:42.717971] (info)

-------------------------------------
INSTANCE
-------------------------------------

[2018-01-30 23:22:42.717998] (info)   Capture Directory: /home/radio/trunk-build/recs
[2018-01-30 23:22:42.718030] (info)   Upload Server:
[2018-01-30 23:22:42.718041] (info)   Status Server:
[2018-01-30 23:22:42.718051] (info)   Instance Key:
[2018-01-30 23:22:42.718062] (info)   Instance Id:
[2018-01-30 23:22:42.718089] (info)   Default Mode: digital
[2018-01-30 23:22:42.718117] (info)   Call Timeout (seconds): 2
[2018-01-30 23:22:42.718129] (info)   Log to File: true
[2018-01-30 23:22:42.718138] (info)   Control channel warning rate: 10
[2018-01-30 23:22:42.718162] (info)   Control channel retune limit: 0
[2018-01-30 23:22:42.718171] (info)   Frequency format: 0
[2018-01-30 23:22:42.718195] (info)   Status as String: false
[2018-01-30 23:22:42.718322] (info)   [MJoCo]   Started with Control Channel: 8.537750e+08
[2018-01-30 23:22:42.722189] (info)      P25 Trunking - SysNum: 0
[2018-01-30 23:22:42.722230] (info)      P25 Recorder Initial Rate: 484848 Resampled Rate: 48484.8 Initial Decimation: 33 Decimation: 10 System Rate: 48000 ARB Rate: 0.99
[2018-01-30 23:22:42.722318] (info)   P25 Recorder Taps - initial: 2425 channel: 1101 ARB: 735 Total: 4261
[2018-01-30 23:22:45.012223] (error)   [MJoCo]  There is only one control channel defined
[2018-01-30 23:22:45.012391] (error)   [MJoCo]   Control Channel Message Decode Rate: 0.666667/sec, count:  2
[2018-01-30 23:22:48.015626] (error)   [MJoCo]  There is only one control channel defined
[2018-01-30 23:22:48.016044] (error)   [MJoCo]   Control Channel Message Decode Rate: 1/sec, count:  3
[2018-01-30 23:22:51.018783] (error)   [MJoCo]  There is only one control channel defined
[2018-01-30 23:22:51.018959] (error)   [MJoCo]   Control Channel Message Decode Rate: 0.666667/sec, count:  2
^C
 Signal caught!
[2018-01-30 23:22:51.817919] (info)   stopping flow graph
@bctrainers
Copy link
Author

I'm an idiot... didn't apply the error correct right. Should've been +12000 and not -12000.

Can be marked as resolved. :)

Time to see how much of a workhorse this HackRF One really is!

@bctrainers
Copy link
Author

bctrainers commented Jan 31, 2018

There appears to be a bug with the driver "unlatching" when trunk-recorder is CTRL C'd or when its SIGTERM'd. There's previous bug reports regarding this as well.

Workaround for the time being: Reboot of the physical machine, be it button or terminal reboot.

@EricTendian
Copy link
Contributor

@bctrainers try compiling and using this executable to reset the HackRF, I've had success with it: https://gist.github.com/x2q/5124616

Usage: usbreset /dev/bus/usb/099/099

You can find what path your HackRF is at (the argument to usbreset) with a command like this: lsusb -d 1d50:6089 | perl -n -e '/Bus ([0-9]*) Device ([0-9]*)/ && print "/dev/bus/usb/$1/$2\n"'

@Dygear
Copy link
Contributor

Dygear commented Jul 12, 2018

I too am having this problem. Seems that the HackRF is actually at fault from what I can tell. If you watch it in GQRX you can see the device actually freeze after a certain amount of time. Looks like the clock can't handle the long term heat that the HackRF makes.

@bctrainers
Copy link
Author

@Dygear what i did on my HackRF One was open up the case cover and apply a few heatsinks on all of the chips. It's kept the excessive heat generation at bay, and the drift isn't too bad after 6 hours of run time.

img_20180712_020951

@dlaw
Copy link

dlaw commented Oct 30, 2019

Just want to note my experience here in case any others have the same issue:
I had trunk-recorder working great with my HackRF. The next day, exactly the same configuration was no longer working (it failed with the same "Control Channel Message Decode" errors as the original poster had). Since other posters had alluded to driver unlatching issues, I spent a while messing with usbreset and restarting and replugging everything. None of that helped, and it turns out that I did not have any driver unlatching issues. Instead, my HackRF had cooled down and the required frequency correction had shifted by a few hundred Hz.

In summary, HackRF users take note:

  1. A stock HackRF does not have a temperature compensated oscillator, so its frequency reference will drift with temperature.
  2. trunk-recorder's control channel decoder more sensitive to frequency error than you might expect. A few hundred Hz difference is enough to cause decoding to fail.
  3. If you receive "Control Channel Message Decode" errors, the first thing you should suspect is an error with your frequency configurations.

Cheers,
David

@EricTendian
Copy link
Contributor

^ I've had the temperature issue as well, especially now that seasons are changing. I've been running a fork with #271 included which has generally solved the issue, since I no longer need to worry about making slight changes to account for drift. (also see this issue #217)

@riverar
Copy link

riverar commented Feb 18, 2020

Am hitting this daily too. Going to install the tiny temperature controlled oscillator (tiny tcxo) add-on and see what happens.

@leee
Copy link
Contributor

leee commented May 15, 2021

@robotastic I think this issue can be closed. There are two conversations here, a smaller one on HackRFs and recycling USB ports (which probably isn't within scope), and a more generalized one on SDRs with drifting timers.

If there's interest, there's kalibrate-rtl and there was already work done on autotune bashing, and the process could be improved with peak detection or strongest bin tuning, but this means having to perform constant tuning/calibration on top of control channel search.

This is also just as easy of a problem to fix by hardware, or manual software compensation, which we already have.

@riverar
Copy link

riverar commented May 15, 2021

Agreed. And apologies for not returning with results. The txco was a solid fix.

@robotastic
Copy link
Owner

Agreed - Also adding that using a fan like this: https://www.amazon.com/AC-Infinity-MULTIFAN-Receiver-Playstation/dp/B00G05A2MU can be helpful no matter what SDR you use to help keep the temperatures stable.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

7 participants