<?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>tail -f ZS64.log &#187; usb</title>
	<atom:link href="http://blog.zs64.net/tag/usb/feed/" rel="self" type="application/rss+xml" />
	<link>http://blog.zs64.net</link>
	<description>Random Ramblings</description>
	<lastBuildDate>Mon, 23 Aug 2010 18:08:06 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0.1</generator>
		<item>
		<title>TEMPer USB Thermometer</title>
		<link>http://blog.zs64.net/2010/01/temper-usb-thermometer/</link>
		<comments>http://blog.zs64.net/2010/01/temper-usb-thermometer/#comments</comments>
		<pubDate>Fri, 01 Jan 2010 20:45:35 +0000</pubDate>
		<dc:creator>stb</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[freebsd]]></category>
		<category><![CDATA[hardware]]></category>
		<category><![CDATA[iic]]></category>
		<category><![CDATA[lm75]]></category>
		<category><![CDATA[source code]]></category>
		<category><![CDATA[usb]]></category>

		<guid isPermaLink="false">http://blog.zs64.net/?p=220</guid>
		<description><![CDATA[Measuring temperature in a PC should be easy: after all, most mainboards have extensive monitoring capabilities for temperature and voltage levels built-in. Unfortunately, very few of these facilities are documented properly, and software support is lacking. Instead of trying to navigate the maze that is lm-sensors (which isn&#8217;t even available for FreeBSD), I decided to [...]]]></description>
			<content:encoded><![CDATA[<p>Measuring temperature in a PC should be easy: after all, most mainboards have extensive monitoring capabilities for temperature and voltage levels built-in. Unfortunately, very few of these facilities are documented properly, and software support is lacking. Instead of trying to navigate the maze that is <a href="http://www.lm-sensors.org/">lm-sensors</a> (which isn&#8217;t even available for FreeBSD), I decided to look for some USB-based solution.</p>
<p>There&#8217;s a reasonably cheap chinese USB thermometer called TEMPer. I got mine from Brando for 12 Euros. It&#8217;s a USB-to-serial chip from WinChipHead. It&#8217;s DTR, RTS, and CTS lines are used to connect a <a href="http://www.national.com/ds/LM/LM75.pdf">LM75</a> I²C temperature sensor. To talk to the LM75, you need some <a href="http://en.wikipedia.org/wiki/Bit-banging">bit-banging</a> driver.</p>
<p>I&#8217;ve put together a <a href="http://wiki.zs64.net/TEMPer_USB_Thermometer">command line utility for the TEMPer</a> that can program the built-in thermostat (TEMPer has a LED connected to that output) and print out temperature measurement data. It does it&#8217;s job, and might serve as an example on how to do I²C over a simple interface.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.zs64.net/2010/01/temper-usb-thermometer/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>FreeBSD ppp(8): work around invalid remote address</title>
		<link>http://blog.zs64.net/2009/08/freebsd-ppp8-work-around-invalid-remote-address/</link>
		<comments>http://blog.zs64.net/2009/08/freebsd-ppp8-work-around-invalid-remote-address/#comments</comments>
		<pubDate>Sat, 15 Aug 2009 16:51:56 +0000</pubDate>
		<dc:creator>stb</dc:creator>
				<category><![CDATA[freebsd]]></category>
		<category><![CDATA[ppp]]></category>
		<category><![CDATA[umts]]></category>
		<category><![CDATA[usb]]></category>

		<guid isPermaLink="false">http://blog.zs64.net/?p=159</guid>
		<description><![CDATA[How to fix a ppp problem when trying to establish a connection via a Huawei E169 UMTS USB stick.]]></description>
			<content:encoded><![CDATA[<p>When connecting via a Huawai E169 UTMS USB stick through O2 Germany&#8217;s network, the data stick or the network suggests a PPP IPCP remote address of 0.0.0.0. FreeBSD refuses to ifconfig the tun interface with this endpoint address.</p>
<p>Fortunately, <a href="http://www.FreeBSD.org/cgi/man.cgi?query=ppp&#038;apropos=0&#038;sektion=0&#038;manpath=FreeBSD+8-current&#038;format=html">ppp(8)</a> offers a configuration parameter to influence the IP addresses negotiated with the peer (ifaddr), and suggesting a different address will make the configuration work.</p>
<p>If you get this log output from ppp, you need to configure address selection:</p>
<blockquote>
<pre>IPCP: deflink: RecvConfigAck(4) state = Req-Sent
IPCP:  IPADDR[6] 10.68.235.57
IPCP:  PRIDNS[6] 193.189.244.197
IPCP:  SECDNS[6] 193.189.244.205
IPCP: deflink: State change Req-Sent --&gt; Ack-Rcvd
IPCP: deflink: RecvConfigReq(47) state = Ack-Rcvd
IPCP:   [EMPTY]
IPCP: deflink: SendConfigAck(47) state = Ack-Rcvd
IPCP:   [EMPTY]
IPCP: deflink: State change Ack-Rcvd --&gt; Opened
IPCP: deflink: LayerUp.
IPCP: myaddr 10.68.235.57 hisaddr = 0.0.0.0
Warning: iface add: ioctl(SIOCAIFADDR, 10.68.235.57 -&gt; 0.0.0.0): Destination address required
Error: ipcp_InterfaceUp: unable to set ip address</pre>
</blockquote>
<p>Here&#8217;s my complete ppp.conf, with the ifaddr line included:</p>
<blockquote>
<pre>u3g:
	set device /dev/cuaU0.0
	set speed 115200
	<strong>set ifaddr 10.0.0.1/0 10.0.0.2/0 255.255.255.0</strong>
	set authname internet
	set authkey  internet
	set log local phase ipcp
	set dial "ABORT BUSY TIMEOUT 2 \
		\"\" \
		AT OK-AT-OK \
		AT+CFUN=1 OK-AT-OK \
		AT+CMEE=2 OK-AT-OK \
		AT+CSQ OK \
		AT+CGDCONT=1,\\\"IP\\\",\\\"internet\\\" OK \
		AT+CGACT? OK-AT-OK \
		AT+CGATT? OK \
		AT+CGCLASS? OK \
		AT+COPS? OK \
		ATD*99***1# CONNECT"
	set crtscts on
	nat enable yes
	add default HISADDR
	disable dns</pre>
</blockquote>
<p>This applies to both 7-stable and 8-stable (with both the old and the new USB stacks). I&#8217;ve used <a href="http://www.FreeBSD.org/cgi/man.cgi?query=u3g&#038;apropos=0&#038;sektion=0&#038;manpath=FreeBSD+8-current&#038;format=html">u3g(4)</a> on both occasions. The original ppp.conf for 3G modems is based off <a href="http://people.freebsd.org/~n_hibma/pppconfig.html">this one from Nick Hibma</a>.</p>
<p>This is how it looks like when using ifaddr:</p>
<blockquote>
<pre>IPCP:  PRIDNS[6] 10.11.12.13
IPCP:  SECDNS[6] 10.11.12.14
IPCP:  PRINBNS[6] 10.11.12.13
IPCP: MS NBNS req 130 - NAK??
IPCP:  SECNBNS[6] 10.11.12.14
IPCP: MS NBNS req 132 - NAK??
IPCP: deflink: SendConfigReq(2) state = Req-Sent
IPCP:  IPADDR[6] 10.0.0.1
IPCP:  COMPPROTO[6] 16 VJ slots with slot compression
IPCP: deflink: RecvConfigReq(50) state = Req-Sent
IPCP:   [EMPTY]
IPCP: deflink: SendConfigNak(50) state = Req-Sent
IPCP:  IPADDR[6] 10.0.0.2
IPCP: deflink: RecvConfigRej(2) state = Req-Sent
IPCP:  COMPPROTO[6] 16 VJ slots with slot compression
IPCP: deflink: SendConfigReq(3) state = Req-Sent
IPCP:  IPADDR[6] 10.0.0.1
IPCP: deflink: RecvConfigNak(3) state = Req-Sent
IPCP:  IPADDR[6] 10.42.237.110
IPCP:  IPADDR[6] changing address: 10.0.0.1  --&gt; 10.42.237.110
IPCP: deflink: SendConfigReq(4) state = Req-Sent
IPCP:  IPADDR[6] 10.42.237.110
IPCP: deflink: RecvConfigAck(4) state = Req-Sent
IPCP:  IPADDR[6] 10.42.237.110
IPCP: deflink: State change Req-Sent --&gt; Ack-Rcvd
IPCP: deflink: RecvConfigReq(51) state = Ack-Rcvd
IPCP:   [EMPTY]
IPCP: deflink: SendConfigAck(51) state = Ack-Rcvd
IPCP:   [EMPTY]
IPCP: deflink: State change Ack-Rcvd --&gt; Opened
IPCP: deflink: LayerUp.
IPCP: myaddr 10.42.237.110 hisaddr = 10.0.0.2
PPP ON freebsd-current&gt;</pre>
</blockquote>
]]></content:encoded>
			<wfw:commentRss>http://blog.zs64.net/2009/08/freebsd-ppp8-work-around-invalid-remote-address/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
