Windows 10 IoT Support

Just wondering if I am doing something obviously wrong;

I have a sensor set that has a 2 line display and DHT11 temperature/humidity, ultrasonic ranger, sound, light, and PIR motion (Grove, purchased separately) sensors. I added support for the PIR Motion to the library locally (I think it was straight forward and it seems to work). I am testing using the Simple Driver project and just added lines of code to read each sensor and display the readings on the 2 line display. I added 500 ms delays between each sensor read based on some stability issues I had reading multiple sensors without delays on Raspbian/Python. The code is not complicated;

    while (true)
    {
            var distance = _deviceFactory.UltraSonicSensor(Pin.DigitalPin4).MeasureInCentimeters();
            Task.Delay(500).Wait();
            var tempInCelcius = _deviceFactory.TemperatureAndHumiditySensor(Pin.DigitalPin7, TemperatureAndHumiditySensorModel.DHT11).TemperatureAndHumidity();
            Task.Delay(500).Wait();
            var level = _deviceFactory.LightSensor(Pin.AnalogPin1).SensorValue();
            Task.Delay(500).Wait();
            var sound = _deviceFactory.SoundSensor(Pin.AnalogPin0).SensorValue();
            Task.Delay(500).Wait();
            SensorStatus s = _deviceFactory.PIRMotion(Pin.DigitalPin8).CurrentState;
            Task.Delay(500).Wait();
            string txt = "D:" + distance.ToString() + " T:" + tempInCelcius.Temperature.ToString() + " H:" + tempInCelcius.Humidity.ToString() + " L:" + level.ToString() + " S:" + sound.ToString() + " M:" + (s == SensorStatus.Off ? "0" : "1");
            _deviceFactory.RgbLcdDisplay().SetText(txt).SetBacklightRgb(0, 255, 0);
            Task.Delay(10000).Wait();
            _deviceFactory.RgbLcdDisplay().SetText(txt).SetBacklightRgb(255, 0, 0);
            Task.Delay(500).Wait();
    }

While running, the code works mostly ok (temperature, humidity, motion and ranger values look good) - although sometimes the analog readings (light/sound) seem off - sometimes they look good. After a minute or two though, I get random I/O device errors. I believe the error is always on a DirectAccess.Write call, but I have seen the error on both analog and digital pins.

The Exception information is;

Type: System.Runtime.InteropServices.COMException
Data: System.Collections.IDictionary {System.Collections.ListDictionaryInternal}

HResult 0x8007045d

Message:
The request could not be performed because of an I/O device error.
Unexpected number of bytes was transferred. Expected: '. Actual: '.

StackTrace;
at Windows.Devices.I2c.I2cDevice.Write(Byte[] buffer)
at GrovePi.GrovePi.PinMode(Pin pin, PinMode mode)
at GrovePi.Sensors.LightSensor…ctor(GrovePi device, Pin pin)
at GrovePi.DeviceBuilder.<>c__DisplayClass21_0.<LightSensor>b__0(GrovePi x)
at GrovePi.DeviceBuilder.DoBuild[TSensor](Func`2 factory)
at GrovePi.DeviceBuilder.LightSensor(Pin pin)
at Driver.SimpleDriver.Run(IBackgroundTaskInstance taskInstance)"

Has anyone seen this before? Any pointers? Is it something obvious or silly that I am doing? Sorry, I’m new to developing on IoT core.

I can post the PIR Motion updates, if that might be the issue.

Thanks
Mitch

@Mitch
I often have this problem with Microsoft IoT. I am not sure of the best solution and it does feel very intermittent. A work around is to wrap your call around a Try Catch.

Hi,

my GrovePi board reports firmware version 255.255.255, so it needs a upgrade. How can I install the newer firmware when the Raspberry Pi is running Windows 10?

Kind regards,
Diederik

Hey Diederik, you might need to use Raspbian for Robots or at least a Wheezy based image. Do you have a spare SD Card?

Fair enough. Thanks, John!

I’m having a problem like others, none of the sensors seem to report values, they all just read zero.

I’m using the CSharp library (tried both GitHub and Nuget packages), started with the Blinky project on hackster.io and it didn’t blink.

So I tried the ultrasonic sensor and that read zero, temperature and humidity sensor, that was zero.

Is this likely to be a firmware issue, my GrovePi is freshly bought?

Hi Martin,

I’m currently creating a Universal Windows App to test the GrovePi on a Windows 10 Raspberry Pi. The source code is here: https://github.com/XamlBrewer/UWP-GrovePi-Test-Bench. You may want to give it a try.

Kind regards,
Diederik

I have added interfaces for AirQuality Sensor in grove pi github repo (https://github.com/DexterInd/GrovePi/tree/master/Software/CSharp) which supports C#.

So now what can be done to get the nuget package(https://www.nuget.org/packages/GrovePi/) updated with the newly added sensors ?

@Exadon and @robsonj, could you help in this matter.

Regards,
Abhishek Sharma

Is anyone running a pi3? I’m running into lots of problems… didn’t want to mention them unless others are running the same thing…

also running 10.0.14366.0 of windows IoT

Hello @idaband, I’ve recently run the Raspberry Pi 3 with Windows IOT and did not run into problems running the example programs. I as running 10.0.14393.0 OS on the Pi.