Support ValueChanged and DebounceTimeout in Lightning Provider
The current Lightning provider does not support the ValueChanged event or the DebounceTimeout property because, according to the source GpioDeviceProvider.h it says "Not implemented since Lightning does yet support interrupts yet".
I don't see any roadmap or milestone in GitHub. Can you please give us a hint how long it will be before we can use that.
Also when you implement it, please consider this feature request I made at the IoT forum (https://social.msdn.microsoft.com/Forums/en-US/af4018ad-5658-4048-86a0-ae13c994effb/gpio-drivers?forum=WindowsIoT see answer from MSFT Jordan Rhee), to add the timestamp to the event. It makes more sense then when PWM decoding and increases potential accuracy of software decoding.
We're actively working on the interrupt support and expect to have it available within a few weeks.
For the timestamp request, we would have to update the in-box APIs and so that can't be added as part of a github update. We do like that feature request though and are looking at options for implementing it and getting it out there.
Thanks, Jesse
Sounds great, thanks for replying so quickly :+1:
Hello! Is there any news about ValueChanged supporting?
We've been blocked on a few related issues, but have just cleared those up. They will be going up today.
--Jesse
Thanks!
ValueChanged and DebounceTimeout are now supported in the latest Nuget. Note, the code for the Lightning providers has moved to the Lightning repository, with the binaries published to as part of the latest Lightning SDK Nuget package.
I installed Microsoft IoT Lightning SDK 1.1.0-alpha. However, the ValueChanged still does not work.
@andyfung What is the error you're getting? Can you share some code?
I am running the sample code BlinkyBackground and PushButton from https://github.com/ms-iot/BusProviders/tree/develop/Microsoft.IoT.Lightning.Providers.
In BlinkyBackground, it is work well. But in PushButton, there is no interrupt with ValueChanged.
Is the HW setup for the PushButton the same as the one here ? If you push the button, do you get any feedback on the screen/red led?
Also, are you using Raspberry Pi 2/3 or MBM?
- The HW setup is the same.
- When I push the button, there is no led at all.
- If I am not running with Lightning, PushButton works fine. That mean I installed back the "Inbox Driver" instead of "Direct Memory Mapped Driver" on web portal.
And I set breakpoint in the if statement shown as below, so I can tell lightning is enable or not:
if (LightningProvider.IsLightningEnabled)
{
// Set Lightning as the default provider
LowLevelDevicesController.DefaultProvider = LightningProvider.GetAggregateProvider();
GpioStatus.Text = "GPIO Using Lightning Provider.";
}
else
{
GpioStatus.Text = "GPIO Using Default Provider.";
}
When lightning is enabled, ValueChanged does not work.
And I am running on Rasp Pi 2.
@andyfung Thanks for your feedback. I'll try to reproduce the issue with the same sample.
Thanks a lot! I appreciated it.
Hello! Any updated? Thanks
Apologies for the delay. I'm still unable to reproduce the issue with the latest Lightning SDK. I'll try again tomorrow with a few different combinations.
Thanks. Let me know if more information is needed from me.
I figured you maybe using an older build of IOT Core. My guess, you're using 10586?
Unfortunately, the driver didn't support hardware interrupts then.
Can you try with a newer build? 14352 has the updated driver. If you're not already using the IOT Core Dashboard app, please follow this link to get it (or download directly from here).
Best regards,
Mahmoud
Correct. i am using 10586 which the instruction told me. How can I get 14352?