osx usb communication error.

HomeForumsMonoBrick Communication Libraryosx usb communication error.

This topic contains 3 replies, has 2 voices, and was last updated by Author Image Anders Søborg 3 years, 5 months ago.

Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #3985
    Author Image
    Thai Ho
    Participant

    Hi All,

    I am very new to Monobrick. I have been trying to connect to ev3 via usb without any success. I am testing this on OSX 10.9 running on Xamarin Studio 4.2.1. I also added monobrick.dll, LibUsbDotNet.dll to the references:
    I also copied all of the files from Monobrick to the bin/debug folder.

    I have been trying to get this to work in the last week. Finally I am resourcing to this forum for help.
    Thank you if anyone can point out what I am missing to get the USB connection to work.

    This is my sample program:

    using System;
    using MonoBrick.EV3;

    namespace ev3
    {
    class MainClass
    {
    public static void Main (string[] args)
    {

    var ev3 = new Brick<Sensor,Sensor,Sensor,Sensor>(“usb”);

    try{
    ev3.Connection.Open();
    ev3.MotorA.On(50);
    System.Threading.Thread.Sleep(3000);
    ev3.MotorA.Off();
    }
    catch(Exception e){
    Console.WriteLine(e.StackTrace);
    Console.WriteLine(“Error: ” + e.Message);
    Console.WriteLine(“Press any key to end…”);
    Console.ReadKey();
    }
    finally{
    ev3.Connection.Close();
    }
    }
    }
    }

    Below is the terminal print out error:

    at MonoBrick.HidLib`2[MonoBrick.EV3.Command,MonoBrick.EV3.Reply].Open () [0x00000] in <filename unknown>:0
    at MonoBrick.USB`2[MonoBrick.EV3.Command,MonoBrick.EV3.Reply].Open () [0x00000] in <filename unknown>:0
    at ev3.MainClass.Main (System.String[] args) [0x00013] in /Users/Thai/Desktop/EV3/EV3/Program.cs:15
    Error: Failed to open connection
    Press any key to end…

    Press any key to continue…

    #3986
    Author Image
    Thai Ho
    Participant

    Here is my sample file that I can’t get it to work.

    #3991
    Author Image
    Thai Ho
    Participant

    I finally got it running the test application on my window XP.
    It was my mistake. I had the brick boot with MonoBrick Firmware.

    I didn’t realized that I can just use Lego Firmware with the test application.

    #3995
    Author Image
    Anders Søborg
    Key Master

    Ok

    That is great. Thanks for posting that everything is ok…

    Anders

Viewing 4 posts - 1 through 4 (of 4 total)

You must be logged in to reply to this topic.

Posted in

Make a donation