<?xml version="1.0" encoding="utf-8"?>
<feed xml:lang="en" xmlns="http://www.w3.org/2005/Atom"><title>Recent posts to Raspberry PI2 and relay board</title><link href="https://forge.codesys.com/forge/talk/Runtime/thread/fa683d0178/" rel="alternate"/><link href="https://forge.codesys.com/forge/talk/Runtime/thread/fa683d0178/feed.atom" rel="self"/><id>https://forge.codesys.com/forge/talk/Runtime/thread/fa683d0178/</id><updated>2020-02-27T16:49:00.077000Z</updated><subtitle>Recent posts to Raspberry PI2 and relay board</subtitle><entry><title>Raspberry PI2 and relay board</title><link href="https://forge.codesys.com/forge/talk/Runtime/thread/fa683d0178/?limit=25#7eb0" rel="alternate"/><published>2020-02-27T16:49:00.077000Z</published><updated>2020-02-27T16:49:00.077000Z</updated><author><name>burger</name><uri>https://forge.codesys.com/u/burger/</uri></author><id>https://forge.codesys.com55730ac77dae062b8dbc211c8ef38b6d4ac7805e</id><summary type="html">&lt;div class="markdown_content"&gt;&lt;p&gt;Hello,&lt;/p&gt;
&lt;p&gt;I have a problme with this. I have configured GPI17 in GPIO18 as digital output. By default the digital output are FALSE. This means that Sainsmart relay will be TRUE or. LED on relay is ON. When I reboot the RPI2 the GPIO will not give 3,3V and GPIO is TRUE. IF I switch GPIO to FALSE and back to TRUE, then I get 3,3V. Whay is this hapening?&lt;/p&gt;
&lt;p&gt;regards&lt;/p&gt;&lt;/div&gt;</summary></entry><entry><title>Raspberry PI2 and relay board</title><link href="https://forge.codesys.com/forge/talk/Runtime/thread/fa683d0178/?limit=25#251e" rel="alternate"/><published>2020-02-27T16:48:59.180000Z</published><updated>2020-02-27T16:48:59.180000Z</updated><author><name>burger</name><uri>https://forge.codesys.com/u/burger/</uri></author><id>https://forge.codesys.com0b7650da9d67c6ea9a529d5712a1f67504c14788</id><summary type="html">&lt;div class="markdown_content"&gt;&lt;p&gt;Hi,&lt;br/&gt;
I have decided to use SainSmart relays. Those have a 5V logic. Will my RPI2 be able to control them with 3,3V logic? On GPIO pin as DO the RPI2 puts 3,3V toGND pin when it is HIGH. Can we control the rlays with GND logic, not 3,3V? Regards.&lt;/p&gt;&lt;/div&gt;</summary></entry><entry><title>Raspberry PI2 and relay board</title><link href="https://forge.codesys.com/forge/talk/Runtime/thread/fa683d0178/?limit=25#ceed" rel="alternate"/><published>2020-02-27T16:48:56.640000Z</published><updated>2020-02-27T16:48:56.640000Z</updated><author><name>burger</name><uri>https://forge.codesys.com/u/burger/</uri></author><id>https://forge.codesys.com704a3b133cd2a215c1269c6d649a14c8d33cdc22</id><summary type="html">&lt;div class="markdown_content"&gt;&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;I have made I2C master in Codesys and created a simple code for testing one relay output.&lt;/p&gt;
&lt;p&gt;This is my code and it is not working. My dip switch for on relay board is in state: all 4 switches are on.&lt;/p&gt;
&lt;p&gt;Can anyone tell what I am doing wrong?&lt;/p&gt;
&lt;p&gt;regards&lt;/p&gt;&lt;/div&gt;</summary></entry><entry><title>Raspberry PI2 and relay board</title><link href="https://forge.codesys.com/forge/talk/Runtime/thread/fa683d0178/?limit=25#cc1b" rel="alternate"/><published>2020-02-27T16:48:55.740000Z</published><updated>2020-02-27T16:48:55.740000Z</updated><author><name>burger</name><uri>https://forge.codesys.com/u/burger/</uri></author><id>https://forge.codesys.com31fa7e0657983abff2496ddf222f84cb115afdfd</id><summary type="html">&lt;div class="markdown_content"&gt;&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;I have no idea how to start end where to start. I will be very grateful if anyone can publish a test sw for this, at lest for one digital output. &lt;/p&gt;
&lt;p&gt;Best regards&lt;/p&gt;&lt;/div&gt;</summary></entry><entry><title>Raspberry PI2 and relay board</title><link href="https://forge.codesys.com/forge/talk/Runtime/thread/fa683d0178/?limit=25#8cc7" rel="alternate"/><published>2020-02-27T16:48:54.825000Z</published><updated>2020-02-27T16:48:54.825000Z</updated><author><name>eschwellinger</name><uri>https://forge.codesys.com/u/eschwellinger/</uri></author><id>https://forge.codesys.comab8fa6986045965380d1458c336d4a5a55fabd3b</id><summary type="html">&lt;div class="markdown_content"&gt;&lt;p&gt;Hi,&lt;br/&gt;
you'll find the samles here: (here are the open libs to check how it works with&lt;br/&gt;
libraries:&lt;br/&gt;
"c:\Users\YourWindowsUserName\CODESYS Control for Raspberry PI\2.2.0.2\Libraries\" &lt;/p&gt;
&lt;p&gt;devices:&lt;br/&gt;
"c:\Users\YourWindowsUserName\CODESYS Control for Raspberry PI\2.2.0.2\Devices\" &lt;/p&gt;
&lt;p&gt;another option is to use&lt;br/&gt;
"c:\Users\YourWindowsUserName\CODESYS Control for Raspberry PI\2.2.0.2\Examples\PiFace_FB.project" &lt;br/&gt;
and realize this with I2C Bus... (without Setup a library and devdec)&lt;/p&gt;
&lt;p&gt;BR&lt;br/&gt;
Edwin&lt;/p&gt;&lt;/div&gt;</summary></entry><entry><title>Raspberry PI2 and relay board</title><link href="https://forge.codesys.com/forge/talk/Runtime/thread/fa683d0178/?limit=25#d4f2" rel="alternate"/><published>2020-02-27T16:48:52.300000Z</published><updated>2020-02-27T16:48:52.300000Z</updated><author><name>burger</name><uri>https://forge.codesys.com/u/burger/</uri></author><id>https://forge.codesys.comf48295c13b43573246416464c451a2daa49f6566</id><summary type="html">&lt;div class="markdown_content"&gt;&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;thank you for your reply. I have tryed but I am not very good at this, so I am asking for a sample.&lt;/p&gt;
&lt;p&gt;Regards&lt;/p&gt;&lt;/div&gt;</summary></entry><entry><title>Raspberry PI2 and relay board</title><link href="https://forge.codesys.com/forge/talk/Runtime/thread/fa683d0178/?limit=25#08a7" rel="alternate"/><published>2020-02-27T16:48:51.356000Z</published><updated>2020-02-27T16:48:51.356000Z</updated><author><name>eschwellinger</name><uri>https://forge.codesys.com/u/eschwellinger/</uri></author><id>https://forge.codesys.com544d049eefa808a3ea0a7ceda08d8521c9df601f</id><summary type="html">&lt;div class="markdown_content"&gt;&lt;p&gt;Hi,&lt;br/&gt;
serveral Options:&lt;br/&gt;
you need to add ad Driver (library and device description) as shown in the pdf&lt;/p&gt;
&lt;p&gt;"c:\Users\&amp;lt;yourwindowsusername&amp;gt;\CODESYS Control for Raspberry PI\2.2.0.2\DataSheet\RaspberryPI_en.pdf" &amp;lt;/yourwindowsusername&amp;gt;&lt;/p&gt;
&lt;p&gt;from your link there is the source code snippet, which shows which addresses are used by the device&lt;/p&gt;
&lt;p&gt;import time&lt;/p&gt;
&lt;div class="codehilite"&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;span class="kn"&gt;import&lt;/span&gt; &lt;span class="nn"&gt;smbus&lt;/span&gt;
&lt;span class="kn"&gt;import&lt;/span&gt; &lt;span class="nn"&gt;signal&lt;/span&gt;
&lt;span class="kn"&gt;import&lt;/span&gt; &lt;span class="nn"&gt;sys&lt;/span&gt;
&lt;span class="n"&gt;bus&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;smbus&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;SMBus&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="err"&gt; &lt;/span&gt; &lt;span class="err"&gt; &lt;/span&gt; &lt;span class="c1"&gt;# 0 = /dev/i2c-0 (port I2C0), 1 = /dev/i2c-1 (port I2C1)&lt;/span&gt;
&lt;span class="k"&gt;class&lt;/span&gt; &lt;span class="nc"&gt;Relay&lt;/span&gt;&lt;span class="p"&gt;():&lt;/span&gt;&lt;span class="err"&gt; &lt;/span&gt; &lt;span class="err"&gt; &lt;/span&gt;
&lt;span class="err"&gt; &lt;/span&gt; &lt;span class="err"&gt; &lt;/span&gt; &lt;span class="k"&gt;global&lt;/span&gt; &lt;span class="n"&gt;bus&lt;/span&gt;
&lt;span class="err"&gt; &lt;/span&gt; &lt;span class="err"&gt; &lt;/span&gt; &lt;span class="k"&gt;def&lt;/span&gt; &lt;span class="fm"&gt;__init__&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="bp"&gt;self&lt;/span&gt;&lt;span class="p"&gt;):&lt;/span&gt;
&lt;span class="err"&gt; &lt;/span&gt; &lt;span class="err"&gt; &lt;/span&gt;&lt;span class="bp"&gt;self&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;DEVICE_ADDRESS&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mh"&gt;0x20&lt;/span&gt;&lt;span class="err"&gt; &lt;/span&gt; &lt;span class="err"&gt; &lt;/span&gt; &lt;span class="err"&gt; &lt;/span&gt; &lt;span class="c1"&gt;#7 bit address (will be left shifted to add the read write bit)&lt;/span&gt;
&lt;span class="err"&gt; &lt;/span&gt; &lt;span class="err"&gt; &lt;/span&gt;&lt;span class="bp"&gt;self&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;DEVICE_REG_MODE1&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mh"&gt;0x06&lt;/span&gt;
&lt;span class="err"&gt; &lt;/span&gt; &lt;span class="err"&gt; &lt;/span&gt;&lt;span class="bp"&gt;self&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;DEVICE_REG_DATA&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mh"&gt;0xff&lt;/span&gt;
&lt;span class="err"&gt; &lt;/span&gt; &lt;span class="err"&gt; &lt;/span&gt;&lt;span class="n"&gt;bus&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;write_byte_data&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="bp"&gt;self&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;DEVICE_ADDRESS&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="bp"&gt;self&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;DEVICE_REG_MODE1&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="bp"&gt;self&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;DEVICE_REG_DATA&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/pre&gt;&lt;/div&gt;


&lt;p&gt;If you have this device working feel free to publish your approach here:&lt;/p&gt;
&lt;p&gt;l &lt;a class="" href="http://forum.codesys.com/viewforum.php?f=23" rel="nofollow"&gt;viewforum.php?f=23&lt;/a&gt; l &lt;/p&gt;
&lt;p&gt;Thank a lot.&lt;br/&gt;
BR&lt;br/&gt;
Edwin&lt;/p&gt;&lt;/div&gt;</summary></entry><entry><title>Raspberry PI2 and relay board</title><link href="https://forge.codesys.com/forge/talk/Runtime/thread/fa683d0178/?limit=25#c857" rel="alternate"/><published>2020-02-27T16:48:48.815000Z</published><updated>2020-02-27T16:48:48.815000Z</updated><author><name>burger</name><uri>https://forge.codesys.com/u/burger/</uri></author><id>https://forge.codesys.comda300c1eccf95ad129ec79eae549e7918456fee2</id><summary type="html">&lt;div class="markdown_content"&gt;&lt;p&gt;Hello everyone,&lt;/p&gt;
&lt;p&gt;I have Raspberry PI 2 and 4 Relay board (&lt;a class="" href="http://www.seeedstudio.com/wiki/Raspberry_Pi_Relay_Board_v1.0" rel="nofollow"&gt;http://www.seeedstudio.com/wiki/Raspber ... Board_v1.0&lt;/a&gt;). I have a lot of expirience with codesys in building automation, but I can not solve this.&lt;br/&gt;
How do I connect RPI2 and this relay board in Codesys?&lt;br/&gt;
Has anyone have a sample program (ON OFF relay) so that I can start from there, please? I can not find any library for this and I2C is something new for me.&lt;/p&gt;
&lt;p&gt;Best regards&lt;/p&gt;&lt;/div&gt;</summary></entry></feed>