Question

I am using the USRP_UHD project found here:https://github.com/RedhawkSDR/USRP_UHD

I have seen the question:Component uses a device - failed to allocateCapacity . This gentleman seems to have a similar problem, but I didn't have any of his other issues.

I'm trying to launch a node containing the USRP_UHD device through the "Target SDR". I end up with this warning:

WARN:Device_impl - Unable to connect to IDM channel

System Notes:
CentOS 6.4 64 Bit
REDHAWK 1.8.4
Ettus N200 + XCVR 2450 Daughtercard
GNU C++ version 4.4.7 20120313 (Red Hat 4.4.7-3); Boost_104100; UHD_003.005.002-0-unknown

When the node is not running:
nameclt list REDHAWK_DEV
list: NotFound exception: missing node

When the node is running:
nameclt list REDHAWK_DEV
ODM_Channel
IDM_Channel
REDHAWK_DEV
USRP-TEST/ (This is my node name)

and

eventviewer REDHAWK_DEV IDM_Channel
Receiving events. Press 'enter' key to exit

Everything seems okay to me. I believe the warning is thrown here: Device_impl.h

#if ENABLE_EVENTS
    if (idm_channel_ior) {
        try {
            CORBA::Object_var IDM_channel_obj = ossie::corba::Orb()->string_to_object(idm_channel_ior);
            if (CORBA::is_nil(IDM_channel_obj)) {
                LOG_ERROR(Device_impl, "Invalid IDM channel IOR: " << idm_channel_ior);
            } else {
                CosEventChannelAdmin::EventChannel_var idm_channel = CosEventChannelAdmin::EventChannel::_narrow(IDM_channel_obj);
                (*devPtr)->connectSupplierToIncomingEventChannel(idm_channel);
            }
        } catch (...) {
            LOG_WARN(Device_impl, "Unable to connect to IDM channel");
        }
    }
#endif

The USRP device does not seem to pick up any of my properties that I set in USRP_UHD.prf.xml - I am hopeful resolving this issue will help. Thanks!

Was it helpful?

Solution

With regard to your issue concerning connecting to IDM Channels, this is a recently discovered bug in the 1.9.0 release of the core framework. An AdapterNonExistent exception is thrown when find_POA is called on line 833 of the Device_Impl.cpp class. The Device_Impl.cpp class is the base class used by all C++ devices so the problem is not limited to just the USRP C++ device.

Devices use the IDM the channel to send StateChangeEventType events (see http://redhawksdr.github.io/Documentation/mainch16.html#x18-26800016.3.1)

If your system relies on these event types, your devices are C++, and you are using v1.9.0 of the framework you can work around this issue by overriding the connectSupplierToIncomingEventChannel method in your device. However this work around should be removed when upgrading to v1.9.1.

Within your C++ device's header class and below the existing include statements add the following:

#if ENABLE_EVENTS
#include <COS/CosEventChannelAdmin.hh>
#include "ossie/CorbaUtils.h"
#endif

Then within the public method declaration add the following:

#if ENABLE_EVENTS
    void connectSupplierToIncomingEventChannel (CosEventChannelAdmin::EventChannel_ptr idmChannel);
    CosEventChannelAdmin::EventChannel_var IDM_channel;
    CosEventChannelAdmin::ProxyPushConsumer_var proxy_consumer;
#endif

Within your device's cpp class, below the service function, add the following method.

#if ENABLE_EVENTS
void workAroundDevice_i::connectSupplierToIncomingEventChannel(CosEventChannelAdmin::EventChannel_ptr idm_channel)
{
    TRACE_ENTER(Device_impl);

    IDM_channel = CosEventChannelAdmin::EventChannel::_duplicate(idm_channel);

    CosEventChannelAdmin::SupplierAdmin_var supplier_admin;
    unsigned int number_tries;
    unsigned int maximum_tries = 10;

    number_tries = 0;
    while (true)
    {
        try {
            supplier_admin = IDM_channel->for_suppliers ();
            if (CORBA::is_nil(supplier_admin))
            {
                IDM_channel = CosEventChannelAdmin::EventChannel::_nil();
                return;
            }
            break;
        }
        catch (CORBA::COMM_FAILURE& ex) {
            if (number_tries == maximum_tries) {
                IDM_channel = CosEventChannelAdmin::EventChannel::_nil();
                return;
            }
            usleep(1000);   // wait 1 ms
            number_tries++;
            continue;
        }
    }
    proxy_consumer = CosEventChannelAdmin::ProxyPushConsumer::_nil();
    number_tries = 0;
    while (true)
    {
        try {
            proxy_consumer = supplier_admin->obtain_push_consumer ();
            if (CORBA::is_nil(proxy_consumer))
            {
                IDM_channel = CosEventChannelAdmin::EventChannel::_nil();
                return;
            }
            break;
        }
        catch (CORBA::COMM_FAILURE& ex) {
            if (number_tries == maximum_tries) {
                IDM_channel = CosEventChannelAdmin::EventChannel::_nil();
                return;
            }
            usleep(1000);   // wait 1 ms
            number_tries++;
            continue;
        }
    }
    //
    // Connect Push Supplier - retrying on Comms Failure.
    PortableServer::POA_var root_poa = PortableServer::POA::_narrow(ossie::corba::RootPOA());

    IDM_Channel_Supplier_i* supplier_servant = new IDM_Channel_Supplier_i(this);

    PortableServer::ObjectId_var oid = root_poa->activate_object(supplier_servant);

    CosEventComm::PushSupplier_var sptr = supplier_servant->_this();

    supplier_servant->_remove_ref();
    number_tries = 0;
    while (true)
    {
        try {
            proxy_consumer->connect_push_supplier(sptr.in());
            break;
        }
        catch (CORBA::BAD_PARAM& ex) {
            IDM_channel = CosEventChannelAdmin::EventChannel::_nil();
            return;
        }
        catch (CosEventChannelAdmin::AlreadyConnected& ex) {
            break;
        }
        catch (CORBA::COMM_FAILURE& ex) {
            if (number_tries == maximum_tries) {
                IDM_channel = CosEventChannelAdmin::EventChannel::_nil();
                return;
            }
            usleep(1000);   // wait 1 ms
            number_tries++;
            continue;
        }
    }

}
#endif
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top