Skip to content

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

Open

Description

@hcastanedaguat

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

Activity

  1. grimreaper38uk commented on Aug 15, 2018

    @grimreaper38uk

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

  2. negusm commented on Jun 10, 2022

    @negusm

    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);
    }
    }
    }
    `

  3. negusm commented on Jun 10, 2022

    @negusm

    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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions