<?xml version="1.0" encoding="utf-8"?>
<feed xml:lang="en" xmlns="http://www.w3.org/2005/Atom"><title>Recent posts to onewire_master not running after restart</title><link href="https://forge.codesys.com/forge/talk/Runtime/thread/43006404c7/" rel="alternate"/><link href="https://forge.codesys.com/forge/talk/Runtime/thread/43006404c7/feed.atom" rel="self"/><id>https://forge.codesys.com/forge/talk/Runtime/thread/43006404c7/</id><updated>2020-02-27T16:09:21.290000Z</updated><subtitle>Recent posts to onewire_master not running after restart</subtitle><entry><title>onewire_master not running after restart</title><link href="https://forge.codesys.com/forge/talk/Runtime/thread/43006404c7/?limit=25#7092" rel="alternate"/><published>2020-02-27T16:09:21.290000Z</published><updated>2020-02-27T16:09:21.290000Z</updated><author><name>Ingo</name><uri>https://forge.codesys.com/u/ingo/</uri></author><id>https://forge.codesys.comaf6da65641e6bf859a48cff0a89873cab77e7d99</id><summary type="html">&lt;div class="markdown_content"&gt;&lt;p&gt;It should, but it's not verified, as I don't have the exact same module here.&lt;/p&gt;
&lt;p&gt;Gesendet von meinem LG-H870 mit Tapatalk&lt;/p&gt;&lt;/div&gt;</summary></entry><entry><title>onewire_master not running after restart</title><link href="https://forge.codesys.com/forge/talk/Runtime/thread/43006404c7/?limit=25#d5a3" rel="alternate"/><published>2020-02-27T16:09:18.966000Z</published><updated>2020-02-27T16:09:18.966000Z</updated><author><name>TorbjornS</name><uri>https://forge.codesys.com/u/torbjorns/</uri></author><id>https://forge.codesys.com32ecd798de81eac5436c7e13df30360c8b66b296</id><summary type="html">&lt;div class="markdown_content"&gt;&lt;blockquote&gt;
&lt;p&gt;&lt;strong&gt;Ingo Hornberger hat geschrieben:&lt;/strong&gt;&lt;br/&gt;
Thanks David for the offer to reproduce it. In fact this is a general problem for many CODESYS drivers. Most of them need to be ready at start up.&lt;br/&gt;
Our current recommendation is to put those modules to /etc/modules or /etc/modules.d/. I expect that this would have solved your problem, too.&lt;br/&gt;
Gesendet von meinem LG-H870 mit Tapatalk&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;Hi Ingo&lt;br/&gt;
Is it possible to put modules in /etc/modules or /etc/modules.d/ and does that solve the problem? Verified?&lt;br/&gt;
I would be grateful for instructions. Witch files do i put there?&lt;/p&gt;&lt;/div&gt;</summary></entry><entry><title>onewire_master not running after restart</title><link href="https://forge.codesys.com/forge/talk/Runtime/thread/43006404c7/?limit=25#bbe3" rel="alternate"/><published>2020-02-27T16:09:18.128000Z</published><updated>2020-02-27T16:09:18.128000Z</updated><author><name>TorbjornS</name><uri>https://forge.codesys.com/u/torbjorns/</uri></author><id>https://forge.codesys.comcd9015879e8807b87a345db6687ffa052a599055</id><summary type="html">&lt;div class="markdown_content"&gt;&lt;p&gt;I have the same problem using the latest version. It here any solution i can apply?&lt;/p&gt;&lt;/div&gt;</summary></entry><entry><title>onewire_master not running after restart</title><link href="https://forge.codesys.com/forge/talk/Runtime/thread/43006404c7/?limit=25#c564" rel="alternate"/><published>2020-02-27T16:09:15.815000Z</published><updated>2020-02-27T16:09:15.815000Z</updated><author><name>Ingo</name><uri>https://forge.codesys.com/u/ingo/</uri></author><id>https://forge.codesys.com660d6869d38e0f68a038097ffbc9196ecf533bcf</id><summary type="html">&lt;div class="markdown_content"&gt;&lt;p&gt;Thanks David for the offer to reproduce it. In fact this is a general problem for many CODESYS drivers. Most of them need to be ready at start up.&lt;/p&gt;
&lt;p&gt;Our current recommendation is to put those modules to /etc/modules or /etc/modules.d/. I expect that this would have solved your problem, too.&lt;/p&gt;
&lt;p&gt;Gesendet von meinem LG-H870 mit Tapatalk&lt;/p&gt;&lt;/div&gt;</summary></entry><entry><title>onewire_master not running after restart</title><link href="https://forge.codesys.com/forge/talk/Runtime/thread/43006404c7/?limit=25#96f4" rel="alternate"/><published>2020-02-27T16:09:15.020000Z</published><updated>2020-02-27T16:09:15.020000Z</updated><author><name>DavidCozens</name><uri>https://forge.codesys.com/u/davidcozens/</uri></author><id>https://forge.codesys.com2d735df6b4641b3bd06a0464ef0540bf74fe597e</id><summary type="html">&lt;div class="markdown_content"&gt;&lt;p&gt;Hi Edwin,&lt;/p&gt;
&lt;p&gt;There is nothing special about the UniPi 1-wire solution as far as CODESYS is concerned. The UniPi 1.1 add-on board uses a ds2482 i2c one wire master device. There is a kernel driver for this that can be used in place of the w1-gpio and creates the /sys/devices/w1_bus_master1 device.&lt;/p&gt;
&lt;p&gt;I believe that the issue is that rc.local is executed after the codesys runtime has started, and so on the current configuration I have w1_bus_master1 does not exist when the codesys runtime starts, then when rc.local is executed the device appears, but the CODESYS Onewire_master refuses to recognise it and stays in an error state (despite the individual devices functioning).&lt;/p&gt;
&lt;p&gt;I have done some experiments with an overlay as a different way of enabling the kernel driver for the ds2482, and I seem to be able to enable the kernel driver earlier, then CODESYS doesn't show a problem.&lt;/p&gt;
&lt;p&gt;I guess as a general issue this should be ignored. If you want to make the CODESYS driver robust to late starting of the kernel driver please email me and I will help create a test case for you. But I think I can avoid the problem.&lt;/p&gt;
&lt;p&gt;regards David&lt;/p&gt;&lt;/div&gt;</summary></entry><entry><title>onewire_master not running after restart</title><link href="https://forge.codesys.com/forge/talk/Runtime/thread/43006404c7/?limit=25#2b1e" rel="alternate"/><published>2020-02-27T16:09:14.208000Z</published><updated>2020-02-27T16:09:14.208000Z</updated><author><name>eschwellinger</name><uri>https://forge.codesys.com/u/eschwellinger/</uri></author><id>https://forge.codesys.com4e84f9186fed8af9d1f13f58fcf03b186a8e3168</id><summary type="html">&lt;div class="markdown_content"&gt;&lt;p&gt;Hello,&lt;br/&gt;
i have reproduced it, for my 2 connected onewire temp devices this works.&lt;/p&gt;
&lt;p&gt;What is the difference between the onwire for UniPi&lt;br/&gt;
and the Standard CODESYS onewire solution?&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;&lt;strong&gt;Zitat:&lt;/strong&gt;&lt;br/&gt;
The driver has been added to raspbian (2017-11-29-raspbian-stretch-lite.img) and the device is enabled by adding this at the end of /etc/rc.local&lt;br/&gt;
echo ds2482 0x18 &amp;gt; /sys/bus/i2c/devices/i2c-1/new_device&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;Why you need this?&lt;br/&gt;
guess the runtime is allreaedy started way before rc.local is called... with this.&lt;/p&gt;
&lt;p&gt;Even after reboot it works with my two onewire readings.&lt;/p&gt;
&lt;p&gt;BR&lt;br/&gt;
Edwin&lt;/p&gt;&lt;/div&gt;</summary></entry><entry><title>onewire_master not running after restart</title><link href="https://forge.codesys.com/forge/talk/Runtime/thread/43006404c7/?limit=25#7e20" rel="alternate"/><published>2020-02-27T16:09:11.948000Z</published><updated>2020-02-27T16:09:11.948000Z</updated><author><name>DavidCozens</name><uri>https://forge.codesys.com/u/davidcozens/</uri></author><id>https://forge.codesys.com4655003b2f62b185c42a1fbf3dfd72d695452daa</id><summary type="html">&lt;div class="markdown_content"&gt;&lt;p&gt;Hi Edwin,&lt;/p&gt;
&lt;p&gt;Thank you for the tip - unfortunately it hasn't solved this problem.&lt;/p&gt;
&lt;p&gt;First I ran some experiments:&lt;/p&gt;
&lt;p&gt;I added this program to my application and ran it on the 1-wire task&lt;/p&gt;
&lt;p&gt;Having download it to a Raspberry Pi with two 1-wire devices connected, two devices were detected by the scan as the application started.&lt;br/&gt;
I then connected a third device, set xScanNow to TRUE in the debugger and the additional device was found.&lt;br/&gt;
So calling the scan will find devices that have been added after the raspberry Pi was booted (it doesn't remove devices from the list that I have unplugged - not a real problem).&lt;/p&gt;
&lt;p&gt;I then rebooted the raspberry Pi (Used ssh and typed "sudo reboot"), when I logged in again the Onewire master was showing an error as before, no devices were found. I set xScanNow, it took a couple of seconds to complete, but the result was FALSE and no devices were found. &lt;/p&gt;
&lt;p&gt;I can confirm that the DS18B20 not only shows as green while the master has failed, it is operational, I can see the temperature being measured.&lt;/p&gt;
&lt;p&gt;As before if I issue a reset Warm everything springs into life. &lt;/p&gt;
&lt;p&gt;While in the failed state I looked on the Raspberry pi in /sys/devices/w1_bus_master1 to see if I could identify any faults. The content of the w1_ files is shown below and all looks correct to me&lt;/p&gt;
&lt;p&gt;w1_master_add: write device id xx-xxxxxxxxxxxx to add slave&lt;br/&gt;
w1_master_attempts: 34&lt;br/&gt;
w1_master:_max_slave_count: 64&lt;br/&gt;
w1_master_name: w1_bus_master1&lt;br/&gt;
w1_master_pointer: 0xd9099e08&lt;br/&gt;
w1_master_pullup: 1&lt;br/&gt;
w1_master_remove: write device id xx-xxxxxxxxxxxx to remove slave&lt;br/&gt;
w1_master_search: -1&lt;br/&gt;
w1_master_slave_count: 3&lt;br/&gt;
w1_master_slaves:&lt;br/&gt;
    28-000007648922&lt;br/&gt;
    29-0000001863e6&lt;br/&gt;
    29-0000001ac513&lt;br/&gt;
w1_master_timeout: 10&lt;br/&gt;
w1_master_timeout_us: 0&lt;/p&gt;
&lt;p&gt;From my point of view there are two problems (bugs?), firstly why does the master end up in this state following a reboot? Secondly why can I not recover from the state.&lt;/p&gt;
&lt;p&gt;To look at the first issue, at an educated guess, the problem could be caused by CODESYS starting before the 1-Wire kernal system in raspbian has finished initialising. Is it possible to delay the CODESYS runtime from starting for a few seconds - at least as an experiment?&lt;/p&gt;
&lt;p&gt;As far as the second issue goes. It appears that the kernal driver is working perfectly, so I do not understand why the driver will not recover.&lt;/p&gt;
&lt;p&gt;&lt;img alt="IMG: Screen Shot 2017" rel="nofollow" src="https://forum.codesys.com//download/file.php?id=3237"/&gt;&lt;/p&gt;&lt;/div&gt;</summary></entry><entry><title>onewire_master not running after restart</title><link href="https://forge.codesys.com/forge/talk/Runtime/thread/43006404c7/?limit=25#640e" rel="alternate"/><published>2020-02-27T16:09:11.144000Z</published><updated>2020-02-27T16:09:11.144000Z</updated><author><name>eschwellinger</name><uri>https://forge.codesys.com/u/eschwellinger/</uri></author><id>https://forge.codesys.comf5efd654d4df89dbd525e9bcc48ec9e34b4d7cd3</id><summary type="html">&lt;div class="markdown_content"&gt;&lt;p&gt;Hi,&lt;br/&gt;
please use the improved onewire example here:&lt;br/&gt;
 l &lt;a class="" href="https://forum.codesys.com/viewtopic.php?f=23&amp;amp;t=6247&amp;amp;x=16920&amp;amp;p=16920&amp;amp;lan=en" rel="nofollow"&gt;viewtopic.php?f=23&amp;amp;t=6247&amp;amp;p=16920#p16920&lt;/a&gt; l &lt;/p&gt;
&lt;p&gt;BR&lt;br/&gt;
Edwin&lt;/p&gt;&lt;/div&gt;</summary></entry><entry><title>onewire_master not running after restart</title><link href="https://forge.codesys.com/forge/talk/Runtime/thread/43006404c7/?limit=25#120e" rel="alternate"/><published>2020-02-27T16:09:08.825000Z</published><updated>2020-02-27T16:09:08.825000Z</updated><author><name>DavidCozens</name><uri>https://forge.codesys.com/u/davidcozens/</uri></author><id>https://forge.codesys.comc4af9785e2cec4002001a3518f82e6c7a4f2c16f</id><summary type="html">&lt;div class="markdown_content"&gt;&lt;p&gt;I have a Raspberry Pi with a ds2482 i2c onewire bus master connected. The driver has been added to raspbian (2017-11-29-raspbian-stretch-lite.img) and the device is enabled by adding this at the end of /etc/rc.local&lt;/p&gt;
&lt;p&gt;echo ds2482 0x18 &amp;gt; /sys/bus/i2c/devices/i2c-1/new_device&lt;/p&gt;
&lt;p&gt;If I then create a CODESYS program for the Raspberry Pi and add a DS18B20 device beneath the Onewire master everything appears to work. If I issue a reset of any type from codesys and start the program everything on the 1-wire bus works.&lt;/p&gt;
&lt;p&gt;If I set the project as a bootproject and reboot the raspberry pi then the Onewire_master shows a fault&lt;/p&gt;
&lt;p&gt;As you can see the DS18B20 is functioning, but the Onewire master has a fault that I cannot clear and it has not scanned the bus successfully.&lt;/p&gt;
&lt;p&gt;I am using CODESYS for Raspberry Pi 3.5.11.20.&lt;/p&gt;
&lt;p&gt;The important part of the issue is that I cannot provide a solution where the bus us scanned successfully at power on. I presume that if the bus scanned successfully the driver would show as running.&lt;/p&gt;
&lt;p&gt;&lt;img alt="IMG: onewire_master.png" rel="nofollow" src="https://forum.codesys.com//download/file.php?id=3234"/&gt;&lt;/p&gt;
&lt;p&gt;&lt;img alt="IMG: Screen Shot 2017" rel="nofollow" src="https://forum.codesys.com//download/file.php?id=3235"/&gt;&lt;/p&gt;
&lt;p&gt;&lt;img alt="IMG: Screen Shot 2017" rel="nofollow" src="https://forum.codesys.com//download/file.php?id=3236"/&gt;&lt;/p&gt;&lt;/div&gt;</summary></entry></feed>