Giter Site home page Giter Site logo

busproviders's Introduction

busproviders's People

Contributors

bfjelds avatar davidshoe avatar jessekaplan avatar mahmoudgsaleh avatar ooeygui avatar tgoodhew avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

busproviders's Issues

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.

Project status

Hello,
What is the current status of this project? it looks very promising but looking at the history there doesn't seem to be a lot of activity and its very cumbersome to use since its not published to nuget and the instructions are somewhat lacking.

IoT Capabilities Not Visible in Visual Studio Package Manifest Editor

Following on from #23 can we get these "hidden" capabilities (the "lowLevelDevices" and the device GUID) into the VS editor? I appreciate if this is not for this repository then please tell me where it should be logged. Last time I tried to raise an issue about an MS SDK with MS Connect for Visual Studio they just closed it as "external" without any explanation or come-back.

Failing an editor, perhaps you could inject a build warning (actually it's really an error if you use the Lightning provider) as a workaround to inform the developer (and save a lot of wasted time and hair pulling).

Pi 3 - DmapSupport GetControllerBaseAddress for BCM2844 does not find device???

I've been trying to enable either PWM0 or PWM1 using the proper alternate function calls to the relevant register on the BCM2835. I think I have the pin configured properly but now I need to enable the PWM in the proper register in the BCM2844 chip. I can see the "#define pi2PwmDeviceName" in the DmapSupport.h file but when I try to use the "GetControllerBaseAddress" function using the PWM device name it comes back blank. I've looked in the dmap.inf file on the Pi and I see "%dmap.DeviceDesc%=dmap_Device,*MSFT8001,ACPI\BCM2841,ACPI\BCM2845,ACPI\BCM2838,ACPI\BCM2839" but there's no BCM2844? Was this done on purpose? Can anyone supply any help so I can write to that chips register to get any PWN working?

The software driven PWM isn't dependable enough for my setup...

Help Please (and thanks)

Jim

Need timestamp on ValueChanged event to decode PWM

Following on from issue #26 I'd like to officially request support for a timestamp in the ValueChanged event. It was nice to get the ValueChanged support at all in the Lightning provider, but unfortunately it has not yielded any benefit for PWM decoding, in fact made it worse. See my last post there for some sample results which demonstrate this degradation.

Please add a timestamp to the value changed event. It just needs to be any increasing value you like, perhaps the internal stopwatch value, but accurate to "some" microseconds as typical PWM protocols decode cycles of ~500-2500 microseconds.

If it were produced by the driver, then it would be really simple because they have direct access to a high accuracy timer without overhead. But even if changes are only allowed in the Lightning provider, that would still help because it runs at a higher priority (closer to the "fact"). Logically it makes absolutely no sense to make "after the fact" timings, the only sane thing to do is record a timestamp at/closest to where the event occurred. So 1st choice driver, 2nd choice your provider. Either would make me and anyone else needing to decode PWM in software with IoT very happy!

Without this, software PWM input (not dumb switching, real PWM = pulse WIDTH values) is simply not possible with the Windows IoT SDK.

Network Adapter Priorities in IoT broken after creators fall update

Hi,

After posting on the MSDN forum I was redirected here.

We have a board with 2 LAN ports, WiFi and an MBIM modem running Windows IoT core.

After the recent update of Windows IoT core our combination of an ethernet connection on a LAN port and the MBIM modem stopped working.

Everything was working fine a few months ago. A recent Windows update (1709) however made sure that if you have an active ethernet connection without internet, Windows does not route the internet through the MBIM modem anymore.
After disconnecting the ethernet, internet through the MBIM modem works fine. Plug it back in and internet through the MBIM modem stops again. A ping test with forced routing works fine, but any other traffic is not routed through the modem. It seems to be an MBIM driver specific problem since the combination WiFi and LAN without internet works fine.

We tried several things like: leaving the default gateway blank, changing metric interface and managing network adapter priorities (which I understand is created especially for these situations and should work/has worked)

The problem is more thoroughly described here, but this thread seemed to have died quickly: https://social.technet.microsoft.com/Forums/windows/en-US/e20c2af2-f2c1-419c-a2a3-cd2d07d8e699/network-problem-with-mbim-after-upgrading-windows-10-1709?forum=win10itpronetworking#e20c2af2-f2c1-419c-a2a3-cd2d07d8e699

Info on the prioritizing of the connection (what now is broken) here: https://www.ghacks.net/2016/12/02/change-network-adapter-priorities-in-windows-10/

Is this a known issue? Is there a temporary work-around?

My first choice would be for Microsoft to fix this of course, since it's clearly a freshly introduced bug.

To be clear: since we did not find a workaround this is a mayor blocking issue.
It is preventing the roll-out of a pretty important field test of Windows IoT core consisting of approximately 100 devices and has now already proven to be a disaster for our final production timeline.

Any help is greatly appreciated!

Greetings

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

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.

Sql Server Dependencies

I forked the repo and brought it local. When I opened it using VS2015 Ultimate, I get the following error message
capture

Is GpioChangeReader not supported with Lightning ?

Hi,

When I try to use the GpioChangeReader with the direct memory mapped driver I get an exception.
This even occurs in the insider preview version : v.10.0.17035.1000
Is it supported in lightning or is it an implementation error on my side ?
When I switch to the inbox driver everything works just fine.

Best regards

Lightning provider allows only one instance of I2cDevice

When using the lightning provider, as soon as I try to create a second instance of I2cDevice, I get the following error:

The program '[0xA34] backgroundTaskHost.exe' has exited with code -1073741189 (0xc000027b).

This is at variance with the inbox provider, which works as expected.

Unfortunately this means that the lightning provider prevents communication with more than one I2C device, unless all other instances are disposed and re-created every time they are used. This is no good at all!

The problem can be reproduced using the following complete UWP Background Application, which works with the inbox provider but fails with the lightning provider:

using System;
using System.Threading.Tasks;
using Windows.ApplicationModel.Background;
using Windows.Devices;
using Windows.Devices.I2c;
using Microsoft.IoT.Lightning.Providers;

// The Background Application template is documented at http://go.microsoft.com/fwlink/?LinkID=533884&clcid=0x409

namespace I2cConcurrencyTest
    {
    public sealed class StartupTask : IBackgroundTask
        {
        public void Run(IBackgroundTaskInstance taskInstance)
            {
            if (LightningProvider.IsLightningEnabled)
                {
                // Set Lightning as the default provider
                LowLevelDevicesController.DefaultProvider = LightningProvider.GetAggregateProvider();
                }

            var controller = I2cController.GetDefaultAsync().AsTask().WaitFoResult();
            var device1Settings = new I2cConnectionSettings(0x50);
            var device1 = controller.GetDevice(device1Settings);
            var device2Settings = new I2cConnectionSettings(0x60);
            var device2 = controller.GetDevice(device2Settings);
            }
        }

    public static class TaskExtensions
        {
        internal static TResult WaitFoResult<TResult>(this Task<TResult> asyncOperation)
            {
            asyncOperation.Wait();
            return asyncOperation.Result;
            }
        }
    }

Cannot create more than one SPI device from SPI controller on Raspberry PI 2

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.

    private async Task TestInitSpiDevices()
    {
        try
        {
            SpiController controller = await SpiController.GetDefaultAsync();     /* Get the default SPI controller */

            var settings1 = new SpiConnectionSettings(0); /* Create first SPI device                               */
            settings1.ClockFrequency = 3000000;
            settings1.Mode = SpiMode.Mode0;    

            var spiDevice1 = controller.GetDevice(settings1);             /* Get the Spi Display device using its settings */

            var settings2 = new SpiConnectionSettings(1); /* Create second SPI device                               */
            settings2.ClockFrequency = 3000000;
            settings2.Mode = SpiMode.Mode0;

            var spiDevice2 = controller.GetDevice(settings2);

        }
        catch (Exception exc)
        {
            string message = 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.

Project does not compile

After pulling down a forked repo, I tried to compile the 2 CPP projects (PwmPCA9685 & PwmSoftware). It says it successfully compiles, but no .dll is generated in the .bin folder. Also, the references from the SamplePWMConsumer project are broken.
capture

Recompiling does not fix it. Trying to remove and reattach the references also throws an exception.

Support ValueChanged in Lightning Provider for MinnowBoard with Windows IoT build 16299

With reference to the case #26.

ValueChanged is not working for me. I'm using Minnowboard Turbot dual core with windows iot build 16299. I have added Microsoft.IoT.Lightning v1.1.0. I wanted to capture an interrupt continuously (which is generated at an interval rate of less than 20 micro seconds and operates at a Frequency of 50-60 kHz ) using a gpio as input pin. I'm able to set a gpio as output also. Now i need to use ValueChanged. Can anyone help me in this regard.

I2C Bus Speed too fast when set to 'Standard' mode, resulting in data corruption

When using an I2C device with the bus speed set to 'Standard' mode, the bus speed used by the Lightning provider is too fast and exceeds the 100KHz maximum, resulting in data corruption.

I create my I2C settings like this:

    public static I2cConnectionSettings ConnectionSettings(int address = DefaultSlaveAddress)
    {
        return new I2cConnectionSettings(address) {BusSpeed = I2cBusSpeed.StandardMode};
    }

With the default 'inbox' driver, that produces bus activity like so (note the SCL frequency measures dead on 100KHz, which is the maximum allowed speed in Standard mode):

i2c timing with inbox driver

With the lightning provider enabled, the same capture looks like this (note, SCL measures about 165KHz, way too fast!)

i2c timing with lightning enabled

I've tried the exact same code (driving an MLX90614 temperature sensor) with both drivers and with the lightning driver enabled, it produces meaningless data which fluctuates wildly. Looking at the protocol analysis, it is clear that things are just not working correctly.

Expose a virtual byte-sized port for GPIO

Many applications have need of an 8-bit parallel transfer of I/O. Is it possible to expose at least one virtual "SetPort/ReadPort" command in the GPIO library that would allow reading/writing of 8 pre-selected GPIO lines in parallel?

For many applications the bit-by-bit read/write limitation of the API is too slow.

Remove Un-necessary Internet Client Capability from Lightning Provider

Please remove the "internet client" capability from the Lightning Provider before you deliver a final NuGet package with the consumer WINMD (I know currently the NuGet package just has C++/Arduino dependencies).

I presume you are delivering the Microsoft.Iot.LightningProvider.winmd to NuGet, else it's very cumbersome to have to build and copy interim code just to use the new provider.,

Anyway the point of concern is that users/customers will think our hardware apps want to access the internet. So following the security best practice of least privilege (also preached by MS) we must not claim something we do not require.

I'm talking about removing the "" of course. At least from the lightning provider c++ project, but best from all samples to demonstrate the best practice.

SPI Bus 1 Select?

Howdy,

I can access the SPI0 bus just fine, but also need to access the SPI1 bus on a R Pi 3. This is not an issue using the SpiDevice methods without Lightning.

Can an example be added or an small note made on how to select other SPI buses?

Reading SPI with TransferFullDuplex method does not deliver any data on Raspberry PI 2

The following code delivers only empty bytes in resultBuffer. deviceCmd is a SPI device on line 0 using the lightning provider:

    public ushort ReadCmd(byte address)
    {
        byte[] readCmd = { 0x3, address, 0, 0 };
        byte[] resultBuffer = new byte[4];

        this.deviceCmd.TransferFullDuplex(readCmd, resultBuffer);
        ushort result = (ushort)(resultBuffer[3] + (resultBuffer[2] << 8));

        return result;
    }

The test device is a vlsi codec chip. The same method run with the Inbox driver delivers data as expected. Platform is Raspberry Pi 2 Model B running Windows IoT 10.0.10586. Method TransferSequential does not work either with lightning provider.

LightningProvider Required Capabilities Not Documented Here

In the ReadMe.md of the Lightning providers you are missing the critical requirement that the "lowLevelDevices" and the other hidden device capability GUID must be added. Otherwise people will just have their correct code (copied from the sample) bomb-out in Managed code without any error message!

It's only documented here: https://ms-iot.github.io/content/en-US/win10/LightningProviders.htm
https://ms-iot.github.io/content/images/Lightning/update_manifest.png

But really must be added here: https://github.com/ms-iot/BusProviders/blob/develop/Microsoft.IoT.Lightning.Providers/README.md

References:
https://social.msdn.microsoft.com/Forums/en-US/8996072f-2cce-4879-a20d-cb27de8a80eb/direct-memory-mapped-gpio-driver-how

A small change that will help new users a lot. Also whilst you are updating the readme files please add a link to the child readme files from the BusProviders root readme. When people arrive at your GitHub project it just looks like nothing is documented ;-)

Any ways to control ACK and NACK on I2C

Hello!
Is there any way to control ACK\NACK responses for I2C from C#?
I need to simulate some device that respond NACK for START condition when device is busy...

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.