<?xml version="1.0" encoding="UTF-8"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en-gb">
	<link rel="self" type="application/atom+xml" href="https://forums.obdev.at/app.php/feed/topic/6458" />

	<title>Objective Development Forums</title>
	
	<link href="https://forums.obdev.at/index.php" />
	<updated>2012-04-21T20:24:30+02:00</updated>

	<author><name><![CDATA[Objective Development Forums]]></name></author>
	<id>https://forums.obdev.at/app.php/feed/topic/6458</id>

		<entry>
		<author><name><![CDATA[xiangrui]]></name></author>
		<updated>2012-04-21T20:24:30+02:00</updated>

		<published>2012-04-21T20:24:30+02:00</published>
		<id>https://forums.obdev.at/viewtopic.php?t=6458&amp;p=21447#p21447</id>
		<link href="https://forums.obdev.at/viewtopic.php?t=6458&amp;p=21447#p21447"/>
		<title type="html"><![CDATA[Re: Custom HID class device]]></title>

		
		<content type="html" xml:base="https://forums.obdev.at/viewtopic.php?t=6458&amp;p=21447#p21447"><![CDATA[
In the readme file under hid-custom-rq example folder, <br />&quot;Please note that you should install the filter version of libusb-win32 to take full advantage or [of?] this mode. The device driver version only has access to devices which have been registered for it with a *.inf file. The filter version has access to all devices.&quot;<br /><br />But from libusb website, the filter version seems to be recommended only to developers. This means, for a custom USB device to work under Windows, one has to include a INF file for driver installation.<br /><br />Here is an update about my progress. Since I need to send/receive only couple of bytes, my current solution is to simply use HID class.<p>Statistics: Posted by <a href="https://forums.obdev.at/memberlist.php?mode=viewprofile&amp;u=6201">xiangrui</a> — Sat Apr 21, 2012 8:24 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[xiangrui]]></name></author>
		<updated>2012-03-19T23:55:02+02:00</updated>

		<published>2012-03-19T23:55:02+02:00</published>
		<id>https://forums.obdev.at/viewtopic.php?t=6458&amp;p=21185#p21185</id>
		<link href="https://forums.obdev.at/viewtopic.php?t=6458&amp;p=21185#p21185"/>
		<title type="html"><![CDATA[Re: Custom HID class device]]></title>

		
		<content type="html" xml:base="https://forums.obdev.at/viewtopic.php?t=6458&amp;p=21185#p21185"><![CDATA[
The CRC error is due to the data size is wrong. With correct data size, the HID feature Get/Set works fine, although the HIDAPI testgui still gives continuous &quot;hid_read() returned error&quot; when it connects to the device.<p>Statistics: Posted by <a href="https://forums.obdev.at/memberlist.php?mode=viewprofile&amp;u=6201">xiangrui</a> — Mon Mar 19, 2012 11:55 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[xiangrui]]></name></author>
		<updated>2012-03-10T23:01:56+02:00</updated>

		<published>2012-03-10T23:01:56+02:00</published>
		<id>https://forums.obdev.at/viewtopic.php?t=6458&amp;p=21122#p21122</id>
		<link href="https://forums.obdev.at/viewtopic.php?t=6458&amp;p=21122#p21122"/>
		<title type="html"><![CDATA[Re: Custom HID class device]]></title>

		
		<content type="html" xml:base="https://forums.obdev.at/viewtopic.php?t=6458&amp;p=21122#p21122"><![CDATA[
I got help from the Psychtoolbox developer. And I understand I don't have to open the device, but can use HID report to control and query a device. Here is the reply.<br />&quot;PsychHID on both Linux and Windows uses libusb-1.0 for low-level usb control transfers.&quot;  For report related stuff, &quot;it uses HIDAPI which itself uses libusb-1.0 on Linux and direct Windows calls on Windows.&quot; The V-USB &quot;does the same, except that it uses the outdated libusb-0.1 instead of libusb-1.0 on Linux.&quot;<br /><br />I tried the feature report with hid-data example in V-USB. It works under Linux with PsychHID, but with some unspecified error. Under Windows (XP and 7), PsychHID fails to send data to or receive data from the hid-data device, but apparently PsychHID connects to the device. The error message is &quot;Data error (cyclic redundancy check)&quot;. I noted that the V-USB API doesn't check CRC at 12MHz, but I think this is irrelevant to above CRC error since they are at device side and host side respectively.<br /><br />The hidtools.exe from V-USB works fine for both data write and read.<br /><br />According to the suggestion from the Psychtoolbox developer, I downloaded the HIDAPI test tool from <a href="https://github.com/signal11/hidapi" class="postlink">https://github.com/signal11/hidapi</a>, and ran its testgui under Windows. When I connect to hid device from the testgui, it shows it is connected, but gives error message &quot;hid_read() returned error&quot; continuously. If I try to send or get report, it gives me the CRC error message. I also changed the firmware to different examples, including hid-data, bootloaderHID, and mine (descriptor from ARV-Doper), and the error message is the same.<br /><br />I noticed that V-USB recommends libusb or libusb-win32. This is different from what PsychHID uses. But does this make difference? What could be the reason for the CRC error?<br /><br />Thanks.<br />-Xiangrui<br /><br /><blockquote><div><cite>xiangrui wrote:</cite>I am playing with the wonderful V-USB. With an atmega8 and a breadboard, I successfully made HIDkeys, hid-data and AVR-Doper work. What I like to build is a simple USB device which controls 2 or more TTL output. I also have some experience with AVR, so this should be easy. My difficulty is to figure out a way for driver-free device across major computer systems. According to V-USB wiki, it seems that Custom HID class device is what I need. One of examples of the class is the AVR-Doper. With the included usbasp-mega8-12mhz.hex, my device can be recognized as HID device on Windows and Linux machine. But I can't open it within Matlab by PsychHID from Psychtoolbox. This is the same for HIDkeys and hid-data. I understand that HIDkeys is like a keyboard, so it is occupied by the system, but why does it fail to open for hid-data and AVR-Doper? I don't have any HID device to test PsychHID, but it is available to multi-OS, and is used by many users. The source code for PsychHID is at <a href="http://code.google.com/p/psychtoolbox-3/source/browse/trunk/PsychSourceGL/Source/Common/PsychHID/PsychHIDOpenUSBDevice.c" class="postlink">http://code.google.com/p/psychtoolbox-3/source/browse/trunk/PsychSourceGL/Source/Common/PsychHID/PsychHIDOpenUSBDevice.c</a><br /><br />Does anyone have experience with this, or could anyone point me some hint? Thanks.<br /><br />-Xiangrui</div></blockquote><p>Statistics: Posted by <a href="https://forums.obdev.at/memberlist.php?mode=viewprofile&amp;u=6201">xiangrui</a> — Sat Mar 10, 2012 11:01 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[xiangrui]]></name></author>
		<updated>2012-02-21T20:55:05+02:00</updated>

		<published>2012-02-21T20:55:05+02:00</published>
		<id>https://forums.obdev.at/viewtopic.php?t=6458&amp;p=20992#p20992</id>
		<link href="https://forums.obdev.at/viewtopic.php?t=6458&amp;p=20992#p20992"/>
		<title type="html"><![CDATA[Custom HID class device]]></title>

		
		<content type="html" xml:base="https://forums.obdev.at/viewtopic.php?t=6458&amp;p=20992#p20992"><![CDATA[
I am playing with the wonderful V-USB. With an atmega8 and a breadboard, I successfully made HIDkeys, hid-data and AVR-Doper work. What I like to build is a simple USB device which controls 2 or more TTL output. I also have some experience with AVR, so this should be easy. My difficulty is to figure out a way for driver-free device across major computer systems. According to V-USB wiki, it seems that Custom HID class device is what I need. One of examples of the class is the AVR-Doper. With the included usbasp-mega8-12mhz.hex, my device can be recognized as HID device on Windows and Linux machine. But I can't open it within Matlab by PsychHID from Psychtoolbox. This is the same for HIDkeys and hid-data. I understand that HIDkeys is like a keyboard, so it is occupied by the system, but why does it fail to open for hid-data and AVR-Doper? I don't have any HID device to test PsychHID, but it is available to multi-OS, and is used by many users. The source code for PsychHID is at <a href="http://code.google.com/p/psychtoolbox-3/source/browse/trunk/PsychSourceGL/Source/Common/PsychHID/PsychHIDOpenUSBDevice.c" class="postlink">http://code.google.com/p/psychtoolbox-3/source/browse/trunk/PsychSourceGL/Source/Common/PsychHID/PsychHIDOpenUSBDevice.c</a><br /><br />Does anyone have experience with this, or could anyone point me some hint? Thanks.<br /><br />-Xiangrui<p>Statistics: Posted by <a href="https://forums.obdev.at/memberlist.php?mode=viewprofile&amp;u=6201">xiangrui</a> — Tue Feb 21, 2012 8:55 pm</p><hr />
]]></content>
	</entry>
	</feed>
