USB Host of FEZ Spider as Serial USB

Hi everybody

I am working on a project where I want to conect a Laserrangefinder to my FEZ Spider.
My biggest problem is to get the data to my FEZ spider.

To send the data I need a serial usb interface.
Is it possible to use the USB Host as an usb serial port??

thanks :slight_smile:

On spider (which is EMX base) yes it is possible. GHI Electronics – Where Hardware Meets Software

thank you for the fast answer :slight_smile:
I’m not so good in programming

Do I have to add the NETMF library?
Or any other changes on the board?

Start with the beginners guide book here Support – GHI Electronics

I have written a program to connect the laserrangefinder
and it works it shows if the device is connected or not,
but i get the message[italic] “device not supported” [/italic]
do i have to integrate the driver witch i have also on my computer to use the laserrangefnder?

Then device is not supported :slight_smile:

We support HID devices (joystick, mouse, keyboard) and USB memory drivers and select USB cameras.

So is it possible to use the laserrange finder or isn’t there any solution ??

We offer low level USB calls that you could use but will not be easy if you are no well experienced in USB.

I am curious, can you give us a link to the device you are using?

no I’m not good with USB :frowning:

the device i would like to use is the URG-04LX-UG01

Can I suggest you run the USB discovery helper and find out what your device shows up as?

I run that program but i have connected the Laserrangefinder to my FEz Spider but also with my pc to supply it.

After I run that program the output was:

UsbHost ERROR : USB device not supported.
[Device, Port 0]
Type: Serial_CDC
ProductID: 0
VendorID: 5585
=== Interface ===
Class: Communications/CDC
SubClass: 2
Number: 0
Protocol: 1
Type: 4
– Endpoint –
Attributes: 3
Address: 131
Type: 5
Interval: 16

=== Interface ===
Class: CDC-Data
SubClass: 0
Number: 1
Protocol: 0
Type: 4
– Endpoint –
Attributes: 2
Address: 2
Type: 5
Interval: 0

– Endpoint –
Attributes: 2
Address: 129
Type: 5
Interval: 0

CDC is supported so this should have worked! Did you use any gadgeteer driver? If so, don’t. Start new console application and follow the USB host tutorial.

No i don’t think that i have installed any driver
this is my problem i have the driver for that LRF on my pc
but i don’t know how to install it on my FEZ Spider :slight_smile:

but thank you for the fast answers :smiley:

Plug the USB Host module to the Spider; plug the Spider to the PC; plug the LRF to the USB Host module.

“driver” refers to dragging the “device” onto the Gadgeteer designer, which then inserts code (the actual “driver” code) into your app. You don’t need to install a “driver” like you do on a PC into Fez-land, but you do need code to handle the device (you’re largely going to write this code for your application)

I think you need to start a non-gadgeteer app, start using the EMX template. Then start adding code to connect to the CDC device, and you should be able to talk to the LRF. Good luck !

When you say drag the device on the designer how do you mean to do that ??
Where can I find the device?

The easiest way will be this, start a console application, not gadgeteer application. Then follow this “USB Host” tutorial Support – GHI Electronics

maybe I should say that I have written a C# program on my pc to communicate with the LRF and on my pc its not a problem for me but on the FEZ I need a driver or somthing like a driver to be able to speak with the LRF and here is my problem I noticed that I have to drag the LRF on my Fez designer but I dont now how to do this. In which way do you mean drag ? Where do I see the LRF to drag him?

Here is a picture of my designer

The laser rangefinder won’t show up in the Gadgeteer toolbox because there’s not a Gadgeteer driver for it. Gus is recommending that you start with a regular .NETMF console application and follow the tutorial here: GHI Electronics – Where Hardware Meets Software

Connect your laser rangefinder to the USBHost module, and the USBHost module to a mainboard socket labeled “H”.

Once you have code to talk to the laser rangefinder from a NETMF console app, we can help you bring that back into the Gadgeteer world.

OK I started with the console application and the first two worked i recognized the device is connected or not and the mouse also worked fine :D. Now I’m programming the serial devices and the program is clear to me, but When I writte System.IO.Ports… there is no Ports only System.IO and some other points. I have included the right files i think and systems.ports should normaly work.

Where is my mistake?

This is my newest code
Now I think that I haave a connection but I have to read the data and send data, but its quiet difficult ???