Using MindSqualls with USB
2 posters
Page 1 of 1
Using MindSqualls with USB
Hi,
I started working with the MindSqualls API this week in the hope to make progress in my project to control stepper motors using the NxtBrick. Right now, I can connect to the Nxt brick using Bluetooth (using the MindSqualls API), but not with USB. I want to use USB because the lagging time with BT is way too large. I know my Nxt brick and USB connection in my computer are working correctly, because I can connect via USB using Brickcc. However, no matter what I try, I cannot connect via USB using MindSqualls. I already tested .NET 2.0 and .NET 3.5. I also tried a different computer with the same results: BT works, USB connection no. By reading the readmes, I see references to the winusb.sys driver. Is it a requirement to have this driver installed in my computer? Or, am I missing some other basic stuff? Here is the code I tried:
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
Dim brick As New NxtBrick(NxtCommLinkType.USB, 0) ==> does not work
'Dim brick As New NxtBrick(NxtCommLinkType.Bluetooth, "COM11") ==> works fine
' Create a motor.
Dim motor As New NxtMotor()
' Attach it to port A of the NXT brick.
brick.MotorA = motor
' Run it at 75% power, for a 360 degree run.
motor.Run(75, 360)
End Sub
Thanks a lot!
I started working with the MindSqualls API this week in the hope to make progress in my project to control stepper motors using the NxtBrick. Right now, I can connect to the Nxt brick using Bluetooth (using the MindSqualls API), but not with USB. I want to use USB because the lagging time with BT is way too large. I know my Nxt brick and USB connection in my computer are working correctly, because I can connect via USB using Brickcc. However, no matter what I try, I cannot connect via USB using MindSqualls. I already tested .NET 2.0 and .NET 3.5. I also tried a different computer with the same results: BT works, USB connection no. By reading the readmes, I see references to the winusb.sys driver. Is it a requirement to have this driver installed in my computer? Or, am I missing some other basic stuff? Here is the code I tried:
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
Dim brick As New NxtBrick(NxtCommLinkType.USB, 0) ==> does not work
'Dim brick As New NxtBrick(NxtCommLinkType.Bluetooth, "COM11") ==> works fine
' Create a motor.
Dim motor As New NxtMotor()
' Attach it to port A of the NXT brick.
brick.MotorA = motor
' Run it at 75% power, for a 360 degree run.
motor.Run(75, 360)
End Sub
Thanks a lot!
Ahelios- Posts : 5
Join date : 2011-07-27
Re: Using MindSqualls with USB
Can you be more specific when you say that you cannot connect:
The WinUsb.sys driver is part of the Windows system, so you should not have to worry about that as I understand it.
I have one idea about what may be wrong. Can you find the fantomv.inf file on your PC and have a look in it. Notepad can open it. Look for the text:
[WinUsb_Inst_HW_AddReg]
and then for the line of text just below it. It should contain a Guid i.e. something that looks like this:
{761ED34A-CCFA-416b-94BB-33486DB1F5D5}
What does it say?
Leg Godt,
Niels
- What happened?
- What did you expect to happen?
- Did you get an error message, and if so which one?
The WinUsb.sys driver is part of the Windows system, so you should not have to worry about that as I understand it.
I have one idea about what may be wrong. Can you find the fantomv.inf file on your PC and have a look in it. Notepad can open it. Look for the text:
[WinUsb_Inst_HW_AddReg]
and then for the line of text just below it. It should contain a Guid i.e. something that looks like this:
{761ED34A-CCFA-416b-94BB-33486DB1F5D5}
What does it say?
Leg Godt,
Niels
Niels- Posts : 19
Join date : 2011-07-15
Re: Using MindSqualls with USB
Hi,
Thanks for the answer. I mean my app is unable to communicate with the brick using USB. The app has a button that when clicked makes a motor to run for a few seconds. Nothing happens when I click the button. No error messages are shown and the app does not hang. if I use BT as NxtCommLinkType, the motor runs as expected when I click the buttom.
I do not have a fantomv.inf file in my computer. Only fantom.sys and fantom.dll
BTW I am using a Windows XP computer, not Windows 7. It seems that winusb.sys is native to Windows 7 but not to XP. I will try two things now: test the app over USB connection on a Windows 7 computer, and install the winusb driver in the XP machine.
Do you happen to have tested USB connection with XP? If you have winusb installed with XP, do you have the .inf file for winusb.sys?
Thanks again,
Marcelo
Thanks for the answer. I mean my app is unable to communicate with the brick using USB. The app has a button that when clicked makes a motor to run for a few seconds. Nothing happens when I click the button. No error messages are shown and the app does not hang. if I use BT as NxtCommLinkType, the motor runs as expected when I click the buttom.
I do not have a fantomv.inf file in my computer. Only fantom.sys and fantom.dll
BTW I am using a Windows XP computer, not Windows 7. It seems that winusb.sys is native to Windows 7 but not to XP. I will try two things now: test the app over USB connection on a Windows 7 computer, and install the winusb driver in the XP machine.
Do you happen to have tested USB connection with XP? If you have winusb installed with XP, do you have the .inf file for winusb.sys?
Thanks again,
Marcelo
Ahelios- Posts : 5
Join date : 2011-07-27
Re: Using MindSqualls with USB
Hmmm. If WinUsb is not on your machine I would have expected an exception to be thrown.
One more thing you can do is to look in the folder:
C:\Windows\Inf
There ought to be some files there that are named:
oem#.inf
where # is a number. One of them is the one for the NXT but you will have to open all of them at have a look inside to see which. You can recognize it from the header where it says "National Instruments Corporation".
I am using Windows 7 myself and I have not been able to test the USB on another OS.
One more thing you can do is to look in the folder:
C:\Windows\Inf
There ought to be some files there that are named:
oem#.inf
where # is a number. One of them is the one for the NXT but you will have to open all of them at have a look inside to see which. You can recognize it from the header where it says "National Instruments Corporation".
I am using Windows 7 myself and I have not been able to test the USB on another OS.
Niels- Posts : 19
Join date : 2011-07-15
Re: Using MindSqualls with USB
BTW, the inf-file is isntalled when you install the NXT software on the machine.
Niels- Posts : 19
Join date : 2011-07-15
Re: Using MindSqualls with USB
Hi,
I looked up all INF files in my XP computer and there is none by "National Instruments Corporation". But I did find docs about how to install the winusb.sys driver in Windows XP so I will give it a try.
But at any rate, I tried my app in a Windows 7 computer and it worked right away using usb! So I guess I will move my project to Windows 7 if I cannot make the winusb.sys driver work in XP. Thanks for your help with this!
Marcelo
I looked up all INF files in my XP computer and there is none by "National Instruments Corporation". But I did find docs about how to install the winusb.sys driver in Windows XP so I will give it a try.
But at any rate, I tried my app in a Windows 7 computer and it worked right away using usb! So I guess I will move my project to Windows 7 if I cannot make the winusb.sys driver work in XP. Thanks for your help with this!
Marcelo
Ahelios- Posts : 5
Join date : 2011-07-27
Similar topics
» Using I2C sensors with Mindsqualls
» MindSqualls v2.1 released
» MindSqualls v2.2 released
» Welcome to the new MindSqualls forum
» MindSqualls v2.0 released
» MindSqualls v2.1 released
» MindSqualls v2.2 released
» Welcome to the new MindSqualls forum
» MindSqualls v2.0 released
Page 1 of 1
Permissions in this forum:
You cannot reply to topics in this forum
|
|