Hello,

 

just as a feedback from my implementation pains of a python script on a
raspberry pi:

 

i do use a "twin S0 counter module" for water/electricity in a home
automation project:

http://www.eservice-online.de/1-Wire-Bus/Digital-Ein-und-Ausgang-Analog-Eing
ang-Zaehler/1-Wire-Dual-S0-Zaehlermodul.html

 

it's based on a DS2324 counter module with the attributes of interest being
"counters.A", "counters.B" and "counters.ALL".

 

had an extremely hard time reading those values out, in fact was unable to
do it with the default "ow" python module and had to resort to "pyowfs" by
Marcus Priesch. Also spent probably close to 2 days debugging, searching for
alternate paths etc...

 

 

where "s" is the sensor object, all the following attempts failed at
retrieving the values:

 

-          counterA = str(ow.Sensor( "/1D.4DFD0DXXXXXXX/counters.A" ))

-          counterA = str(ow.Sensor( "/1D.4DFD0DXXXXXXX/counters.A/" ))

-          counterA = str(getattr(s,'counters.A'))

-          counterA = str(s.__getattr__(self,'counters.A'))

-          counterA = str(s.__getattr__(s,'counters.A'))

-          counterA = str(s.counters.A)

 

print s.entryList() by the way showed the correct list.

 

it must be notation related to the dot in the attribute name...

maybe a general issue with dots in attributes?

 

in the end i was successful by:

 

        # other python wrapper due to counters.A not being accessible
otherwise

        from pyowfs import Connection

        owroot = Connection ("localhost:4304")

        zs = owroot.find (id=s.id)[0]

 

        for e in zs.iter_entries () :

 

             if e == "counters.A":

                    counterA = long(zs.get(e))

 

only after iterating through the elements was i able to access counters.A

 

 

kind regards,

 

Bernie

 

___________________________________________________________

 

 <mailto:[email protected]> [email protected]

 

 

------------------------------------------------------------------------------
Rapidly troubleshoot problems before they affect your business. Most IT 
organizations don't have a clear picture of how application performance 
affects their revenue. With AppDynamics, you get 100% visibility into your 
Java,.NET, & PHP application. Start your 15-day FREE TRIAL of AppDynamics Pro!
http://pubads.g.doubleclick.net/gampad/clk?id=84349831&iu=/4140/ostg.clktrk
_______________________________________________
Owfs-developers mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/owfs-developers

Reply via email to