Kod: Markera allt
import time
import subprocess
delay=0
fileALL='/mnt/1wire/20.B10310000000/volt.ALL'
temp_string=subprocess.call( ['cat', fileALL])
print(temp_string)
V=[]
for I in ['A', 'B', 'C', 'D']:
with open('/mnt/1wire/20.B10310000000/volt.'+I) as data:
V.append(data.read())
print(V)
with open(fileALL) as data:
time.sleep(delay)
a=data.read()
time.sleep(delay)
print(a)
Kod: Markera allt
pi@mumin1 ~ $ python3 volt.ALL.py
0.0703136, 0.0551571, 0.251566, 4.705460
[' 0.0703136', ' 0.0551571', ' 0.251566', ' 4.70546']
Traceback (most recent call last):
File "volt.ALL.py", line 18, in <module>
a=data.read()
IOError: [Errno 14] Bad address
Filesystement är owfs och ett 1-wire chip DS2450
https://owfs.org/
Kod: Markera allt
pi@mumin1 /mnt/1wire/20.B10310000000 $ ls
8bit PIO.ALL PIO.D alias id pages r_id type volt.B volt2.A volt2.C
CO2 PIO.B address crc8 locator power r_locator volt.A volt.C volt2.ALL volt2.D
PIO.A PIO.C alarm family memory r_address set_alarm volt.ALL volt.D volt2.B
pi@mumin1 /mnt/1wire/20.B10310000000 $