Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Licensing #1

Closed
DanielSSilva opened this issue May 19, 2018 · 6 comments
Closed

Licensing #1

DanielSSilva opened this issue May 19, 2018 · 6 comments

Comments

@DanielSSilva
Copy link

Hello there! Really glad that I've found this project :) As I've mentioned in the other issue (on the organization) I want to develop a module for PowerShell. I don't know if you are familiar with it, but PowerShell uses .Net Framework. This means that I can possibly use your module for the development. Although, there are 2 issues:

  • Since you don't specify any Licensing, i don't know if I'm allowed to use it;
  • Your project is targeting .NET 4. something, and using System.Drawing. PowerShell Core uses the .Net core, which doesn't have that library.
    Would you be interested in trying to collaborate and migrate to .NET Core? If you don't want to, can I migrate your project (keep the credits) and migrate it to .NET Core?
    Do you have any Slack or gitter that we can talk? (Or maybe twitter)
    Thanks!
@Urmel11
Copy link
Member

Urmel11 commented May 20, 2018

Hi Daniel,
nice to hear that you want to use this library to develop a PowerShell wrapper.
Of course you are allowed to use it ;)
I added the "BSD 2-Clause "Simplified" License" so that you are officially allowed to do so.
This is the license of the original project (https://github.com/jgarff/rpi_ws281x).

The C# solution consists of 2 projects:

  1. rpi_ws281x
    This project is the actual wrapper which you should use. It targets already .NET Standard 2.0.
    is this sufficient for you? Can you use .NET Standard libraries?

  2. TestApp
    This is just a console application which uses the rpi_ws281x library to demonstrate its usage.
    The project targets .NET Framework 4.6.1. In my opinion this project does not need to be migrated.

Fabi

@Urmel11 Urmel11 closed this as completed May 20, 2018
@Urmel11 Urmel11 reopened this May 20, 2018
@DanielSSilva
Copy link
Author

Hello again. Thank you for your answer. Yesterday I was messing around with your repo and was able to compile it for core. Although when I ran it i had an exception on the ws281x_t ctor (if i recall correctly). It was this exception https://stackoverflow.com/questions/15544818/non-blittable-error-on-a-blittable-type?utm_medium=organic&utm_source=google_rich_qa&utm_campaign=google_rich_qa
Have you had any similar error? I don't know if dotnet and mono handle things differently

@DanielSSilva
Copy link
Author

Oh and it would be a really good help if you/we could make this a nuget package in order to be easier to manage dependencies.

@Urmel11
Copy link
Member

Urmel11 commented May 28, 2018

Hi,
sorry for my delayed respone.
I did not got such exceptions.
Do you use the version of the native library which is linked in this repo?
Can you provide more exception details?
Which runtime do you use for execution (mono or .Net Core)?

@DanielSSilva
Copy link
Author

Hi, no problem. I'm using the native library yes.
I'm using the .Net Core runtime.
the exception full exception states the following

Unhandled Exception: System.ArgumentException: Object contains non-primitive or non-blittable data.
   at System.Runtime.InteropServices.GCHandle.InternalAlloc(Object value, GCHandleType type)
   at System.Runtime.InteropServices.GCHandle.Alloc(Object value, GCHandleType type)
   at rpi_ws281x.WS281x..ctor(Settings settings) in /home/daniel/Documents/RPI/rpi-ws281x-csharp/src/rpi_ws281x/WS281x.cs:line 28
   at TestAppCore.ColorWipe.Execute(AbortRequest request) in /home/daniel/Documents/RPI/rpi-ws281x-csharp/src/TestAppCore/ColorWipe.cs:line 27
   at TestAppCore.Program.Main(String[] args) in /home/daniel/Documents/RPI/rpi-ws281x-csharp/src/TestAppCore/Program.cs:line 38

This leads to the line where you pin the object into memory

_ws2811Handle = GCHandle.Alloc(_ws2811, GCHandleType.Pinned);

and it complains about this struct

[MarshalAs(UnmanagedType.ByValArray, SizeConst = PInvoke.RPI_PWM_CHANNELS)]
    public ws2811_channel_t[] channel;

@Urmel11
Copy link
Member

Urmel11 commented Jun 1, 2018

Since my current raspberry does not support armv7 instructions, I am not able to install .NET Core to reproduce the exception. I have just ordered a new model which will be delivered the next days.
Because the licensing issue is done, I want to the track the exception in the new issue #2.

@Urmel11 Urmel11 closed this as completed Jun 1, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants