Quantcast
Channel: Recent Threads — Xamarin Community Forums
Viewing all articles
Browse latest Browse all 204402

Xamarin.IoT Problem trying to run a simple app on a raspberry pi 3 model b

$
0
0

Hello guys,

I just created a simple app using Visual Studio for MAC (Alpha Channel) and the template for Xamarin IoT Console Application, my demo tries to blink a led using the library "IoTSharp.Components.Raspbian" from nuget.

The raspberry has installed the latest version of raspbian at this time, I tried to run the app from VS to the raspberry but I got the following error:

System.TypeInitializationException: The type initializer for 'Unosquare.RaspberryIO.Pi' threw an exception.

And the InnerException contains:

System.IO.FileNotFoundException: Could not load file or assembly 'System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089' or one of its dependencies.

I'm pretty new to this so my first guessing was the error was caused by some kind of missing package so I just ran sudo apt-get install mono-complete but the result was exactly the same.

My code looks something like this

using System;
using System.Threading;
using IoTSharp.Components;

namespace PlantGrowHelper_Raspberry
{
    class Program
    {
        static void Main(string[] args)
        {
            var x = new IoTPin(Connectors.GPIO6);
            x.SetDirection(IoTPinDirection.DirectionOutInitiallyLow);

            Thread.Sleep(5000);

            x.Value = true;

            Thread.Sleep(5000);

            x.Value = false;
        }
    }
}

What I'm missing? I cant find much info about Xamarin.IoT on the net.

I'll appreciate your help


Viewing all articles
Browse latest Browse all 204402

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>