Closed dulfe closed 7 years ago
DMAP and the inbox drivers are mutually exclusive. The default (inbox) I2C driver as well as the SPI and GPIO ones are disabled when DMAP driver is enabled through the device portal.
So, the code above will not work. Instead please use the sample at https://github.com/ms-iot/BusProviders/blob/develop/Microsoft.IoT.Lightning.Providers/WeatherStation/StartupTask.cs :
// Set the Lightning Provider as the default if Lightning driver is enabled on the target device
// Otherwise, the inbox provider will continue to be the default
if (LightningProvider.IsLightningEnabled)
{
// Set Lightning as the default provider
LowLevelDevicesController.DefaultProvider = LightningProvider.GetAggregateProvider();
}
// The code below should work the same with any provider, including Lightning and the default one.
I2cController controller = await I2cController.GetDefaultAsync();
Hello Dulfe, I am closing this issue based on the answer given. Please reopen if it does not address your problem. Sincerely, IoTGirl
I just started looking into the Lightning provider and the first thing I tried by I2C and I found an issue. The I2C device (returned by
DeviceInformation
) shows it as DISABLED but when using the Inbox Driver shows as ENABLED.I have a RBPi2 B with Windows 10 IoT 10.0.14393.67
I enabled DMMD Driver and created a simple program that makes reference to:
Also enabled the extensions:
Modified Package.aspxmanifest with
And with the following code:
i2cDevices
does not return any devices, buti2cDevices_ManualAQS
returns 1 which is DISABLED (I manually changed the AQS to include enabled and disabled devices) and theallDevices
shows there is a I2C1 device in it (\\?\ACPI#MSFT8000#1#{a11ee3c6-8421-4202-a3e7-b91ff90188e4}\I2C1
)If I changed the driver to Inbox Driver
i2cDevices
has 1 device and it is ENABLED.So, either
DeviceInformation
is returning incorrect data or the I2C device is not enable with using Lightning.Thank you!