1Wire parasitic power StartSimultaneousTemperatureRead

Post Reply
toast
Posts: 6
Joined: Wednesday 16 November 2016 13:51
Target OS: Linux
Domoticz version:
Contact:

1Wire parasitic power StartSimultaneousTemperatureRead

Post by toast » Wednesday 16 November 2016 14:26

Hi,
I'm not a coder so I don't think I will be able to make this improvement to the code. But I think that others might benefit if something to solve these issues can be implemented.

1. Part of my network use parasitic power and can therefore not use the Simultaneous read option. Currently I'm doing this change in the code as a work around
hardware/1Wire.cpp

Code: Select all

if (m_sensors.size() > 200) # will not use Simultaneous read unless over 200 devices
Maybe there can be some configuration parameter to enable/disable the Sim.read.?

2. Domoticz is not the only user of my 1wire network. I use a HA7NET and then everything including OWFS is communicating with the OWSERVER process. Maybe it is due to the slow ha7net, network layout or the type of sensors I have, but I have to heavily rely on cached values to get a stable network. With my cache tuning I'm very happy with system stability. I have around 20 devices connected to my HA7NET. When Domoticz refresh all sensors at the same time it puts load on my network and destroys the cache. E.g. if cache expired all 20 devices have to be refreshed and that is a very slow process in parasitic mode. My second modification is therefore to introduce a 3 sec sleep in the loop. By doing that only some of the devices will have to refresh there cached value. And the whole update process goes very smooth and does not interfere with my other scripts.

hardware/1Wire.cpp

Code: Select all

        for (itt=m_sensors.begin(); itt!=m_sensors.end() && !m_stoprequested; ++itt)
        {
        sleep_milliseconds(3000);
I realize that this second change is maybe more specific to my setup, or? One thinking is that maybe the simultaneous variable can be used to decide if there should be a delay or not in reading the devices.

I just wanted to share my experience and if others are in similar position maybe some changes can be done. If not I'm happy to just make my own changes before compiling.
PS. I'm normally not using OWFS. My OWSERVER is not even running in my Domoticz VM. All my other script uses the common ow tools. E.g. owread -s <server> <id> or the ow perl lib. So for future development it would be interesting to not read from /mnt/1wire but instead use the owdir, owread, etc. and just specify the server IP.

Thanks,
Patrik

toast
Posts: 6
Joined: Wednesday 16 November 2016 13:51
Target OS: Linux
Domoticz version:
Contact:

Re: 1Wire parasitic power StartSimultaneousTemperatureRead

Post by toast » Sunday 02 April 2017 22:55

I like the last update to the code that will spread each sensor pull over the Sensor Poll Period. I don't have to add my sleep command any longer :-)
I guess the "Simultaneous" can/should be removed from the code aswell now when there is no burst read of the sensors.

Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest