Menu

#30 Use DS2482-800 with owpython

v1.0_(example)
open
nobody
1
2016-04-14
2016-04-14
Anonymous
No

Hi,

I have a DS2482-800+ I2C to 8-Channel 1-Wire Breakout Board connect on a Raspberry PI 2 B for read some 1wire device with owpython http://owfs.sourceforge.net/owpython.html

I can read all sensor devices (DS1990a) on the root folder but i want only devices on a specfic bus folder.
How can a i read devices in each bus separately with owpython ?

/01.C52F47180001
/bus.7
/bus.6
/bus.5
/bus.4
/bus.3
/bus.2
/bus.1
/bus.0
/uncached
/settings
/system
/statistics
/structure

Here is a sample code that only reads the root folder :

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
#!/usr/bin/env python2
# -*- coding: utf8 -*-

import ow
import time

try:        
    ow.init('localhost:4304')
except ow.exNoController:
    print "No one-wire controller"
    sys.exit(1)
except ow.exNotInitialized:
    print "One-wire controller not initialized"
    sys.exit(1)

while True:
    time.sleep(0.5)
    mysensors = ow.Sensor("/uncached").sensorList()
    for sensor in mysensors[:]:
        ID = sensor.address[0:12]
        print sensor.type + " -  ID = " + ID

Can you help me ?

Best regards

Gilardh

Discussion

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.