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

Not changing frequency #19

Open
gerryb opened this issue Sep 3, 2024 · 2 comments
Open

Not changing frequency #19

gerryb opened this issue Sep 3, 2024 · 2 comments

Comments

@gerryb
Copy link

gerryb commented Sep 3, 2024

Funcube plus on Rasperry Pi 4 on OpenWebSDR+

The demodulation mode changes but not the frequency when changing bands, the 1st RX frequency stays and does not change. I have to disable the funcube and and enable it to change 2024-09-03 08:55:52,496 - owrx.source.ffa774a3-e9a6-48f2-ab25-1c0410cb7210 - WARNING - STDERR: [INFO] listFrequencies
2024-09-03 08:55:52,496 - owrx.source.ffa774a3-e9a6-48f2-ab25-1c0410cb7210 - WARNING - STDERR: [INFO] getFrequency
2024-09-03 08:57:18,564 - owrx.source.ffa774a3-e9a6-48f2-ab25-1c0410cb7210 - WARNING - STDERR: [INFO] listFrequencies
2024-09-03 08:57:19,564 - owrx.source.ffa774a3-e9a6-48f2-ab25-1c0410cb7210 - WARNING - STDERR: �[1m�[31m[ERROR] setFrequency failed to set device frequency�[0m
2024-09-03 08:57:19,564 - owrx.source.ffa774a3-e9a6-48f2-ab25-1c0410cb7210 - WARNING - STDERR: [INFO] getFrequency
2024-09-03 08:58:25,425 - owrx.source.ffa774a3-e9a6-48f2-ab25-1c0410cb7210 - WARNING - STDERR: [INFO] listFrequencies
2024-09-03 08:58:25,425 - owrx.source.ffa774a3-e9a6-48f2-ab25-1c0410cb7210 - WARNING - STDERR: [INFO] getFrequency
2024-09-03 09:19:10,880 - owrx.source.ffa774a3-e9a6-48f2-ab25-1c0410cb7210 - WARNING - STDERR: received signal: 15
2024-09-03 09:19:10,949 - owrx.source.ffa774a3-e9a6-48f2-ab25-1c0410cb7210 - WARNING - STDERR: [INFO] deactivate stream
2024-09-03 09:19:20,894 - owrx.source.ffa774a3-e9a6-48f2-ab25-1c0410cb7210 - INFO - Started sdr source: soapy_connector -s 192000 -f 24924600 -p 49205 -c 49471 -d driver=fcdpp
2024-09-03 09:19:20,899 - owrx.source.ffa774a3-e9a6-48f2-ab25-1c0410cb7210 - INFO - STDOUT: setting up control socket...
2024-09-03 09:19:20,899 - owrx.source.ffa774a3-e9a6-48f2-ab25-1c0410cb7210 - INFO - STDOUT: control socket started on 49471
2024-09-03 09:19:20,900 - owrx.source.ffa774a3-e9a6-48f2-ab25-1c0410cb7210 - INFO - STDOUT: socket setup complete, waiting for connections
2024-09-03 09:19:20,958 - owrx.source.ffa774a3-e9a6-48f2-ab25-1c0410cb7210 - WARNING - STDERR: [INFO] makeFCDPP
2024-09-03 09:19:20,963 - owrx.source.ffa774a3-e9a6-48f2-ab25-1c0410cb7210 - WARNING - STDERR: [INFO] listFrequencies
2024-09-03 09:19:20,965 - owrx.source.ffa774a3-e9a6-48f2-ab25-1c0410cb7210 - WARNING - STDERR: [INFO] getFrequency
2024-09-03 09:19:20,967 - owrx.source.ffa774a3-e9a6-48f2-ab25-1c0410cb7210 - WARNING - STDERR: [INFO] setup stream
2024-09-03 09:19:20,997 - owrx.source.ffa774a3-e9a6-48f2-ab25-1c0410cb7210 - INFO - STDOUT: client connection established
2024-09-03 09:19:20,998 - owrx.source.ffa774a3-e9a6-48f2-ab25-1c0410cb7210 - INFO - STDOUT: control connection established
2024-09-03 09:19:21,004 - owrx.source.ffa774a3-e9a6-48f2-ab25-1c0410cb7210 - WARNING - STDERR: [INFO] activate stream
2024-09-03 09:19:21,540 - owrx.source.ffa774a3-e9a6-48f2-ab25-1c0410cb7210 - INFO - STDOUT: closing client socket
2024-09-03 09:27:44,683 - owrx.source.ffa774a3-e9a6-48f2-ab25-1c0410cb7210 - INFO - STDOUT: client connection established

@zuckschwerdt
Copy link
Member

The error message you see is from

err = fcdpp_set_freq_hz(d_handle, uint32_t(frequency), d_trim_ppm);
if (err > 0) {
d_frequency = frequency;
} else {
SoapySDR_log(SOAPY_SDR_ERROR, "setFrequency failed to set device frequency");
}

which in turn got it from

SoapyFCDPP/SoapyFCDPP/fcd.c

Lines 272 to 284 in f7858c8

int fcdpp_set_freq_hz(hid_device *device, uint32_t freq, double trim) {
int err;
uint8_t buf[BUF_LEN] = { 0x00 };
freq = (uint32_t)((double) freq * (1+(1e-6*trim)));
// buf[0] is ignored by the FCDP+
buf[1] = FCD_HID_CMD_SET_FREQUENCY_HZ;
buf[2] = (uint8_t) (freq);
buf[3] = (uint8_t) (freq >> 8);
buf[4] = (uint8_t) (freq >> 16);
buf[5] = (uint8_t) (freq >> 24);
err = hid_write(device, buf, BUF_LEN);
return err;
}

as return from the hid_write(). This might be a USB or hardware problem, not sure. If you investigate further perhaps print that hidapi return code, if it's -1 call hid_error(device) to get the failure reason.

@phlash
Copy link
Member

phlash commented Sep 12, 2024

Now you mention it - the driver ought to collect hid_error() text and log it along with the error code rather than discarding values.. I'll take a look at that.

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

3 participants