Oleg Stepanow

Forum Replies Created

Viewing 6 posts - 1 through 6 (of 6 total)
  • Author
    Posts
  • in reply to: Error sending brick command #5012
    Author Image
    Oleg Stepanow
    Participant

    both for 64 bit- hidapi and testApplication

    in reply to: Error sending brick command #5005
    Author Image
    Oleg Stepanow
    Participant

    Aha! You use different connections for NXT and EV3:
    connection = new LibUsb<TBrickCommand,TBrickReply>(LegoUsbConstants.VendorId, LegoUsbConstants.NXTProductId, ReadEndpointID.Ep02, WriteEndpointID.Ep01); that for nxt

    connection = new HidLib<TBrickCommand,TBrickReply>(LegoUsbConstants.VendorId, LegoUsbConstants.EV3ProductId, true); and that for EV3
    So the problem seems to be in HidLib, yes. Sory for bothering you, I will try to fix it someway)

    in reply to: Error sending brick command #5003
    Author Image
    Oleg Stepanow
    Participant

    Im on windows 7 64
    Nothing worked at all untill I rebuilt hidapi.dll to 64 bit platform. Now it`s as I described…

    Got it:
    in usb.cs

    if(bytesWritten == -1)
                            hasError = true;

    seems I steel have problems with hidapi… but with nxt it works good.

    Now im using both nxt and ev3 in one programm with same result. both connect, nxt gets commands, ev3 fails to.

    in reply to: Error sending brick command #4998
    Author Image
    Oleg Stepanow
    Participant
    using System;  
    using MonoBrick.EV3;//use this to run the example on the EV3
    //using MonoBrick.NXT;//use this to run the example on the NXT  
    namespace Application  
    {  
        public static class Program
        {
            private static Brick<Sensor, Sensor, Sensor, Sensor> brick;
          static void Main(string[] args)  
          {  
            try
            {
    
                Console.WriteLine(1);  
                brick = new Brick<Sensor,Sensor,Sensor,Sensor>("usb");  
                sbyte speed = 0;
                Console.WriteLine(2);
                brick.Connection.Open();
                Console.WriteLine(3);  
                brick.MotorA.On(20);
                Console.WriteLine(4); 
                Console.WriteLine("333");  
                ConsoleKeyInfo cki;  
                Console.WriteLine("Press Q to quit");  
                do   
                {  
                    cki = Console.ReadKey(true); //press a key  
                    switch(cki.Key){    
                        case ConsoleKey.R:
                           
                            int c = brick.MotorB.GetTachoCount(); 
                            Console.WriteLine("Motor A reverse direction");    
                            brick.MotorA.Reverse = !brick.MotorA.Reverse;    
                        break;                              
                        case ConsoleKey.UpArrow:     
                            if(speed < 100)    
                                speed = (sbyte)(speed + 10);    
                            Console.WriteLine("Motor A speed set to " + speed);    
                            brick.MotorA.On(speed);    
                        break;    
                        case ConsoleKey.DownArrow:     
                            if(speed > -100)    
                                speed = (sbyte)(speed - 10);    
                            Console.WriteLine("Motor A speed set to " + speed);    
                            brick.MotorA.On(speed);    
                        break;    
                        case ConsoleKey.S:     
                            Console.WriteLine("Motor A off");    
                            speed = 0;    
                            brick.MotorA.Off();    
                        break;    
                        case ConsoleKey.B:    
                            Console.WriteLine("Motor A break");    
                            speed = 0;    
                            brick.MotorA.Brake();    
                        break;  
                         case ConsoleKey.T:    
                            int count = brick.MotorA.GetTachoCount();  
                            Console.WriteLine("Motor A tacho count:" +count);    
                        break;  
                        case ConsoleKey.C:    
                            Console.WriteLine("Clear tacho count");    
                            brick.MotorA.ResetTacho();  
                        break;  
                        case ConsoleKey.M:  
                            Console.WriteLine("Enter position to move to.");  
                            string input = Console.ReadLine();  
                            Int32 position;  
                            if(Int32.TryParse(input, out position)){  
                                Console.WriteLine("Move to " + position);  
                                brick.MotorA.MoveTo(50, position, false);  
                            }  
                            else{  
                                Console.WriteLine("Enter a valid number");  
                            }  
                        break;  
                    }  
                } while (cki.Key != ConsoleKey.Q);  
            }  
            catch(Exception e){  
                Console.WriteLine("Error: " + e.Message);  
                Console.WriteLine("Press any key to end...");  
                Console.ReadKey();                
            }  
          }  
        }  
    } 

    as I talled, it`s a code from test application, with just small changes

    in reply to: Error sending brick command #4996
    Author Image
    Oleg Stepanow
    Participant

    I`m using your TestApplication
    I just entered some traces for debugging.

    Console.WriteLine(1);
    var brick = new Brick<Sensor,Sensor,Sensor,Sensor>(“usb”);
    sbyte speed = 0;
    Console.WriteLine(2);
    brick.Connection.Open();
    Console.WriteLine(3);
    brick.MotorA.On(20);
    Console.WriteLine(4);

    it comes to tracing 3 and after throughs error (when I send command to MotorA)
    I tried different motors and other commands, all the same.
    Before I also had trouble like this http://www.monobrick.dk/forums/topic/fail-to-connect-ev3-via-usb/
    But i fixed it the same way as posted there.

    in reply to: Error sending brick command #4992
    Author Image
    Oleg Stepanow
    Participant

    tried it with E1.03 firmware on my ev3 brick- result is the same.

Viewing 6 posts - 1 through 6 (of 6 total)
Posted in

Make a donation