Ticket #27 (closed development: fixed)

Opened 4 years ago

Last modified 21 months ago

Implement system commands via usb on Windows

Reported by: anonymous Owned by:
Priority: low Milestone:
Component: Toolbox Function Keywords:
Cc:

Description

I'm trying to retreive the actual speed using the function MAP_GetOutputModule or NXT_ReadIOMap and it gives me a warning that it's not yet implemented for usb connections. It would be very helpful if this was fixed.

Attachments

Change History

Changed 4 years ago by anonymous

  • component changed from Demos / Applications to Toolbox Function

Changed 4 years ago by atorf

  • owner set to atorf
  • status changed from new to accepted

Please note that this is only not implemented for USB connections on WINDOWS systems, it is supported for both USB and BT on Linux, as well as for BT on Windows.

So, if you cannot switch to Linux, and Bluetooth on Windows is not an option for you, it looks bad. We currently have no schedule on implementing this missing feature for USB/Windows.

If you are however interested in resolving this issue (i.e. adding this functionality to the toolbox), please do not hesistate to ask further questions. I could explain the problem and walk you through steps necessary to get the functionality you want (it has to do with the LEGO MINDSTORMS Fantom driver and its API, or the way systam calls / access to IO modules are handled).

Unfortunately, there is no other workaround (than to use Bluetooth or to switch to Linux) at the moment or the near future…

Changed 4 years ago by atorf

  • priority changed from high to low
  • type changed from development to feature request

Changed 4 years ago by anonymous

  • owner atorf deleted
  • priority changed from low to none
  • type changed from feature request to development
  • status changed from accepted to assigned
  • summary changed from System commands via usb to Implement system commands via usb on Windows

Changed 4 years ago by atorf

It seems the Fantom driver provides a method after all to send raw data. Maybe this could be used to fix everything. Would be straight forward and great :-).

I found this in iNXT.h of the Fantom DDK:

         virtual ViUInt32 write( const ViByte bufferPtr[], ViUInt32 numberOfBytes,
               tStatus& status ) = 0;

         //! Writes, in a generic fashion, to this NXT.
         /*!
            Writes a command directly to this NXT.  In general, this method isn't used and,
               instead, the sendDirectCommand and other more specific methods are invoked when
               communication to the NXT.
            The write doesn not occur if the specified status is fatal.

            \param bufferPtr A pointer to the buffer that contains the command that will be
               written.
            \param numberOfBytes Size of the buffer.
            \param status Status chaining object.
            \return The number of bytes actually written to the NXT.
         */

         
         virtual ViUInt32 read ( ViPBuf bufferPtr, ViUInt32 numberOfBytes, tStatus& status ) = 0;

         //! Reads, in a generic fashion, from this NXT.
         /*!
            Reads a response directly from this NXT.  In general, this method isn't used and,
               instead, the sendDirectCommand and other more specific methods are invoked when
               communication to the NXT.
            The command is not sent if the specified status is fatal.

            \param bufferPtr A pointer to the buffer that will be populated with the response.
            \param numberOfBytes Number of bytes expected to be read from this NXT.
            \param status Status chaining object.
            \return The number of bytes actually read from this NXT.
         */

The according functions in fantom_proto.m would be (actually the commented C-form):

% ViUInt32 nFANTOM100_iNXT_write ( nFANTOM100_iNXT nxtPtr , const ViByte bufferPtr [], ViUInt32 numberOfBytes , ViStatus * status ); 
...
% ViUInt32 nFANTOM100_iNXT_read ( nFANTOM100_iNXT nxtPtr , ViPBuf bufferPtr , ViUInt32 numberOfBytes , ViStatus * status ); 

Changed 4 years ago by atorf

And indeed, it does work like this. A working example can be found here:  http://bricxcc.svn.sourceforge.net/viewvc/bricxcc/bricktools/FantomSpirit.pas?view=markup

Look for "iNXT_sendSystemCommand"…

Changed 4 years ago by atorf

  • priority changed from none to low

Changed 3 years ago by atorf

  • milestone set to vNext

Changed 2 years ago by atorf

  • milestone vNext deleted

Changed 21 months ago by staas

  • status changed from assigned to closed
  • resolution set to fixed

With the newest code you can use "libusb" for Windows USB connection wich allows you to use the MAP commands.

The newest code can actually be found in my branch: http://www.mindstorms.rwth-aachen.de/trac/browser/branches/staas/64Bit_libusb/mfiles

To make this work with "libusb" you have to install libusb_win32 wich you can get here:  http://www.libusb.org/wiki/libusb-win32

Please notice that you can´t use Fantom and Libusb at the same time! If you want to switch back from "libusb" to "Fantom" try to delete the libusb_win32 entry for you NXT in the "Windows Device Manager"

Due to problems with Fantom on 64 Bit systems we may never implement this feauture for the Fantom Driver.

Please check if this solution works for you!

Add/Change #27 (Implement system commands via usb on Windows)

Author



Change Properties
<Author field>
Action
as closed
The resolution will be deleted. Next status will be 'reopened'
 
Note: See TracTickets for help on using tickets.