<div dir="ltr"><div><div><div><div><div><div><div><div><div><div>Ok - thanks for that, makes more sense now.<br><br></div>When I run the C code this happens:<br><br>&quot;./jb_d6t_reader_ic3 0<br>...export file accessed, new pin now accessible<br>
...direction set to output<br>./jb_d6t_reader_ic3: initialized:0<br>Write failed (5)<br>&gt;&gt; Input/output error &lt;&lt;<br>...unexport file accessed, pin now inaccessible&quot;<br><br></div>I&#39;ve done my best to go through the code and make changes where appropriate.<br>
<br></div>Replaced D6T8L with DRT44L2 and changed packet size.<br></div>Altered all references for 2nd sensor to DRT44L2 and also changed i2c-1 to 0 for rev1 board.<br><br></div>Weirdly I can&#39;t access the i2c bus anymore?<br>
cat /dev/i2c*<br>cat: /dev/i2c-0: Input/output error<br>cat: /dev/i2c-1: Input/output error<br><br></div>Tried to follow the code to figure where it&#39;s falling down but I&#39;m not getting it.<br><br></div>Also do I still need 1 or 0 after &#39;./jb_d6t_reader_ic(n)? 1 seems to make it to go into PEC spiral with no readings.<br>
<br>Read failed (5)<br>&gt;&gt; Input/output error &lt;&lt;<br>D6T_checkPEC says 0x8F<br>Read failed (5)<br>&gt;&gt; Input/output error &lt;&lt;<br>D6T_checkPEC says 0x8F<br>Read failed (5)<br>&gt;&gt; Input/output error &lt;&lt;<br>
D6T_checkPEC says 0x8F<br>Read failed (5)<br>&gt;&gt; Input/output error &lt;&lt;<br>D6T_checkPEC says 0x8F<br>Read failed (5)<br>&gt;&gt; Input/output error &lt;&lt;<br>D6T_checkPEC says 0x8F<br>Read failed (5)<br>&gt;&gt; Input/output error &lt;&lt;<br>
<br></div>etc etc.<br><br>i2cdetect -y 0 also draws a blank.<br><br></div>Very best wishes,<br><br></div>Julian<br><div><div><div><div><div><div><br><div><div><div><div><div><br><div class="gmail_extra"><br><br><div class="gmail_quote">
On 3 May 2013 16:31, Martin Peach <span dir="ltr">&lt;<a href="mailto:martin.peach@sympatico.ca" target="_blank">martin.peach@sympatico.ca</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
<div class="im">On 2013-05-03 10:26, Julian Brooks wrote:<br>
<blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
Hey Martin / all,<br>
</blockquote></div><div class="im">
..<br>
<blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
This is what we have and aren&#39;t sure if it&#39;s correct<br>
</blockquote>
<br></div>
Yes it&#39;s a bit wrong...<div class="im"><br>
<br>
<blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
16 to 3.3v RPi<br>
14 to SCL (sensor 1)<br>
</blockquote>
<br></div>
Yes, pin 3 is connected through to pin 13 when pin 11 is low, and to pin 14 when 11 is high. So it&#39;s actually sensor 2 on pin 14.<div class="im"><br>
<br>
<blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
13 to SCL (sensor 2)<br>
</blockquote>
<br></div>
Is actually sensor 1<div class="im"><br>
<br>
<blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
[Each SCL has 10k resistor and a feed of 3.3v from RPi]<br>
11 to  P1-11 (GPIO 17) - RPi<br>
</blockquote>
<br></div>
Yes, 11 selects which channel. 9,10, and 11 make up a 3-bit address which selects which of the 8 output channels is connected to the input on pin 3. If you only have 2 sensors the two extra selector pins must be set low.<div class="im">
<br>
<br>
<blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
10 to SDA (sensor 1)<br>
</blockquote>
<br></div>
10 to Ground or another selector pin if you have more than 2 sensors<br>
The sensor data pins are connected directly to the RPi SDA pin, only the SCL line goes through the 4051.<div class="im"><br>
<br>
<blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
9   to SDA (sensor 2)<br>
</blockquote>
<br></div>
9 to Ground or another selector pin<br>
<br>
<blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
7   to Ground<br>
</blockquote>
<br>
Also, 6 (Inhibit) must be low for the chip to function (this permits expanding to more than 8 channels by using more 4051s)<br>
Pin 8 to Ground<div class="im"><br>
<br>
<blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
3   to SDA P1-03 (GPIO 0) - RPi<br>
</blockquote>
<br></div>
3 to SCL RPi, you&#39;re switching the clock line, not the data<div class=""><div class="h5"><br>
<br>
<blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
<br>
The power for the sensors is wired directly into 5v from the RPi.<br>
The ground for the sensors is wired directly into the RPi.<br>
<br>
</blockquote>
<br></div></div><span class=""><font color="#888888">
Martin<br>
<br>
</font></span></blockquote></div><br></div></div></div></div></div></div></div></div></div></div></div></div></div>