Welcome Guest,Register Now
Log In

ANT Forum

Welcome guest, please Login or Register

   

ANT UWP SDK Beta Release 0.1

Rank

Total Posts: 14

Joined 2012-09-04

PM

hisoft - 01 August 2016 03:39 AM
After a few PoC project on Raspberry Pi. Now I start a new one. And this one was my main that running on desktop and I target it to publish on Windows Store.

The question is how can I access ANT_Device from it? In this case I have to use normal driver (not a libusb version in this beta). Can I use the normal Windows library with it? I tried and it cause System.DllNotFoundException with ANT_WrappedLib.dll even I make sure it was there. Or I have to wait for a new release of ANT UWP SDK that support normal driver? Will it support in the future?


The libs should run as long as the version of Windows conform to the requirements for UWP:
https://msdn.microsoft.com/en-us/windows/uwp/get-started/universal-application-platform-guide
Perhaps you can try changing the build target for the platform you're shipping?

The DLL not found exception may have been caused by missing metadata file (winmd) from the UWP library. Can you check that ANT.UWPWrappedLib.dll, ANT.UWPWrappedLib.winmd and ANT_NET_UWP.dll are all in the same directory?      
RankRank

Total Posts: 43

Joined 2013-06-11

PM

michael.ong - 02 August 2016 09:13 AM
hisoft - 01 August 2016 03:39 AM
After a few PoC project on Raspberry Pi. Now I start a new one. And this one was my main that running on desktop and I target it to publish on Windows Store.

The question is how can I access ANT_Device from it? In this case I have to use normal driver (not a libusb version in this beta). Can I use the normal Windows library with it? I tried and it cause System.DllNotFoundException with ANT_WrappedLib.dll even I make sure it was there. Or I have to wait for a new release of ANT UWP SDK that support normal driver? Will it support in the future?


The libs should run as long as the version of Windows conform to the requirements for UWP:
https://msdn.microsoft.com/en-us/windows/uwp/get-started/universal-application-platform-guide
Perhaps you can try changing the build target for the platform you're shipping?

The DLL not found exception may have been caused by missing metadata file (winmd) from the UWP library. Can you check that ANT.UWPWrappedLib.dll, ANT.UWPWrappedLib.winmd and ANT_NET_UWP.dll are all in the same directory?

Sorry about a not clear question.
The DLL not found exception was happen with normal Windows lib (ANT_NET.dll + ANT_WrappedLib.dll) because I try to use the normal driver with it.
Is there a solution to use normal driver with UWP app for now or in the future?      
Rank

Total Posts: 14

Joined 2012-09-04

PM

I have never tested this, but MSDN appears to have some info on how to use regular dlls in UWP:
https://msdn.microsoft.com/en-ca/library/mt186162.aspx

Hope this helps.      
RankRankRankRank

Total Posts: 313

Joined 2011-09-12

PM

Unfortunately you can not use the UWP driver and traditional DLL together; the UWP driver and UWP libs must be used together and the standard signed LibUSB driver and traditional libs must be used together - you cannot mix them.      

Signature

Dynastream Developer

Rank

Total Posts: 6

Joined 2017-12-12

PM

Hello,

I am trying to run the Demo_ANTFS project on my RPI3. I have tried two different ANT adapters but I get the same exception. I have tried changing the target version to 10586, I can see the device if I do use the USB Devices c# library. I have also tried a separate project but cannot seem to figure out why the library cannot see my device. Any help would be greatly appreciated.

Exception:
Message = "ANTLibrary Exception: No ANT devices detected: ensure an ANT device is connected to your system and try again"


Devcon:
USB\VID_0FCF&PID;_1008\123 : ANT USBStick2
USB\VID_0FCF&PID;_1008\5&3753427A;&0&4 : ANT USBStick2

USB\VID_0FCF&PID;_1008\123
Name: ANT USBStick2
Driver is running.
USB\VID_0FCF&PID;_1008\5&3753427A;&0&4
Name: ANT USBStick2
Driver is running.


     
RankRank

Total Posts: 43

Joined 2013-06-11

PM

PaintedPanther - 13 January 2018 01:12 PM
Hello,

I am trying to run the Demo_ANTFS project on my RPI3. I have tried two different ANT adapters but I get the same exception. I have tried changing the target version to 10586, I can see the device if I do use the USB Devices c# library. I have also tried a separate project but cannot seem to figure out why the library cannot see my device. Any help would be greatly appreciated.

Exception:
Message = "ANTLibrary Exception: No ANT devices detected: ensure an ANT device is connected to your system and try again"


Devcon:
USB\VID_0FCF&PID;_1008\123 : ANT USBStick2
USB\VID_0FCF&PID;_1008\5&3753427A;&0&4 : ANT USBStick2

USB\VID_0FCF&PID;_1008\123
Name: ANT USBStick2
Driver is running.
USB\VID_0FCF&PID;_1008\5&3753427A;&0&4
Name: ANT USBStick2
Driver is running.



How did you run C# library on RPi ?      
Rank

Total Posts: 6

Joined 2017-12-12

PM

hisoft - 14 January 2018 01:13 AM
PaintedPanther - 13 January 2018 01:12 PM
Hello,

I am trying to run the Demo_ANTFS project on my RPI3. I have tried two different ANT adapters but I get the same exception. I have tried changing the target version to 10586, I can see the device if I do use the USB Devices c# library. I have also tried a separate project but cannot seem to figure out why the library cannot see my device. Any help would be greatly appreciated.

Exception:
Message = "ANTLibrary Exception: No ANT devices detected: ensure an ANT device is connected to your system and try again"


Devcon:
USB\VID_0FCF&PID;_1008\123 : ANT USBStick2
USB\VID_0FCF&PID;_1008\5&3753427A;&0&4 : ANT USBStick2

USB\VID_0FCF&PID;_1008\123
Name: ANT USBStick2
Driver is running.
USB\VID_0FCF&PID;_1008\5&3753427A;&0&4
Name: ANT USBStick2
Driver is running.



How did you run C# library on RPi ?


I am opening the DEMO_ANTFS solution in visual studio 2017 and have selected arm as the solution target and selected my rpi as the remote machine. My rpi3 running Windows IOT Core 16229. I either deploy the solution or remote debug but either way i get the exception.
     
RankRank

Total Posts: 43

Joined 2013-06-11

PM

PaintedPanther - 14 January 2018 07:53 AM
I am opening the DEMO_ANTFS solution in visual studio 2017 and have selected arm as the solution target and selected my rpi as the remote machine. My rpi3 running Windows IOT Core 16229. I either deploy the solution or remote debug but either way i get the exception.


Sorry I mean when you say
I can see the device if I do use the USB Devices c# library
. Now I'm not sure the device you mean the VS see RPi or the app on RPi see ANT adapter device?      
Rank

Total Posts: 6

Joined 2017-12-12

PM

hisoft - 14 January 2018 08:15 AM

Sorry I mean when you say
I can see the device if I do use the USB Devices c# library
. Now I'm not sure the device you mean the VS see RPi or the app on RPi see ANT adapter device?


Oh I see. I Created a new UWP app to test if it was an issue with the conversion from the earlier win iot target. This is the code that I ran and was able to access the ANT Adapter. Although I wasn't able to do anything useful with it.


UInt32 vid = 0x0FCF;
UInt32 pid = 0x1008;

//Selector is created
string aqs = UsbDevice.GetDeviceSelector(vid, pid);

//Device is available to use
var myDevices = await Windows.Devices.Enumeration.DeviceInformation.FindAllAsync(aqs, null);

UsbSetupPacket initSetupPacket = new UsbSetupPacket()
{
// Request = initRequest,
RequestType = new UsbControlRequestType()
{

Recipient = UsbControlRecipient.DefaultInterface,

ControlTransferType = UsbControlTransferType.Vendor
}
};

await device.SendControlOutTransferAsync(initSetupPacket);

     
RankRank

Total Posts: 43

Joined 2013-06-11

PM

PaintedPanther - 14 January 2018 06:21 PM
Oh I see. I Created a new UWP app to test if it was an issue with the conversion from the earlier win iot target. This is the code that I ran and was able to access the ANT Adapter. Although I wasn't able to do anything useful with it.


UInt32 vid = 0x0FCF;
UInt32 pid = 0x1008;

//Selector is created
string aqs = UsbDevice.GetDeviceSelector(vid, pid);

//Device is available to use
var myDevices = await Windows.Devices.Enumeration.DeviceInformation.FindAllAsync(aqs, null);

UsbSetupPacket initSetupPacket = new UsbSetupPacket()
{
// Request = initRequest,
RequestType = new UsbControlRequestType()
{

Recipient = UsbControlRecipient.DefaultInterface,

ControlTransferType = UsbControlTransferType.Vendor
}
};

await device.SendControlOutTransferAsync(initSetupPacket);


OK. I see you can access the ANT device using native, not ANT SDK. Do you manually installed ANT dongle driver that come with SDK on RPi?      
Rank

Total Posts: 6

Joined 2017-12-12

PM

Yes I did but the name of the inf was different that the instructions provided. Without the driver the ANT device isn't recognized in the devcon utility.      
RankRank

Total Posts: 43

Joined 2013-06-11

PM

PaintedPanther - 15 January 2018 02:10 PM
Yes I did but the name of the inf was different that the instructions provided. Without the driver the ANT device isn't recognized in the devcon utility.


OK, I think I got what I missed. (My project created more than one year ago and now it was in production. Only update a logic in there but not create new one.)

Did you add capability to the project? I forgot where I read this but it important. And since the demo project only include 1009 (ANT mini) you have to manually add another 1008 for ANT2 USB yourself.

Read about how to do it here -> https://www.thisisant.com/forum/viewreply/7378/

Please update if you can do it it not. Also from my experience working with Windows IoT was best for me since I don't have to worry about vulnerability because Microsoft just patch it the same time as Windows 10.      
Rank

Total Posts: 6

Joined 2017-12-12

PM

so this is my current compatibility config. I also tried to specifiy the class id and the winusbid with no luck. I replaced the existing 1009 maybe i need to keep 1009 and just add 1008.

<DeviceCapability Name="usb">
       <
Device Id="vidpid:0FCF 1008">
        <!--<Function 
Type="classId:ff * *"/>-->
        <Function 
Type="name:vendorspecific" />
        <!--<Function 
Type="winUsbId:B8619067-F6EB-4F73-A0D6-405D080544F0"/>-->
      </
Device>
    </
DeviceCapability


What was the name of the inf file that you installed?

Are you using the ANT mini or the ANT2 ?
     
RankRank

Total Posts: 43

Joined 2013-06-11

PM

PaintedPanther - 16 January 2018 07:34 AM

What was the name of the inf file that you installed?

Are you using the ANT mini or the ANT2 ?


I don't remember the name of inf driver file since I always download the new one when I have to install it on new devices. And since I just cloned RPi microSD card I didn't install the driver for a really long time now.
This was all from my capabilities.

<Capabilities>
    <
Capability Name="internetClient" />
    <
Capability Name="internetClientServer" />
    <
Capability Name="allJoyn" />
    <
Capability Name="privateNetworkClientServer" />
    <!-- 
ANT USB-m Stick-->
    <
DeviceCapability Name="usb">
      <
Device Id="vidpid:0FCF 1008">
        <Function 
Type="name:vendorSpecific" />
      </
Device>
      <
Device Id="vidpid:0FCF 1009">
        <Function 
Type="name:vendorSpecific" />
      </
Device>
    </
DeviceCapability>
  </
Capabilities


Now I only use ANTmini but I think I used to try USB ANT2 and it work without problem.
The above code I copy from Package.appxmanifest from my project that I create it as new one, add capability and all reference manually.      
Rank

Total Posts: 6

Joined 2017-12-12

PM

I was able to get back to this and try your app manifest but I still cannot get either of my ANT2 devices to work. I will try buying an ANT Mini and see if I can get a connection.

Thanks for your help.