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

Using raspberry-sharp-io with raspberry pi3 model b+ and last version of mono.. #104

Open
hcastanedaguat opened this issue Jul 30, 2018 · 3 comments

Comments

@hcastanedaguat
Copy link

Hi..
using the latest download of this library and used with the raspberry pi3 model b+ and latest version of mono we are getting errors like the exposed below
Can any help me to fix this issue..

Thanks

pi@raspberrypi:~/Desktop/SharedInWin/testmono $ gksudo mono DesktopApp1.exe
System.NullReferenceException: Object reference not set to an instance of an object
at Raspberry.IO.GeneralPurpose.GpioConnection.Allocate (Raspberry.IO.GeneralPurpose.PinConfiguration configuration) [0x00073] in <39616ab275014559a5b975fe859e9ad9>:0
at Raspberry.IO.GeneralPurpose.GpioConnection.Open () [0x00036] in <39616ab275014559a5b975fe859e9ad9>:0
at Raspberry.IO.GeneralPurpose.GpioConnection..ctor (Raspberry.IO.GeneralPurpose.GpioConnectionSettings settings, System.Collections.Generic.IEnumerable`1[T] pins) [0x000f8] in <39616ab275014559a5b975fe859e9ad9>:0
at Raspberry.IO.GeneralPurpose.GpioConnection..ctor (Raspberry.IO.GeneralPurpose.GpioConnectionSettings settings, Raspberry.IO.GeneralPurpose.PinConfiguration[] pins) [0x00000] in <39616ab275014559a5b975fe859e9ad9>:0
at DesktopApp1.Form1.Form1_Load (System.Object sender, System.EventArgs e) [0x0002c] in :0
at System.Windows.Forms.Form.OnLoad (System.EventArgs e) [0x00022] in :0
at System.Windows.Forms.Form.OnLoadInternal (System.EventArgs e) [0x00029] in :0

@grimreaper38uk
Copy link

I'm guessing folks are going to have to see some of your source code before you get a response to this...

@negusm
Copy link

negusm commented Jun 10, 2022

Same issue:
Command:

sudo mono PiFlambeDaemon.exe

Error:
Unhandled Exception:
System.NullReferenceException: Object reference not set to an instance of an object.
at Raspberry.IO.GeneralPurpose.GpioConnection.Allocate (Raspberry.IO.GeneralPurpose.PinConfiguration configuration) [0x00073] in <39616ab275014559a5b975fe859e9ad9>:0
at Raspberry.IO.GeneralPurpose.GpioConnection.Open () [0x00036] in <39616ab275014559a5b975fe859e9ad9>:0
at Raspberry.IO.GeneralPurpose.GpioConnection..ctor (Raspberry.IO.GeneralPurpose.GpioConnectionSettings settings, System.Collections.Generic.IEnumerable1[T] pins) [0x000f8] in <39616ab275014559a5b975fe859e9ad9>:0 at Raspberry.IO.GeneralPurpose.GpioConnection..ctor (Raspberry.IO.GeneralPurpose.PinConfiguration[] pins) [0x00000] in <39616ab275014559a5b975fe859e9ad9>:0 at PiFlambeDaemon.Program.Main () [0x00009] in <e309ff0ee38543af83093bfd1121b593>:0 [ERROR] FATAL UNHANDLED EXCEPTION: System.NullReferenceException: Object reference not set to an instance of an object. at Raspberry.IO.GeneralPurpose.GpioConnection.Allocate (Raspberry.IO.GeneralPurpose.PinConfiguration configuration) [0x00073] in <39616ab275014559a5b975fe859e9ad9>:0 at Raspberry.IO.GeneralPurpose.GpioConnection.Open () [0x00036] in <39616ab275014559a5b975fe859e9ad9>:0 at Raspberry.IO.GeneralPurpose.GpioConnection..ctor (Raspberry.IO.GeneralPurpose.GpioConnectionSettings settings, System.Collections.Generic.IEnumerable1[T] pins) [0x000f8] in <39616ab275014559a5b975fe859e9ad9>:0
at Raspberry.IO.GeneralPurpose.GpioConnection..ctor (Raspberry.IO.GeneralPurpose.PinConfiguration[] pins) [0x00000] in <39616ab275014559a5b975fe859e9ad9>:0
at PiFlambeDaemon.Program.Main () [0x00009] in :0

Code:
`
using System;
using Raspberry.IO.GeneralPurpose;

namespace PiFlambeDaemon
{
internal class Program
{
static void Main()
{
InputPinConfiguration btn1 = ConnectorPin.P1Pin18.Input();
GpioConnection connection = new GpioConnection(btn1);
}
}
}
`

@negusm
Copy link

negusm commented Jun 10, 2022

Nevermind...I see that there is a newer version here:
https://nuget.org/packages/Raspberry.IO.GeneralPurpose3/

This solved my problem.

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

3 participants