Welcome Guest,Register Now
Log In

ANT Forum

Welcome guest, please Login or Register

   

ANT UWP SDK Beta Release 0.1

RankRankRankRank

Total Posts: 313

Joined 2011-09-12

PM

We are pleased to announce that official Windows UWP support is now available for testing. The main purpose of this library is to support the Windows IoT platform, including the Raspberry Pi. You find the SDK in the ANT Win UWP beta package now available in the thisisant.com downloads section: https://www.thisisant.com/resources/ant-sdk-win-uwp-beta-beta-release-for-customer-testing-and-feedback/

Please recognize that because this library is new that we are releasing it as a beta release and request your feedback on anything that isn't working. Also note, the included libraries support using libusb based devices including the USB2 and USBm, but not SI based devices like the module dev boards.

This library also requires you to install different drivers then our standard ones available on Windows Update. Please see the included readme for instructions.

We hope providing our official API on UWP helps you with your ANT projects!

Leave any feedback and questions in this thread. Thanks!      

Signature

Dynastream Developer

RankRank

Total Posts: 43

Joined 2013-06-11

PM

Thank you very very much!      
RankRank

Total Posts: 43

Joined 2013-06-11

PM

Now I have a question.

For standard Windows UWP (Development Only!! because there are no signed UWP drivers):


Will a signed UWP driver available in the future? I currently develop app on RPi and another standard PC UWP app to release it on Store.      
RankRankRankRank

Total Posts: 313

Joined 2011-09-12

PM

Creating a signed driver is not currently planned at this time. What is your use case to run an app on UWP on PC that you couldn't run as a desktop app?      

Signature

Dynastream Developer

RankRank

Total Posts: 43

Joined 2013-06-11

PM

My app use some of UWP component. (e.g. ads, MediaElement) And I want the app to release on Windows Store to easy to handle about license.      
RankRankRankRank

Total Posts: 313

Joined 2011-09-12

PM

Ok, that makes sense I guess, but unfortunately we have no plans to go through the certification process. The biggest issue is that installing the WinUSB driver for the ANT USB stick would break the stick from working with all other existing Windows applications expecting the LibUSB driver, which would be a very confusing situation for users.      

Signature

Dynastream Developer

RankRank

Total Posts: 43

Joined 2013-06-11

PM

Ok, that makes sense too. Maybe Project Centennial (Desktop App Converter) can help me doing it (old desktop SDK running in UWP). Or in case that it didn't work I will just develop another desktop app as ANT connector. It should be easier for user than replace the driver.

By the way. I still need this SDK for RPi. I try the demo yesterday without a problem. I will try connect it to ANT+ sensor today. Thank you for your hard word.      
RankRank

Total Posts: 43

Joined 2013-06-11

PM

Ok. It was a bit late (than that time -> https://www.thisisant.com/forum/viewreply/7285/ ) because of my other work (and all of them have a ANT+. Why? I don't know. LOL). But now I can get realtime HR from HRM. The SDK was doing fine. I don't found any problem for now. Thank you.      

Image Attachments

WP_20160623_02_36_16_Pro_LI.jpg

Click thumbnail to see full-size image

RankRankRankRank

Total Posts: 313

Joined 2011-09-12

PM

Nice. Thanks for the update!      

Signature

Dynastream Developer

RankRank

Total Posts: 43

Joined 2013-06-11

PM

Since the download page say "ANT SDK Win UWP [BETA] - Beta release for customer testing and feedback" I think that I should post about what I found with it. Is it okay to post here? or I should do it somewhere else?

I still use ANT dongle with Intel Compute Stick as IoT device (with my old code) for a past month because of some work. But yesterday I manage to do a stress test for UWP ANT SDK with 8 sensors receiver on Raspberry Pi 3 (1 ANT dongle with 8 channels). It work fine with those 4 HRM + 4 cadence sensors without any problem for over a few hours.

This test was really important because I have a problem with python-ant (https://github.com/mvillalba/python-ant) on Raspberry Pi that it can't handle 8 sensors at a time. It will crash within a short time. (and it was the cause that I have to move to Intel Compute Stick as temporary solution) And, not only happen with 8 sensors, sometime it crash with only 2 sensors.

I have a plan to develop the headless mode app. So that maybe the next test. Maybe I will try to connect 2 ANT dongle too 1 RPi at a time. But I didn't have a real use case for multi-dongle now.      

Image Attachments

WP_20160724_06_30_36_Rich_LI.jpg

Click thumbnail to see full-size image

RankRank

Total Posts: 43

Joined 2013-06-11

PM

Forgot about this thing. I still can't create new project and add a reference by myself. All I can do now is copy a demo project then edit all the code from it. When I try it with new project it will crash with the command device0 = new ANT_Device(); (it not crash when call ANT_Device device0;) I try to make it look like the demo project by only add ANT_NET_UWP as reference and after a build I see ANT_NET_UWP.dll, ANT.UWPWrappedLib.dll and ANT.UWPWrappedLib.winmd as it should be but still not get what I missed.

Sorry. But I got what I missed. I notice this right after I post it. I have to manually add this capability to Package.appxmanifest. And I didn't see this in readme so it got a lot of time.

<!-- ANT USB-m Stick-->
    <
DeviceCapability Name="usb">
      <
Device Id="vidpid:0FCF 1009">
        <Function 
Type="name:vendorSpecific" />
      </
Device>
    </
DeviceCapability
     
RankRank

Total Posts: 43

Joined 2013-06-11

PM

I short update about those 2 test I post before.
I have a plan to develop the headless mode app. So that maybe the next test. Maybe I will try to connect 2 ANT dongle too 1 RPi at a time. But I didn't have a real use case for multi-dongle now.

I create all new UWP ANT+ headless app and it work fine. It also support multi-dongle too but there some problem. With the first dongle you can just use this code.
ANT_Device ant1 = new ANT_Device() 

but it will crash when you call this one after the first.
ANT_Device ant2 = new ANT_Device() 

I didn't remember if I ever use multi-dongle in one app on my old .net code. But it work with multi-app for sure.
There was some workaround about this problem for now. Maybe you can use try-catch to fix it. But I chose this code.
static int opennedDevicesNum 0;
antDevice = new ANT_Device((byte)opennedDevicesNum++, (uint)57600); 

With this code you can just create any number of ANT_Device. But you have to make sure there is none other headless app (and, if you app was headless app, the running headed app) using ANT dongle run in the same time. With that maybe the try-catch will be the last solution.      
Rank

Total Posts: 14

Joined 2012-09-04

PM

hisoft - 25 July 2016 03:50 PM
I short update about those 2 test I post before.
I have a plan to develop the headless mode app. So that maybe the next test. Maybe I will try to connect 2 ANT dongle too 1 RPi at a time. But I didn't have a real use case for multi-dongle now.

I create all new UWP ANT+ headless app and it work fine. It also support multi-dongle too but there some problem. With the first dongle you can just use this code.
ANT_Device ant1 = new ANT_Device() 

but it will crash when you call this one after the first.
ANT_Device ant2 = new ANT_Device() 

I didn't remember if I ever use multi-dongle in one app on my old .net code. But it work with multi-app for sure.
There was some workaround about this problem for now. Maybe you can use try-catch to fix it. But I chose this code.
static int opennedDevicesNum 0;
antDevice = new ANT_Device((byte)opennedDevicesNum++, (uint)57600); 

With this code you can just create any number of ANT_Device. But you have to make sure there is none other headless app (and, if you app was headless app, the running headed app) using ANT dongle run in the same time. With that maybe the try-catch will be the last solution.


Hi, could you give me some info about this crash when it happens? For instance, there should be some message string embedded in the ANT_Exception class that tells us what failed during the creation of an ANT_Device object. Can you also share with me any exceptions/warnings/errors thrown by your IDE when the multi-dongle code is run? This will be very helpful in resolving the issue/error.
     
RankRank

Total Posts: 43

Joined 2013-06-11

PM

michael.ong - 27 July 2016 08:58 AM
Hi, could you give me some info about this crash when it happens? For instance, there should be some message string embedded in the ANT_Exception class that tells us what failed during the creation of an ANT_Device object. Can you also share with me any exceptions/warnings/errors thrown by your IDE when the multi-dongle code is run? This will be very helpful in resolving the issue/error.


I recreate a crash with this code
try
            
{
b1
>                ANT_Device antDevice1 = new ANT_Device();
b2>                ANT_Device antDevice2 = new ANT_Device();
            
}
            
catch (Exception e)
            
{
b3
>                send(e);
            
}
            
catch (Exception e)
            
{
b4
>                send(e);
            

The app was pause at breakpoint b1 and b2 then it crash with this output in VS.
The program '[2492] backgroundTaskHost.exe' has exited with code -1073740791 (0xc0000409).

It didn't break at b3 or even b4. It just close itself. And it work fine when I change a code to this.
ANT_Device antDevice1 = new ANT_Device((byte)1, (uint)57600);
ANT_Device antDevice2 = new ANT_Device((byte)2, (uint)57600); 


Sorry. I missed the output it send with send(e). the send(e) was forward a e.toString() over network to me. This is what it say.

ANT_Managed_Library.ANT_Exception: ANTLibrary Exception: Unable to initialize USB:2 at Baud:57600, probably device not present or already in use, or drivers not installed\r\n at ANT_Managed_Library.ANT_Device.startUp(Byte USBDeviceNum, UInt32 baudRate, FramerType frameType, PortType portType, Boolean calledByAutoInit)\r\n at ANT_Managed_Library.ANT_Device..ctor(PortType portType, Byte USBDeviceNum, UInt32 baudRate, FramerType frameType)\r\n at ANT_Managed_Library.ANT_Device..ctor(Byte USBDeviceNum, UInt32 baudRate)\r\n at NetworkANT.Ant..ctor()
     
Rank

Total Posts: 14

Joined 2012-09-04

PM

hisoft - 27 July 2016 09:34 AM
michael.ong - 27 July 2016 08:58 AM
Hi, could you give me some info about this crash when it happens? For instance, there should be some message string embedded in the ANT_Exception class that tells us what failed during the creation of an ANT_Device object. Can you also share with me any exceptions/warnings/errors thrown by your IDE when the multi-dongle code is run? This will be very helpful in resolving the issue/error.


I recreate a crash with this code
try
            
{
b1
>                ANT_Device antDevice1 = new ANT_Device();
b2>                ANT_Device antDevice2 = new ANT_Device();
            
}
            
catch (Exception e)
            
{
b3
>                send(e);
            
}
            
catch (Exception e)
            
{
b4
>                send(e);
            

The app was pause at breakpoint b1 and b2 then it crash with this output in VS.
The program '[2492] backgroundTaskHost.exe' has exited with code -1073740791 (0xc0000409).

It didn't break at b3 or even b4. It just close itself. And it work fine when I change a code to this.
ANT_Device antDevice1 = new ANT_Device((byte)1, (uint)57600);
ANT_Device antDevice2 = new ANT_Device((byte)2, (uint)57600); 


Thanks I see. I will look into this issue.      
RankRank

Total Posts: 43

Joined 2013-06-11

PM

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?