From: Alex R. Mosteo on
Hi people,

I'm studying the options for Ada direct control of a NXT brick from an
external computer using the USB connection (as opposed to flashing a new
firmware, which is the way that GNAT for Mindstorms does). After looking for
what's available out there I've come to the following options:

a) Pure Ada library, would require binding to libusb.
b) Binding to some of the other libraries out there. I couldn't find a C/C++
one that has USB implemented, so next good candidate seems Python or OCaml.
c) Completing the libnxtc (the one in C) with the missing USB bits.

Probably the less work is b) or c), and then bind to it from Ada if wanted.
Anyway, just for the sake of completeness, I'd like to ask the group for any
related experiences or missing bits. More precisely:

p) I'm missing some approach in the above?
q) Are there any Ada bindings to libusb already? Not according to my
googling, and only some early efforts in old threads that didn't get
reported here afterwards.
r) Experiences in binding to Python/OCaml? I guess a C glue layer is the
way?

Kind regards,

Alex.
From: Jeffrey Creem on
Alex R. Mosteo wrote:
> Hi people,
>
> I'm studying the options for Ada direct control of a NXT brick from an
> external computer using the USB connection (as opposed to flashing a new
> firmware, which is the way that GNAT for Mindstorms does). After looking for
> what's available out there I've come to the following options:
>
> a) Pure Ada library, would require binding to libusb.
> b) Binding to some of the other libraries out there. I couldn't find a C/C++
> one that has USB implemented, so next good candidate seems Python or OCaml.
> c) Completing the libnxtc (the one in C) with the missing USB bits.
>
> Probably the less work is b) or c), and then bind to it from Ada if wanted.
> Anyway, just for the sake of completeness, I'd like to ask the group for any
> related experiences or missing bits. More precisely:
>
> p) I'm missing some approach in the above?
> q) Are there any Ada bindings to libusb already? Not according to my
> googling, and only some early efforts in old threads that didn't get
> reported here afterwards.
> r) Experiences in binding to Python/OCaml? I guess a C glue layer is the
> way?
>
> Kind regards,
>
> Alex.

I never finished it but another approach with a start that is present is
at http://nxtada.svn.sourceforge.net/viewvc/nxtada/trunk/

This controlled it from a computer over bluetooth essentially using a
serial API and a bluetooth virtual serial port.

Suggested as another initial source of ideas and approach.
From: Alex R. Mosteo on
Jeffrey Creem wrote:

> Alex R. Mosteo wrote:
>> Hi people,
>>
>> I'm studying the options for Ada direct control of a NXT brick from an
>> external computer using the USB connection (as opposed to flashing a new
>> firmware, which is the way that GNAT for Mindstorms does). After looking
>> for what's available out there I've come to the following options:
>>
>> a) Pure Ada library, would require binding to libusb.
>> b) Binding to some of the other libraries out there. I couldn't find a
>> C/C++ one that has USB implemented, so next good candidate seems Python
>> or OCaml. c) Completing the libnxtc (the one in C) with the missing USB
>> bits.
>>
>> Probably the less work is b) or c), and then bind to it from Ada if
>> wanted. Anyway, just for the sake of completeness, I'd like to ask the
>> group for any related experiences or missing bits. More precisely:
>>
>> p) I'm missing some approach in the above?
>> q) Are there any Ada bindings to libusb already? Not according to my
>> googling, and only some early efforts in old threads that didn't get
>> reported here afterwards.
>> r) Experiences in binding to Python/OCaml? I guess a C glue layer is the
>> way?
>>
>> Kind regards,
>>
>> Alex.
>
> I never finished it but another approach with a start that is present is
> at http://nxtada.svn.sourceforge.net/viewvc/nxtada/trunk/
>
> This controlled it from a computer over bluetooth essentially using a
> serial API and a bluetooth virtual serial port.
>
> Suggested as another initial source of ideas and approach.

Thanks, that's interesting. Actually I explicitly don't want to use
bluetooth, but I've seen devices attached to linux boxes where they appear
as a serial line. I must check if this is the case with the NXT, since this
would make unnecessary (I guess) the use of libusb. In this case I could
jump right into continuing with your code...

From: Alex R. Mosteo on
Alex R. Mosteo wrote:

> Jeffrey Creem wrote:
>
>> Alex R. Mosteo wrote:
>>> Hi people,
>>>
>>> I'm studying the options for Ada direct control of a NXT brick from an
>>> external computer using the USB connection (as opposed to flashing a new
>>> firmware, which is the way that GNAT for Mindstorms does). After looking
>>> for what's available out there I've come to the following options:
>>>
>>> a) Pure Ada library, would require binding to libusb.
>>> b) Binding to some of the other libraries out there. I couldn't find a
>>> C/C++ one that has USB implemented, so next good candidate seems Python
>>> or OCaml. c) Completing the libnxtc (the one in C) with the missing USB
>>> bits.
>>>
>>> Probably the less work is b) or c), and then bind to it from Ada if
>>> wanted. Anyway, just for the sake of completeness, I'd like to ask the
>>> group for any related experiences or missing bits. More precisely:
>>>
>>> p) I'm missing some approach in the above?
>>> q) Are there any Ada bindings to libusb already? Not according to my
>>> googling, and only some early efforts in old threads that didn't get
>>> reported here afterwards.
>>> r) Experiences in binding to Python/OCaml? I guess a C glue layer is the
>>> way?
>>>
>>> Kind regards,
>>>
>>> Alex.
>>
>> I never finished it but another approach with a start that is present is
>> at http://nxtada.svn.sourceforge.net/viewvc/nxtada/trunk/
>>
>> This controlled it from a computer over bluetooth essentially using a
>> serial API and a bluetooth virtual serial port.
>>
>> Suggested as another initial source of ideas and approach.
>
> Thanks, that's interesting. Actually I explicitly don't want to use
> bluetooth, but I've seen devices attached to linux boxes where they appear
> as a serial line. I must check if this is the case with the NXT, since
> this would make unnecessary (I guess) the use of libusb. In this case I
> could jump right into continuing with your code...

I just tried and there are two new devices when I connect the NXT:

/dev/bus/usb/005/003
/dev/char/189:514

I have no idea if I can directly open one of these to start writing commands
to it... don't think so?