cyoung / stratux

Aviation weather and traffic receiver based on RTL-SDR.
BSD 3-Clause "New" or "Revised" License
1.04k stars 360 forks source link

Request: Binding 978/1090 process to specific SDR? #55

Closed dmurray14 closed 8 years ago

dmurray14 commented 8 years ago

This came up in a Reddit thread but I'm not sure it was really fleshed out. I've had some 978 and 1090 antennas made (hopefully will be here this week then I can get them out to everyone). Since they are tuned to each respective frequency, it would be good to bind the UAT and ES processes to the correct receivers. Has anyone determined if there is a way to detect which one is which, and bind the process to one or the other? Is one USB port always the lower numbered one?

cyoung commented 8 years ago

Is the order that USB devices are "ordered" on bootup deterministic?

bradanlane commented 8 years ago

I did some more searches and the following discussion thread suggests the device order will change when devices are added or removed but more important there is the change they change from boot sequence to boot sequence based on timing of processes and race conditions. http://raspberrypi.stackexchange.com/questions/12246/why-does-usb-port-enumeration-change

My experience appears that devices are stable from boot to boot and ports are sequential. However I may find its just current coincidence and it all changes a week or month from now.

On Sep 22, 2015, at 6:39 PM, cyoung notifications@github.com wrote:

Is the order that USB devices are "ordered" on bootup deterministic?

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

lastdeadmouse commented 8 years ago

It could be possible but only if the SDRs supply a unique identifier. In the past, I've resolved certain issues by creating symlinked devices this way for other stuff, like tuners in a htpc. Haven't looked into with the SDRs though. On Sep 22, 2015 5:55 PM, "bradanlane" notifications@github.com wrote:

I did some more searches and the following discussion thread suggests the device order will change when devices are added or removed but more important there is the change they change from boot sequence to boot sequence based on timing of processes and race conditions.

http://raspberrypi.stackexchange.com/questions/12246/why-does-usb-port-enumeration-change

My experience appears that devices are stable from boot to boot and ports are sequential. However I may find its just current coincidence and it all changes a week or month from now.

On Sep 22, 2015, at 6:39 PM, cyoung notifications@github.com wrote:

Is the order that USB devices are "ordered" on bootup deterministic?

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

— Reply to this email directly or view it on GitHub https://github.com/cyoung/stratux/issues/55#issuecomment-142443931.

ssokol commented 8 years ago

IIRC (and this is coming from memory, so please don't trust it as gospel truth) there is a way to map USB devices based on the port into which they are inserted. You can create udev rules that then enforce device identity based on that mapping - maybe? Here's a link that might help:

http://askubuntu.com/questions/49910/how-to-distinguish-between-identical-usb-to-serial-adapters

cyoung commented 8 years ago

Duplicate, moving to #79.