<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>shapeshifter.se &#187; usb</title>
	<atom:link href="http://www.shapeshifter.se/tag/usb/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.shapeshifter.se</link>
	<description>Mostly miscellaneous technical mumbo-jumbo.</description>
	<lastBuildDate>Mon, 11 Jul 2011 14:19:15 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.8.6</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>DIY: Female-Female USB-adapter</title>
		<link>http://www.shapeshifter.se/2009/07/07/diy-female-female-usb-adapter/</link>
		<comments>http://www.shapeshifter.se/2009/07/07/diy-female-female-usb-adapter/#comments</comments>
		<pubDate>Tue, 07 Jul 2009 15:18:57 +0000</pubDate>
		<dc:creator>fli</dc:creator>
				<category><![CDATA[General]]></category>
		<category><![CDATA[hack]]></category>
		<category><![CDATA[usb]]></category>

		<guid isPermaLink="false">http://www.shapeshifter.se/?p=553</guid>
		<description><![CDATA[Do you have a bunch of useless USB-to-PS/2 keyboard adapters laying around? Two of them make a great female-female USB adapter &#8211; If you need one that is. Here is how I made one.

Carefully crack the case open using a knife. You can be quite rough at the PS/2 end of the casing as this [...]]]></description>
			<content:encoded><![CDATA[<p>Do you have a bunch of useless USB-to-PS/2 keyboard adapters laying around? Two of them make a great female-female USB adapter &#8211; If you need one that is. Here is how I made one.</p>
<p><a href="http://www.shapeshifter.se/wp-content/uploads/2009/06/usb_to_ps2_open.jpg"><img src="http://www.shapeshifter.se/wp-content/uploads/2009/06/usb_to_ps2_open-300x133.jpg" alt="usb_to_ps2_open" title="usb_to_ps2_open" width="300" height="133" class="alignright size-medium wp-image-561" /></a></p>
<p>Carefully crack the case open using a knife. You can be quite rough at the PS/2 end of the casing as this part will be<br />
removed anyway. Don&#8217;t destroy the USB side of the casing as this part will be reused for our adapter casing later on.</p>
<p>Once opened you should basically have a USB-connector connected to a PS/2 connector covered in hot glue/plastic wrapped in a thin-foil like material (for shielding). Remove the wrapping and cut away the PS/2 connector with a knife.</p>
<p>Now, carefully remove the remaining plastic. Don&#8217;t worry about the soldered wires but  make sure that you don&#8217;t damage the pins on the USB connector. You should end up with something like this.</p>
<p><a href="http://www.shapeshifter.se/wp-content/uploads/2009/06/usb_to_ps2_stripped.jpg"><img src="http://www.shapeshifter.se/wp-content/uploads/2009/06/usb_to_ps2_stripped-300x200.jpg" alt="usb_to_ps2_stripped" title="usb_to_ps2_stripped" width="300" height="200" class="aligncenter size-medium wp-image-567" /></a></p>
<p>Do the same with another USB-PS/2 adapter so that you basically end up with two USB connectors.<br />
Bring out your soldering iron and de-solder the remaining wires from the connectors.</p>
<p><a href="http://www.shapeshifter.se/wp-content/uploads/2009/06/usb_to_ps2_two_stripped.jpg"><img src="http://www.shapeshifter.se/wp-content/uploads/2009/06/usb_to_ps2_two_stripped-300x178.jpg" alt="usb_to_ps2_two_stripped" title="usb_to_ps2_two_stripped" width="300" height="178" class="aligncenter size-medium wp-image-570" /></a></p>
<p>Place the connectors back-to-back and turn one of them 180 degrees so that it becomes &#8220;up-side-down&#8221;. If you don&#8217;t do this you&#8217;ll end up connecting the pins in the wrong way.<br />
To make the pins touch each other you&#8217;ll have to bend them roughly 30-45 degrees. Solder the pins together.</p>
<p><a href="http://www.shapeshifter.se/wp-content/uploads/2009/06/usb_to_ps2_soldered.jpg"><img src="http://www.shapeshifter.se/wp-content/uploads/2009/06/usb_to_ps2_soldered-300x170.jpg" alt="usb_to_ps2_soldered" title="usb_to_ps2_soldered" width="300" height="170" class="aligncenter size-medium wp-image-564" /></a></p>
<p>Cut out a piece of wire and solder it to the casing off each connector. You can use the existing solder points used for the shielding/ground or create a new. Some flux will help a lot here.</p>
<p><a href="http://www.shapeshifter.se/wp-content/uploads/2009/06/usb_to_ps2_soldered_gnd_side.jpg"><img src="http://www.shapeshifter.se/wp-content/uploads/2009/06/usb_to_ps2_soldered_gnd_side-300x131.jpg" alt="usb_to_ps2_soldered_gnd_side" title="usb_to_ps2_soldered_gnd_side" width="300" height="131" class="aligncenter size-medium wp-image-565" /></a></p>
<p>That&#8217;s it for the connector. Next up is to creating a new casing using the existing casings. Unfortunately I forgot to take pictures of this process.<br />
Take on pair of the two cases, take one of the two pieces and place the USB-USB adapter inside it . Make a mark on the casing approximately in the middle of where the soldered pins meet.<br />
Cut at this point and do the same for the same half of the other case. Just do a rough cut and file the pieces until the adapter fits. Once the bottom fits, do the same for the top part using the bottom pieces as a template.</p>
<p>Place it in the new casing and pour some hot glue over it to make it steady. Glue the top on and it&#8217;s complete.<br />
<a href="http://www.shapeshifter.se/wp-content/uploads/2009/06/usb_to_usb_half_assembled.jpg"><img src="http://www.shapeshifter.se/wp-content/uploads/2009/06/usb_to_usb_half_assembled-300x200.jpg" alt="usb_to_usb_half_assembled" title="usb_to_usb_half_assembled" width="300" height="200" class="aligncenter size-medium wp-image-572" /></a></p>
<p>USB-USB female adapter in action.<br />
<a href="http://www.shapeshifter.se/wp-content/uploads/2009/06/usb_to_usb_assembled.jpg"><img src="http://www.shapeshifter.se/wp-content/uploads/2009/06/usb_to_usb_assembled-300x225.jpg" alt="usb_to_usb_assembled" title="usb_to_usb_assembled" width="300" height="225" class="aligncenter size-medium wp-image-571" /></a></p>
<p>Will it be as good as a commercial adapter? probably not. Will it effect data transmission? probably (depending on how good the solder joints are). Cheaper than a commercial adapter? yep (assuming you already have the parts needed and don&#8217;t factor in the labor <img src='http://www.shapeshifter.se/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> )</p>
]]></content:encoded>
			<wfw:commentRss>http://www.shapeshifter.se/2009/07/07/diy-female-female-usb-adapter/feed/</wfw:commentRss>
		<slash:comments>6</slash:comments>
		</item>
		<item>
		<title>Mode switching of Option HSDPA cards</title>
		<link>http://www.shapeshifter.se/2008/04/16/mode-switching-of-option-hsdpa-cards/</link>
		<comments>http://www.shapeshifter.se/2008/04/16/mode-switching-of-option-hsdpa-cards/#comments</comments>
		<pubDate>Wed, 16 Apr 2008 19:45:50 +0000</pubDate>
		<dc:creator>fli</dc:creator>
				<category><![CDATA[General]]></category>
		<category><![CDATA[FreeBSD]]></category>
		<category><![CDATA[option]]></category>
		<category><![CDATA[scsi]]></category>
		<category><![CDATA[usb]]></category>

		<guid isPermaLink="false">http://www.shapeshifter.se/?p=44</guid>
		<description><![CDATA[The newer WWAN (HSDPA/UMTS/3G/whatever) USB devices from Option does not come bundled with CD that carries the drivers, instead they are accessible from a mass storage device, this is marketed as by Option as &#8220;ZeroCD&#8221;.  This also means that the device needs to be &#8220;switched&#8221; from the storage device to the modem/network interface before [...]]]></description>
			<content:encoded><![CDATA[<p>The newer WWAN (HSDPA/UMTS/3G/whatever) USB devices from Option does not come bundled with CD that carries the drivers, instead they are accessible from a mass storage device, this is marketed as by Option as &#8220;ZeroCD&#8221;.  This also means that the device needs to be &#8220;switched&#8221; from the storage device to the modem/network interface before it&#8217;s usable.<span id="more-44"></span></p>
<p>There is a utility called <a href="http://www.draisberghof.de/usb_modeswitch/">usb_modeswitch</a> based around libusb that allows one to switch both Option devices as well as Huwei devices.  Unfortunately  Option devices require a write to a bulk endpoint to a device that already is attached to a driver (umass), this is not possible with libusb in FreeBSD (it only allows such things on ugen devices).  It&#8217;s possible to work around this by unloading umass, attaching the device, and then do the switching.  This is quite annoying, especially if one needs to use any kind of umass devices at the same time.</p>
<p>The magic byte sequence usb_modeswitch is sending to the device is actually a SCSI REZERO (0&#215;01) command (quite suitable for the name ZeroCD <img src='http://www.shapeshifter.se/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> ).  Sending such command is possible with the standard camcontrol utility.</p>
<pre>&gt; camcontrol devlist
&lt;Optiarc DVD RW AD-7173A 1-01&gt;     at scbus3 target 0 lun 0 (cd0,pass0)
&lt;ZCOPTION HSDPA Modem 3.00&gt;        at scbus8 target 0 lun 0 (pass1,cd1)</pre>
<p>The WWAN device is at cd1 (ZCOPTION, ZeroCd Option)</p>
<pre>&gt; camcontrol cmd cd1 -c "01 00 00 00 00 00" -i 1 i1
camcontrol: error sending command</pre>
<p>Even though camcontrol reports an error the device is switched properly.  I don&#8217;t know why it reports an error, but my best guess is that the device &#8220;switches&#8221; instantaneously  and the response gets lost.</p>
<pre>umass0: &lt;Option N.V. Globetrotter HSDPA Modem, class 0/0, rev 1.10/0.00,
addr 2&gt; on uhub0
cd1 at umass-sim0 bus 0 target 0 lun 0
cd1: &lt;ZCOPTION HSDPA Modem 3.00&gt; Removable CD-ROM SCSI-2 device
cd1: 1.000MB/s transfers
cd1: Attempt to query device size failed: NOT READY, Medium not present
umass0: BBB reset failed, STALLED
umass0: BBB bulk-in clear stall failed, STALLED
umass0: BBB bulk-out clear stall failed, STALLED
umass0: at uhub0 port 1 (addr 2) disconnected
(cd1:umass-sim0:0:0:0): lost device
(cd1:umass-sim0:0:0:0): removing device entry
umass0: detached
ugen0: &lt;Option N.V. Globetrotter HSDPA Modem, class 255/255, rev 1.10/0.00,
addr 2&gt; on uhub0</pre>
<h3>Glue for devd</h3>
<p>To get automatic switching, put the following in a file called option.conf and place it in /etc/devd/ (create the directory if it doesn&#8217;t exists). Replace product with the correct value for your device, usbdevs -v should report it.</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">attach <span style="color: #000000;">100</span> <span style="color: #7a0874; font-weight: bold;">&#123;</span>
    match <span style="color: #ff0000;">&quot;device-name&quot;</span> <span style="color: #ff0000;">&quot;umass[0-9]+&quot;</span>;
    match <span style="color: #ff0000;">&quot;vendor&quot;</span>  <span style="color: #ff0000;">&quot;0x0af0&quot;</span>;
    match <span style="color: #ff0000;">&quot;product&quot;</span> <span style="color: #ff0000;">&quot;0x6911&quot;</span>;
    match <span style="color: #ff0000;">&quot;devclass&quot;</span> <span style="color: #ff0000;">&quot;0x00&quot;</span>;
    action <span style="color: #ff0000;">&quot;sleep 1; /sbin/camcontrol cmd 
<span style="color: #780078;">`/sbin/camcontrol devlist | /usr/bin/grep ZCOPTION | 
/usr/bin/awk '{match($11, /pass[0-9]+/); print substr($11, RSTART, RLENGTH) }'`</span>
-c '01 00 00 00 00 00' -i 1 i1 &gt; /dev/null&quot;</span>;
<span style="color: #7a0874; font-weight: bold;">&#125;</span>;</pre></div></div>

<p>
Restart devd with /etc/rc.d/devd restart</p>
]]></content:encoded>
			<wfw:commentRss>http://www.shapeshifter.se/2008/04/16/mode-switching-of-option-hsdpa-cards/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

