BusProviders icon indicating copy to clipboard operation
BusProviders copied to clipboard

Support ValueChanged and DebounceTimeout in Lightning Provider

Open CodeChief opened this issue 10 years ago • 32 comments

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.

CodeChief avatar Jan 13 '16 09:01 CodeChief

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

jessekaplan avatar Jan 13 '16 18:01 jessekaplan

Sounds great, thanks for replying so quickly :+1:

CodeChief avatar Jan 13 '16 20:01 CodeChief

Hello! Is there any news about ValueChanged supporting?

AlexandrSurkov avatar Apr 26 '16 10:04 AlexandrSurkov

We've been blocked on a few related issues, but have just cleared those up. They will be going up today.

--Jesse

jessekaplan avatar Apr 26 '16 17:04 jessekaplan

Thanks!

AlexandrSurkov avatar Apr 27 '16 09:04 AlexandrSurkov

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.

MahmoudGSaleh avatar May 24 '16 20:05 MahmoudGSaleh

I installed Microsoft IoT Lightning SDK 1.1.0-alpha. However, the ValueChanged still does not work.

andyfung avatar Jun 13 '16 21:06 andyfung

@andyfung What is the error you're getting? Can you share some code?

MahmoudGSaleh avatar Jun 13 '16 21:06 MahmoudGSaleh

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.

andyfung avatar Jun 13 '16 21:06 andyfung

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?

MahmoudGSaleh avatar Jun 13 '16 21:06 MahmoudGSaleh

Also, are you using Raspberry Pi 2/3 or MBM?

MahmoudGSaleh avatar Jun 13 '16 21:06 MahmoudGSaleh

  1. The HW setup is the same.
  2. When I push the button, there is no led at all.
  3. 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.

andyfung avatar Jun 13 '16 21:06 andyfung

And I am running on Rasp Pi 2.

andyfung avatar Jun 13 '16 21:06 andyfung

@andyfung Thanks for your feedback. I'll try to reproduce the issue with the same sample.

MahmoudGSaleh avatar Jun 13 '16 21:06 MahmoudGSaleh

Thanks a lot! I appreciated it.

andyfung avatar Jun 13 '16 21:06 andyfung

Hello! Any updated? Thanks

andyfung avatar Jun 14 '16 18:06 andyfung

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.

MahmoudGSaleh avatar Jun 16 '16 01:06 MahmoudGSaleh

Thanks. Let me know if more information is needed from me.

andyfung avatar Jun 16 '16 04:06 andyfung

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). dashboard Best regards, Mahmoud

MahmoudGSaleh avatar Jun 16 '16 18:06 MahmoudGSaleh

Correct. i am using 10586 which the instruction told me. How can I get 14352?

andyfung avatar Jun 16 '16 20:06 andyfung