Windows 10 IoT Support

Hi there,

Any plans to port the GrovePi libraries to work on Windows 10 IoT on the RasberryPi 2? If not is the library source available to look at with regard to porting it?

Cheers
Jonathan

Hey Jonathan,
We just saw the news as well! This is really cool and it looks like they’re already making some awesome robots. I haven’t dug too deep into the offering, but I’d really like to. The port could be really easy or really tough, depending on how C and Python are implemented in the OS.

I’m also curious about how we should offer it so that it’s easy for other folks to use, and easy for other folks to contribute to, and easy for us to maintain. Do we fork the current github content? Or do we offer Windows side by side within the github repos?

A few things to decide. I’d like to play with the new Windows release though and figure out how to use it first before we move forward. Have you used it? What do you think?

Well I have a Pi model B and my Pi2 arrived today. So far I have gotten Windows IoT up and running on it and ran a quick hello world app on it from visual studio community edition.

My GrovePi arrives tomorrow so was gonna first make sure it’s working fine on the Pi1 then play with it on Win IoT.

I saw a few samples around of controlling a I2C device via c# so was gonna start tinkering.

I am new to GrovePi so no doubt it’ll be an adventure.

I’m not sure I even need libraries, by that I mean if I can control an I2C device via .net system libraries, any GrovePi libraries over that would mainly for ease of use purposes right?

Cheers
Jonathan

Btw if I do get anywhere interesting, I’m happy to contribute anything I come up with on github.

Hey Jonathan,
Do let us know how it goes for you with Windows 10 and the Raspberry Pi. I believe that we’ll have to write the basic I2C functions again for windows 10, I can’t seem to find much about it but hopefully things will be come cleared in the coming days.

Also, I was just going through the documentation on the Windows 10 site and found that it needs Windows 10 installed on the computers. Maybe I misread it but it would be nice to know from other folks how easy or how difficult it is to get Windows 10 to work.

We’ll be more than happy to merge your contributions to out Github repo, so feel free to push code. We don;t have a C# library for GrovePi for Raspbian too, so if you are planning to port the library, it would be a lot more helpful to have it first for Raspbian.

-Karan

Hi Karan,

To use Windows IoT you do need a few things…

  • Member of the Windows 10 insider program (free)
  • Windows 10 Insider Preview (free)
  • Visual Studio 2015 RC Community Edition (free)
  • Windows IoT preview for RP2 (free)

When you mention a library that will need porting, are you referring to a python library or a lower level c library? Could you point me to the github url for the library you’re referring to please?

Cheers
Jonathan

Hey Jonathan,
That’s a lot of requirements for running the OS.

Basically we need a need to port the GrovePi library here: https://github.com/DexterInd/GrovePi/blob/master/Software/Python/grovepi.py and the GrovePi library uses smbus library: https://github.com/bivab/smbus-cffi/blob/master/smbus/smbus.py . I had a look at a C# example earlier today and it I think it uses a DLL to communicate which would make things harder. We’ll wait a bit to see how the response is and if it easy enough to port the libraries then we’ll do it ASAP otherwise it might take some time.

-Karan

Hey Jonathan,
That’s a lot of requirements for running the OS.

Basically we need a need to port the GrovePi library here: https://github.com/DexterInd/GrovePi/blob/master/Software/Python/grovepi.py and the GrovePi library uses smbus library: https://github.com/bivab/smbus-cffi/blob/master/smbus/smbus.py . I had a look at a C# example earlier today and it I think it uses a DLL to communicate which would make things harder. We’ll wait a bit to see how the response is and if it easy enough to port the libraries then we’ll do it ASAP otherwise it might take some time.

-Karan

I made some progress on this. I was able to read the firmware version from the grovepi on Windows IoT in C#. I didn’t realize I had as I got 3 bytes of 255, 255, 255. So I hooked up the grovepi to my Pi model B and setup and ran you grove_firmware_version_check.py python script, it returned 255.255.255, that’s when I realized I had success, I think, 255.255.255 seems like an erroneous firmware number though?

Cheers
Jonathan

Here is the c# gist, which does result in the same 255.255.255 version running on my Pi2 as the python version does running on a Pi 1b…

Hey,
You do get 255.255.255 with the old firmware which just means that you get nothing at all. You should update the firmware and try it out again on both the Pi and the C# example.

-Karan

Yep, 1.2.2 after upgrade. Great! Should be pretty straightforward to create a GrovePi-IoT library from here!

Hey @Robsoni,
.Net developer here as well. I also just hooked up my PI. Need any help with creating the libraries? Is your current work on Git?

I just uploaded the beginnings of a library here, feel free to contribute…

added digital read and write. in pull request.

I only had an IR sensor to test it with. when plugged in it read 1.255.255.255, when the sensor was removed it read 0.255.255.255.

Great work guys, looks like you are really making progress with the C# library.

Do send us a pull request when the library is in a good place to let other users use it too.

Thanks again.
Karan

Thanks Exadon! I merged the pull request and changed the signatures slightly. Do you know what the difference between Read and ReadPartial is? I cant seem to find any docs on the difference.

Cheers
Jonathan

Sure @RJohnathan, excited to work on this (My name is Paul btw).

Not sure on the difference, I tried both just as a test but switched it back to a “Read” on my last pull request.

I also saw a WriteRead method. You would think this would replace the need to do

Write() 
Read()

on each read request, but no luck getting it to work.

Feel free to email me anytime, Exadon@gmail.com
Cheers,
Paul

Edit: I left the “write” value unsuded and forgot to add it, thanks for fixing this , Ill update the AnalogWrite tonight

Hi Paul, Jonathan here, thanks for the contribution!

I tried WriteRead() because like you say it seems like an obvious replacement, but it doesn’t work. Throws an exception about a file not found. So maybe a different under lying implementation to what we expect.

I added PinMode() and got the led attachment to turn on and off. Baby steps :slight_smile:

Awesome! So DigitalWrite works? Great news. Time for me to buckle down and buy some GrovePi sensors for this project.