ms-iot / BusProviders

Repository for Windows IoT Core Bus Provider Libraries
MIT License
40 stars 44 forks source link

Cannot create more than one I2C device from I2C controller on Raspberry PI 2 #20

Closed Norbert62 closed 8 years ago

Norbert62 commented 8 years ago

The following code throws an unhandled System.IO.FileLoadException with message "The process cannot access the file because it is being used by another process." when using the lightning library.The catch block is not entered.

        // The code below should work the same with any provider, including Lightning and the default one.
        I2cController controller = await I2cController.GetDefaultAsync();
        // Ox40 was determined by looking at the datasheet for the Weather shield

        try {
            var sensor = controller.GetDevice(new I2cConnectionSettings(0x40));

            var testSecondSensor = controller.GetDevice(new I2cConnectionSettings(0x44));

        }
        catch (Exception exc) {
            string s = exc.Message;
        }

Creating only one device works without any error. Platform is Raspberry Pi 2 Model B running Windows IoT 10.0.10586. The code runs flawlessly with the Inbox driver.

MahmoudGSaleh commented 8 years ago

Fixed with the latest Lightning SDK, v1.1.0-alpha. If not fixed for you, please feel free to re-open the issue.