USBHOST

17 Aug 2012

I am trying to talk to a weather info system which needs to receive some commands to answer. Can anyone help me to convert these two functions for mbed USBHost. At the moment i am fiddling around with the program USBHostShell_HID_talkactive_alpha from Sergio Collado. The system is recognized as class 00 and the VID and PID are returned correctly. The last output is:

Transfer EDaddres:00 Token:2 Len:0 State:5 Data out: ProcessDoneQueue 00 020C0000 Interrupt endpoint 81 00030000

I could initiate a transfer from the system if i could send some commands. But i did not succeed up to now and could need some help. Thanks.

void s_usb_msg( char msg1[1],char msg2[1],char msg3[1],char msg4[1],char msg5[1],char msg6[1],char msg7[1],char msg8[1] ) {
	char tbuf[1000];
	tbuf[0] = msg1[0];
	tbuf[1] = msg2[0];
	tbuf[2] = msg3[0];
	tbuf[3] = msg4[0];
	tbuf[4] = msg5[0];
	tbuf[5] = msg6[0];
	tbuf[6] = msg7[0];
	tbuf[7] = msg8[0];
	ret = usb_control_msg(devh, USB_TYPE_CLASS + USB_RECIP_INTERFACE, 
                                   9, 0x200, 0, tbuf, 8, 1000);
}

void read_usb_msg(char *buffer) {
   char tbuf[1000];
   usb_interrupt_read(devh, 0x81, tbuf, 0x20, 1000);
   memcpy(buffer, tbuf, 0x20);
}
28 Aug 2012

Thanks guys,

forget the problem. I solved it myself. I am now running a Fine Offset Weather Station WS-2080 (alternative type from POLLIN Elektronik) connected to a mbed via usb. The program transfers all used data to my homepage where i show them via Gauges. The same system is now running on a Raspberry Pi and a Caramobal board. At the moment i am convert the prog for a Crossfire board. I will put the mbed system in my notebook as soon the time allows me to do so. Have fun.