-
Notifications
You must be signed in to change notification settings - Fork 5
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
Configuring which SDR to use when multiple connected to a Pi #18
Comments
Check out the |
Thank you for the rapid response. I can confirm that the use of the -d 0 is working in selecting the correct RTL-SDR. However if I try -d 1, which will select an SDR already in use, Ionosphere exits silently with no reporting of the reason why either to the terminal window or to the log file, as below where I:
Having just realised that with also having an LNA, I need to turn on the bias-tee to power it, which is done using the -T argument, e.g. the code below will turn on the bias-tee, select device zero, set the gain to 36.4, tune to 145.8MHz, set the address and port for the server to the values specified:
So I edited the config/config.yml to include:
When trying to run Ionosphere, the code exits silently, without any error messages sent to console or to the log file. Since the unused SDR is being selected without the "-d 0", I thought I'd try to just turn on the bias-tee, so I edited the config/config.yml to include:
When trying to run Ionosphere, the code works as expected (although I didn't go outside to check that the bias-tee was on as the remnants of cyclone Dovi are just passing through). Looking at the code for "ionosphere/subprocesses/rtlsdr/rtlsdr.go", I suspect that the issue may be with lines 13-14 (note I've not used Go, but have used multiple other languages, so take what I'm suggesting as possibly being incorrect). As written it seems to be taking a pair of parameters, e.g. "-f", c.Frequency, which should result in the args including -f 123.456M (if that was what was set in the config file for the frequency. But for the additional flags, you are trying to set multiple ones at once if multiple have been specified in the additional-flags field. It looks to be behaving exactly like Popen in Python. What I suspect you need to do to handle multiple flags being set in the additional-flags field is to parse out this field into the arg / value pairs (could split the string at each - (with validation, especially as not every arg needs a value), then either construct your args value dynamically (if Go lets you do that) or select one of multiple predefined combinations based on the number of separate flags in the additional-flags value. Hope this helps improve the code. |
Thanks for that, sorry for the slow replies. I'll get a second RTL-SDR hooked up to my test environment and see what I can work out. |
Let me know if you need anyone to beta test this. |
@KiwiInNZ here's a beta build which should in theory resolve the issues with the additional args. https://github.com/cceremuga/ionosphere/releases/tag/v1.0.2beta I admittedly didn't have a chance to hook up an additional device to test with, but was able to confirm that if I add multiple acceptable Let me know if it resolves your issue! |
Dose the rtl driver support multi device access. last time i tried to
access the second device while the first is in use. The second program
errors out. Am i missing something?
…On Sun, Nov 6, 2022, 7:32 AM Craig Ceremuga ***@***.***> wrote:
@KiwiInNZ <https://github.com/KiwiInNZ> here's a beta build which should
in theory resolve the issues with the additional args.
https://github.com/cceremuga/ionosphere/releases/tag/v1.0.2beta
I admittedly didn't have a chance to hook up an additional device to test
with, but was able to confirm that if I add multiple acceptable rtl_fm
args to the single config line as in your original sample, it didn't crash.
Let me know if it resolves your issue!
—
Reply to this email directly, view it on GitHub
<#18 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AAEW6LAHLW5PBYJDREXJJ7LWG66OJANCNFSM5OGDR73Q>
.
You are receiving this because you are subscribed to this thread.Message
ID: ***@***.***>
|
@mathisono at this time, you'd need ionosphere in two separate folders.
that said, it's almost certainly going to insta-crash unless you're running the 1.0.2 beta build |
I downloaded and installed from https://github.com/cceremuga/ionosphere/releases/tag/v1.0.2beta, with my config file having the line in the "rtl:" section:
|
Dang, alright sorry about that. I'll actually get a second rtl-sdr hooked up to test with now, should have done it last time haha. |
@KiwiInNZ Some (possibly) good news.
The process which I'd recommend to try this out is as follows:
That should (in theory) get you the desired functionality. I was able to get that working as expected with the correct behavior using two identical dongles on a single system. Granted, my test environment is a virtual machine running Arch Linux, not a Raspberry Pi. It's entirely possible the behavior is different on a Pi, but with the new build, you should be able to capture better error output for additional troubleshooting. |
Doing some testing, using v1.0.2beta2:
Trying to use the wrong SDR:
Useful output to see that the wrong one was selected, which is unavilable as dump1090 is already running and using it. Looking at the logfiles to see if there is useful info there too:
Nothing is being written to the logs. I'd normally want to run stuff like ionosphere as a background task, so having output go to a log file is ideal. Although it is easy enough to pipe console output to a file. From experience, I normally try to log enough to the logfile to make it as easy as possible to identify issues. Is PLACEHOLDER meant to be there? Trying to use the right SDR:
Good, useful output from multimon-ng and rtl_fm. Having validated that the "-d 0" or "-d 1" part is working as required, I've validated that the "-T" part is working to power on a Nooelec LNA. All this was tested on a fully patched Raspberry Pi 3B. |
Sweet, looks like we're on the right track, then. I'll push up another beta sometime soon that puts the additional debug info into the log file. Right now it's piping stderr from both processes to the os stderr, I will redirect that to the log files with everything else. Thanks again for the valuable feedback, it is very much appreciated. |
@KiwiInNZ Here's a 3rd beta build which adds significantly more verbose logging to the log file including the startup sequences for So far, things are running smoothly in my local testing, but I'll let it run for a few days to make sure everything is stable. |
From a quick set of tests, based on the testing I did for beta2, other than I've not gone outside to validate that the -T option has turned on bias tee, everything is working exactly as expected. I like the more verbose logging going to the file. logs/PLACEHOLDER - seems to be unused - is it needed? Will leave it running and report back with any issues. |
The placeholder is deliberate to keep the folder structure in place in binary releases. Without it, the directory isn't there when the tarball is uncompressed and leads to confusing startup errors. Just a cheap workaround I've not replaced yet. At some point I'll look into pushing the logs into proper OS logs at which point it will go away. |
It is possible to connect multiple RTL-SDR to a single pi, so it should be possible to configure which one ionosphere uses. However in the config/config.yml there is no option to specify the serial number of the SDR to use.
Since ionosphere is using rtl_fm, this should be possible as this can take a parameter:
As an example, I've two SDR:
Since device 0 is the one I would like to use, whenever using rtl_fm I specify -d 0.
Could this functionality to be added to ionosphere?
The text was updated successfully, but these errors were encountered: