Welcome Guest,Register Now
Log In

ANT Forum

Welcome guest, please Login or Register

   

RPi Windows UWP ANT_Device() exception

Rank

Total Posts: 6

Joined 2013-02-19

PM

Hi,

I have created a Windows UWP app to run on my Raspberry Pi 2, with ANT USBStick2 attached. Created from the demo app that comes with the SDK.

I am getting "ANTLibrary Exception: Unable to initialize USB....." from the call to device0 = new ANT_Device();

I have trawled through all the previous posts I could find and have tried various things, including the readme.iot file that comes with the ANT SDK for UWP, but still cannot connect to the ANT Stick.

Things I have tried:-

The files ANT.UWPWrappedLib.dll, ANT.UWPWrappedLib.winmd and ANT_NET_UWP.dll are all in the running directory of the app.

I copied the ANT_WinUSB.inf to the Pi and installed and rebooted.

I can see the ANT USBStick2 listed on the "Windows Device Portal" Device Manager with ID: USB\VID_0FCF&PID;_1008\196

When I run "devcon status USB\VID_0FCF"&"PID_1008" on the Pi, I get:
USB\VID_0CFC&PID;_1008\196
Name: ANT USBStick2
Driver is running.
1 matching device(s) found.

On the Raspberry Pi Device info screen, the ANT USBStick2 is listed under Connected devices

I have updated the apps Package.appxmanifest to include the following capability
<DeviceCapability Name="usb">
<Device Id="vidpid:0CFC 1008">
<Function Type="name:vendorSpecific" >
</Device>
</DeviceCapability>

I have also tried using the alternative device0 = new ANT_Device(1, Convert.ToUint32(57600) );

So everything looks good. But I am still getting the exception "ANTLibrary Exception: Unable to initialize USB....." from the call to device0 = new ANT_Device();

I would be grateful for any advice, thanks.
     
RankRankRankRank

Total Posts: 313

Joined 2011-09-12

PM

Are you saying the new ANT_Device(1, Convert.ToUint32(57600) ); call is working?

Also, make sure you follow all the instructions to install the driver and set up the device in the readme_iot.txt?      

Signature

Dynastream Developer

Rank

Total Posts: 6

Joined 2013-02-19

PM

Thanks ShaneG for replying.

I have tried both

device0 = new ANT_Device();
and
device0 = new ANT_Device(1, Convert.ToUint32(57600) );

and neither is working for me.

Yes, I followed the instructions in the readme.txt to the letter. Everything on the Pi says that the driver is installed correctly and working.

I even tried to deploy the example demo app and I get the same exceptions from the ANT_Device() calls.

I am thinking that maybe I will purchase the ANTUsb-m and try that, because I have run out of ideas.      
Rank

Total Posts: 6

Joined 2013-02-19

PM

devcon status returns

USB\VID_0FCF&PID;_1008\196
Name: ANT USBStick2
Driver is running.

devcon driverfiles "USB\VID_0FCF&PID;_1008" returns

USB\VID_0FCF&PID;_1008\196
Name: ANT USBStick2
1 matching device(s) found.

So, it seems that the drivers are installed and the device is functioning.      
RankRankRankRank

Total Posts: 313

Joined 2011-09-12

PM

Oh, you are using USB2, sorry, I see I didn't catch that in your first post either. Although USB2 uses the same driver, in the current software, it will only detect the USBm stick. We think it should be in the next release, but we don't have a date for it. If you need it over the next few months you should probably buy a USBm. Really sorry that we haven't made it more explicit that only USB-m is supported at this time.      

Signature

Dynastream Developer

Rank

Total Posts: 6

Joined 2013-02-19

PM

That's fine, at least I now have an answer to my problem. I had a suspicion that it was the issue.

I will buy a USB-m in the meantime and look forward to the future update.

Thanks for your help.      
Rank

Total Posts: 6

Joined 2013-02-19

PM

The USB-m arrived today. All problems are resolved.