From owner-freebsd-usb@FreeBSD.ORG Sun Dec 12 23:09:51 2010 Return-Path: Delivered-To: freebsd-usb@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 3FCAF106564A for ; Sun, 12 Dec 2010 23:09:51 +0000 (UTC) (envelope-from r.c.ladan@gmail.com) Received: from mail-ey0-f178.google.com (mail-ey0-f178.google.com [209.85.215.178]) by mx1.freebsd.org (Postfix) with ESMTP id C12978FC0A for ; Sun, 12 Dec 2010 23:09:50 +0000 (UTC) Received: by eyh5 with SMTP id 5so3093685eyh.37 for ; Sun, 12 Dec 2010 15:09:49 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:sender:message-id:date:from :organization:user-agent:mime-version:to:subject:x-enigmail-version :content-type:content-transfer-encoding; bh=mxEjHuRZwQdQ0/iY2fElCGJfGUxVFh3EYD5hgs6w634=; b=boxmyvSYXFKP5mt7jf+1EKBV6zXm6+dVsLm47U6Ef0OH8WUCjnPKXXdFc7SF5y1NFT ZvATovivqiSLjCnEBtCoia4WOuuT8hQImQU9pPcDsn+dW1g5hcbzCa1IdtsCMiTrCopA q98GxZbdmT+ZfJYrgoblXxuBHt0t9oA5qOIsA= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=sender:message-id:date:from:organization:user-agent:mime-version:to :subject:x-enigmail-version:content-type:content-transfer-encoding; b=c6QLMJplo0JU1TV1TG1XZKb5OiHzYEaoa48ixKfGOErewBOhY+WJWiOOXRfIcZ7pni TYKm4lBApht5sMwWdjoTeiy9mycO/PiEY3hCzZBqFMF+IHYF/HZA46dd/7J3IYTCg6rA aGcJVieRBEGSMQz3/QD0v/VMfT2K8bbPaOtMg= Received: by 10.213.9.204 with SMTP id m12mr1799144ebm.68.1292193654284; Sun, 12 Dec 2010 14:40:54 -0800 (PST) Received: from [192.168.1.64] (ip4da3ae31.direct-adsl.nl [77.163.174.49]) by mx.google.com with ESMTPS id q58sm4586544eeh.15.2010.12.12.14.40.53 (version=TLSv1/SSLv3 cipher=RC4-MD5); Sun, 12 Dec 2010 14:40:53 -0800 (PST) Sender: =?UTF-8?Q?Ren=C3=A9_Ladan?= Message-ID: <4D054F76.1080401@freebsd.org> Date: Sun, 12 Dec 2010 23:40:54 +0100 From: Rene Ladan Organization: The FreeBSD Project User-Agent: Mozilla/5.0 (X11; U; FreeBSD amd64; nl-NL; rv:1.9.2.13) Gecko/20101210 Thunderbird/3.1.7 MIME-Version: 1.0 To: freebsd-usb@freebsd.org X-Enigmail-Version: 1.1.2 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Subject: Lego NXT brick communication error with libusb X-BeenThere: freebsd-usb@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: FreeBSD support for USB List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 12 Dec 2010 23:09:51 -0000 Hi, I am writing a port [1] to control the Lego NXT brick with ROS, but when I run a test program it fails (permissions for the USB device are 666). This is on: % uname -a FreeBSD acer 9.0-CURRENT FreeBSD 9.0-CURRENT #5 r216351M: Fri Dec 10 14:13:33 CET 2010 rene@acer:/usr/obj/usr/src/sys/ACER amd64 % rosrun nxt_python color_sensor_test.py Traceback (most recent call last): File "/usr/local/ros/stacks/nxt/nxt_python/sensor_tests/color_sensor_test.py", line 42, in test_sensors(sock.connect()) File "/usr/local/ros/stacks/nxt/nxt_python/src/nxt/usbsock.py", line 44, in connect self.handle.reset() usb.USBError: Unknown error Looking into usbsock.py: self.handle = self.device.open() self.handle.setConfiguration(1) self.handle.claimInterface(0) self.handle.reset() where self.device points to the USB end point for the NXT device (vendor 0x694, product 0x2) However, if I run the same program as root it fails a bit later: # rosrun nxt_python color_sensor_test.py -1 Traceback (most recent call last): File "/usr/local/ros/stacks/nxt/nxt_python/sensor_tests/color_sensor_test.py", line 42, in test_sensors(sock.connect()) File "/usr/local/ros/stacks/nxt/nxt_python/sensor_tests/color_sensor_test.py", line 11, in test_sensors cs = ColorSensor(b, PORT_1) File "/usr/local/ros/stacks/nxt/nxt_python/src/nxt/sensor.py", line 256, in __init__ self.set_light_color(None) File "/usr/local/ros/stacks/nxt/nxt_python/src/nxt/sensor.py", line 278, in set_light_color self.set_input_mode() File "/usr/local/ros/stacks/nxt/nxt_python/src/nxt/sensor.py", line 71, in set_input_mode self.mode) File "/usr/local/ros/stacks/nxt/nxt_python/src/nxt/brick.py", line 22, in poll self.sock.send(str(ogram)) File "/usr/local/ros/stacks/nxt/nxt_python/src/nxt/usbsock.py", line 65, in send self.handle.bulkWrite(self.blk_out.address, data) usb.USBError: Unknown error where self.handle is initialized in the same way as above. It works in Ubuntu 10.10, both native and when running from VirtualBox 4 (which has USB passthrough) under the above FreeBSD. Does anybody have an idea what could be wrong? Thanks, Rene [1] ftp://rene-ladan.nl/pub/freebsd/ros-nxt-0.1.0.tar.bz2 SIZE = 3842 SHA256 = a7a30bc5ef77230d6846577d3a4b1c7262d1c654ed32fcf0d8701c07c0867bea -- http://www.rene-ladan.nl/ GPG fingerprint = ADBC ECCD EB5F A6B4 549F 600D 8C9E 647A E564 2BFC (subkeys.pgp.net)