I based my code on a mail from Jan 13/3/2020 which said the best way was

$ owwrite /simultaneous/temperature 1
$ sleep 1s
$ owread /uncached/<sensor0id>/latesttemp
$ owread /uncached/<sensor1id>/latesttemp
$ owread /uncached/<sensor2id>/latesttemp

I was thinking that the problem may be with my Python code, but I have just tried it with a bash script and writing to simultaneous/temperature make no difference.  I have tried it reading latesttemp and also temperature.

I am really confused now.

Mick


On 05/08/2020 09:15, Martin Patzak wrote:
... actually I checked my current code and I saw, that I do not read /latesttemp, but read from /uncached/id/temperature so reading from /uncached does not trigger a new conversion. Only when you read a second time without triggering /simultaneous I also saw that I increased the wait after issuing /simulataneous command to 2 seconds, so I must have had issues at the time...


On 05.08.20 09:23, Martin Patzak wrote:
Hi Mick,

by reading the /uncached value, you are causing a new conversion.
Read only /latesttemp and it should work fine.

here is my test program, when I first tested simultaneous and pyownet:

import time
from pyownet import protocol

op = protocol.proxy("razmaban",port=4304)
error = 0
error_old = None


while True:

    op.write('/simultaneous/temperature', '1')

    time.sleep(1)   # give the sensors time to convert their temps

    print '...'

    sensed = op.read('/28.676A20060000/latesttemp')
    print sensed

    sensed = op.read('/28.DD5915020000/latesttemp')
    print sensed


Marty

On 05.08.20 00:39, Mick Sulley wrote:
Running v3.2p3 on Raspberry Pi,  I have set up some DS18B20 sensors on a test system, all of them are powered, but simultaneous does not seem to be working

The code is below, when I run it the first loop takes 16 seconds then it loops at 3 seconds for a while, then a 16 second etc. so it looks like it does slow individual conversions, then uses cached values until they expire, then another slow individual conversion, etc.  Have I got something wrong here?

Thanks

Mick

#!/usr/bin/python3

# sensor_read.py

import pyownet
import time

def main():
    owp = pyownet.protocol.proxy()
    while True:
        start = time.time()
        owp.write('/simultaneous/temperature', b'1')
        time.sleep(1)
        print('start of sensor_read.py')
        sen_lst = ['Solar_Pnl_1A', 'Solar_Pnl_2A','Solar_Pnl_1B', 'Pool_Sol_X', 'Pool_CH_X', 'DHW_Mid_Top', 'DHW_Mid_Btm', 'DHW_Top','Temp5', 'Temp19', 'Temp20','Temp21', 'Temp22', 'Temp23', 'Temp25', 'Temp26', 'Temp27', 'Temp29',  'Temp30']
        prop_lst =  ['/type', '/power', '/latesttemp']
        for p in prop_lst:
            print('%s  ' %p,  end = '')
        print('')
        for sen in sen_lst:
            print('\n%s ' %sen, end = '')
            for prop in prop_lst:
                try:
                    print('%s  ' %(owp.read('/uncached/' + sen + prop).decode()),  end = '')
                except:
                    print('failed! ',    end = '')
        endt = time.time() - start
        print('\nTime = %f' %endt)

if __name__ == "__main__":
    main()



_______________________________________________
Owfs-developers mailing list
Owfs-developers@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/owfs-developers



_______________________________________________
Owfs-developers mailing list
Owfs-developers@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/owfs-developers

_______________________________________________
Owfs-developers mailing list
Owfs-developers@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/owfs-developers

Reply via email to