Repository for Windows IoT Core Bus Provider Libraries
This project has adopted the Microsoft Open Source Code of Conduct. For more information see the Code of Conduct FAQ or contact [email protected] with any additional questions or comments.
Repository for Windows IoT Core Bus Provider Libraries
License: MIT License
Repository for Windows IoT Core Bus Provider Libraries
This project has adopted the Microsoft Open Source Code of Conduct. For more information see the Code of Conduct FAQ or contact [email protected] with any additional questions or 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.
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.
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).
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
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.
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
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.
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
Why isn't this code packaged and released in Nuget?
Do these drivers run on normal RasPi2 IoT Core machines without any Arduino? The way it's presented on the IoT download page (download link with big Arduino logo) and NuGet dependency suggests not.
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;
}
}
}
I'm not sure where to log this issue but the BackgroundMediaPlayer doesn't seem to work when I enable the Direct Memory Mapped Driver on the rpi2. When I change back to Inbox Driver, starts working again.
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.
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.
Recompiling does not fix it. Trying to remove and reattach the references also throws an exception.
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.
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):
With the lightning provider enabled, the same capture looks like this (note, SCL measures about 165KHz, way too fast!)
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.
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.
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.
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?
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.
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
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 ;-)
Hi, first I would like to refer to the following location at msdn forum.
The abs macro in Arduino.h prevents chrono std library to compile when switching from Debug to Release configuration in Visual Studio 2015. Deleting this macro (#define abs(x) ((x)>0?(x):-(x))) in line 123 abolishes this issue. Thanks
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...
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.