This is working to make a text file from owfs but takes a long time to read and convert all the temps. is there a way to skip rom and issue global read and convert ? this is schip i am useing in windows that works awesome. would like it ry to port it to Debian ? Private Sub Get_Temps_All_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Get_Temps_All.Click Dim mkroom As New com.dalsemi.onewire.container.OneWireContainer10(adapter, "5E000800B67BFF10") Dim jocelyn As New com.dalsemi.onewire.container.OneWireContainer10(adapter, "72000800B6E83210") Dim Kitchen As New com.dalsemi.onewire.container.OneWireContainer10(adapter, "48000800B6D5EB10") Dim office As New com.dalsemi.onewire.container.OneWireContainer10(adapter, "7E000800B5E8B010") Dim boiler_in As New com.dalsemi.onewire.container.OneWireContainer10(adapter, "18000800B6D52110") Dim boiler_out As New com.dalsemi.onewire.container.OneWireContainer10(adapter, "B2000800B6C74810") Dim Bathroom As New com.dalsemi.onewire.container.OneWireContainer10(adapter, "9E000800B6FB2510") Dim Town As New com.dalsemi.onewire.container.OneWireContainer10(adapter, "C7000800B6007D10") Dim anthony_bath As New com.dalsemi.onewire.container.OneWireContainer10(adapter, "D1000800B5FC2C10") Dim basement As New com.dalsemi.onewire.container.OneWireContainer10(adapter, "8D000800B6FC6410") Dim boiler_room As New com.dalsemi.onewire.container.OneWireContainer10(adapter, "68000800B6CBD510") Dim Anthony As New com.dalsemi.onewire.container.OneWireContainer10(adapter, "B3000800B6FAFA10") Dim mudroom As New com.dalsemi.onewire.container.OneWireContainer10(adapter, "F7000800B5FF1B10") Dim hotwater As New com.dalsemi.onewire.container.OneWireContainer10(adapter, "C8000800B5DF5D10") Dim outside As New com.dalsemi.onewire.container.OneWireContainer10(adapter, "E6000800B67EDB10") Dim fresh As New com.dalsemi.onewire.container.OneWireContainer10(adapter, "27000800B6C5E510") Dim house_attic As New com.dalsemi.onewire.container.OneWireContainer10(adapter, "08000800B6DE5A10") Dim garage As New com.dalsemi.onewire.container.OneWireContainer10(adapter, "2C000800B6805410")

       Dim Tests As Object
       Dim state As Object
       Dim mkrooms As Object
       Dim jocelyns As Object
       Dim kitchens As Object
       Dim offices As Object
       Dim boiler_ins As Object
       Dim boiler_outs As Object
       Dim Bathrooms As Object
       Dim freshs As Object
       Dim towns As Object
       Dim Anthony_Baths As Object
       Dim boiler_rooms As Object
       Dim basements As Object
       Dim Anthonys As Object
       Dim hotwaters As Object
       Dim outsides As Object
       Dim house_attics As Object
       Dim Garages As Object
       Dim mudrooms As Object

       Try
           adapter.beginExclusive(True)
           adapter.setSpeed(adapter.SPEED_REGULAR)
           adapter.targetFamily(&H10)
           adapter.Reset()
           adapter.setSearchAllDevices()
           adapter.reset()
           adapter.putByte(204)
           adapter.putByte(68)
           System.Threading.Thread.Sleep(1000) ' Sleep 1 second
           adapter.reset()

           Try
               Tests = Test.readDevice
               Test.setTemperatureResolution(9, Tests)
               test_at.text = (Math.Round(Test.getTemperature(Tests), 1))

           Catch ex As Exception
               test_at.text = "??"
           End Try


           Try
               mk_at.ForeColor = System.Drawing.Color.White
               mkrooms = mkroom.readDevice
               mkroom.setTemperatureResolution(9, mkrooms)
               mk_at.Text = (Math.Round(mkroom.getTemperature(mkrooms), 1))
           Catch ex As Exception
               mk_at.ForeColor = System.Drawing.Color.Yellow
               mk_at.Text = "??"
           End Try

           Try
               jk_at.ForeColor = System.Drawing.Color.White
               jocelyns = jocelyn.readDevice
               jocelyn.setTemperatureResolution(9, jocelyns)
jk_at.Text = (Math.Round(jocelyn.getTemperature(jocelyns), 1))
           Catch ex As Exception
               jk_at.ForeColor = System.Drawing.Color.Yellow
               jk_at.Text = "??"
           End Try


           Try
               kl_at.ForeColor = System.Drawing.Color.White
               kitchens = Kitchen.readDevice
               Kitchen.setTemperatureResolution(9, kitchens)
kl_at.Text = (Math.Round(Kitchen.getTemperature(kitchens), 1))
           Catch ex As Exception
               kl_at.ForeColor = System.Drawing.Color.Yellow
               kl_at.Text = "??"
           End Try

           Try
               office_at.ForeColor = System.Drawing.Color.White
               offices = office.readDevice
               office.setTemperatureResolution(9, offices)
office_at.Text = (Math.Round(office.getTemperature(offices), 1))
           Catch ex As Exception
               office_at.ForeColor = System.Drawing.Color.Yellow
               office_at.Text = "??"
           End Try


           Try
               Boiler_In_at.ForeColor = System.Drawing.Color.White
               boiler_ins = boiler_in.readDevice
               boiler_in.setTemperatureResolution(9, boiler_ins)
Boiler_In_at.Text = (Math.Round(boiler_in.getTemperature(boiler_ins), 1) * 1.8 + 32)
           Catch ex As Exception
               Boiler_In_at.ForeColor = System.Drawing.Color.Yellow
               Boiler_In_at.Text = "??"
           End Try

           Try
               Boiler_out_at.ForeColor = System.Drawing.Color.White
               boiler_outs = boiler_out.readDevice
               boiler_out.setTemperatureResolution(9, boiler_outs)
Boiler_out_at.Text = (Math.Round(boiler_out.getTemperature(boiler_outs), 1) * 1.8 + 32)
           Catch ex As Exception
               Boiler_out_at.ForeColor = System.Drawing.Color.Yellow
               Boiler_out_at.Text = "??"
           End Try

           Try
               mkbath_at.ForeColor = System.Drawing.Color.White
               Bathrooms = Bathroom.readDevice
               Bathroom.setTemperatureResolution(9, Bathrooms)
mkbath_at.Text = (Math.Round(Bathroom.getTemperature(Bathrooms), 1))
           Catch ex As Exception
               mkbath_at.ForeColor = System.Drawing.Color.Yellow
               mkbath_at.Text = "??"
           End Try

           Try
               fresh_at.ForeColor = System.Drawing.Color.White
               freshs = fresh.readDevice
               fresh.setTemperatureResolution(9, freshs)
fresh_at.Text = (Math.Round(fresh.getTemperature(freshs), 1))
           Catch ex As Exception
               fresh_at.ForeColor = System.Drawing.Color.Yellow
               fresh_at.Text = "??"
           End Try

           Try
               Town_at.ForeColor = System.Drawing.Color.White
               towns = Town.readDevice
               Town.setTemperatureResolution(9, towns)
               Town_at.Text = (Math.Round(Town.getTemperature(towns), 1))
           Catch ex As Exception
               Town_at.ForeColor = System.Drawing.Color.Yellow
               Town_at.Text = "??"
           End Try

           Try
               ab_at.ForeColor = System.Drawing.Color.White
               Anthony_Baths = anthony_bath.readDevice
               anthony_bath.setTemperatureResolution(9, Anthony_Baths)
ab_at.Text = (Math.Round(anthony_bath.getTemperature(Anthony_Baths), 1))
           Catch ex As Exception
               ab_at.ForeColor = System.Drawing.Color.Yellow
               ab_at.Text = "??"
           End Try

           Try
               br_at.ForeColor = System.Drawing.Color.White
               boiler_rooms = boiler_room.readDevice
               boiler_room.setTemperatureResolution(9, boiler_rooms)
br_at.Text = (Math.Round(boiler_room.getTemperature(boiler_rooms), 1))
           Catch ex As Exception
               br_at.ForeColor = System.Drawing.Color.Yellow
               br_at.Text = "??"
           End Try


           Try
               b_at.ForeColor = System.Drawing.Color.White
               basements = basement.readDevice
               basement.setTemperatureResolution(9, basements)
b_at.Text = (Math.Round(basement.getTemperature(basements), 1))
           Catch ex As Exception
               b_at.ForeColor = System.Drawing.Color.Yellow
               b_at.Text = "??"
           End Try


           Try
               ak_at.ForeColor = System.Drawing.Color.White
               Anthonys = Anthony.readDevice
               Anthony.setTemperatureResolution(9, Anthonys)
ak_at.Text = (Math.Round(Anthony.getTemperature(Anthonys), 1))
           Catch ex As Exception
               ak_at.ForeColor = System.Drawing.Color.Yellow
               ak_at.Text = "??"
           End Try

           Try
               hot_water_at.ForeColor = System.Drawing.Color.White
               hotwaters = hotwater.readDevice
               hotwater.setTemperatureResolution(9, hotwaters)
hot_water_at.Text = (Math.Round(hotwater.getTemperature(hotwaters), 1))
           Catch ex As Exception
               hot_water_at.ForeColor = System.Drawing.Color.Yellow
               hot_water_at.Text = "??"
           End Try

           Try
               outside_at.ForeColor = System.Drawing.Color.White
               outsides = outside.readDevice
               outside.setTemperatureResolution(9, outsides)
outside_at.Text = (Math.Round(outside.getTemperature(outsides), 1))
           Catch ex As Exception
               outside_at.ForeColor = System.Drawing.Color.Yellow
               outside_at.Text = "??"
           End Try

           Try
               house_attic_at.ForeColor = System.Drawing.Color.White
               house_attics = house_attic.readDevice
               house_attic.setTemperatureResolution(9, house_attics)
house_attic_at.Text = (Math.Round(house_attic.getTemperature(house_attics), 1))
           Catch ex As Exception
               house_attic_at.ForeColor = System.Drawing.Color.Yellow
               house_attic_at.Text = "??"
           End Try

           Try
               garage_at.ForeColor = System.Drawing.Color.White
               Garages = garage.readDevice
               garage.setTemperatureResolution(9, Garages)
garage_at.Text = (Math.Round(garage.getTemperature(Garages), 1))
           Catch ex As Exception
               garage_at.ForeColor = System.Drawing.Color.Yellow
               garage_at.Text = "??"
           End Try

           Try
               mr_at.ForeColor = System.Drawing.Color.White
               mudrooms = mudroom.readDevice
               garage.setTemperatureResolution(9, mudrooms)
mr_at.Text = (Math.Round(mudroom.getTemperature(mudrooms), 1))
           Catch ex As Exception
               mr_at.ForeColor = System.Drawing.Color.Yellow
               mr_at.Text = "??"
           End Try


           'status.AppendText(" Done " & CRLF)
           status.AppendText("==" & CRLF)
           ' end exclusive use of 1-Wire net adapter
           adapter.endExclusive()
       Catch ex As Exception
           status.AppendText(CRLF & CRLF & "Error:  " & ex.ToString & CRLF)
       End Try
   End Sub






Debian So far:

#!/bin/bash

chippath="/home/house/public_html/chips";
X=$(ls  $chippath/*/temperature);
for f in $X; do d=$(dirname $f);
echo "$(cat $d/address): $(cat $f)C" >> temp.txt;
done


this makes a text file ( temp.txt)

the with apache and php can generate web page for display of temps on the fly

any suggestions on how to ? speed up owfs ?





-------------------------------------------------------
This SF.Net email is sponsored by xPML, a groundbreaking scripting language
that extends applications into web and mobile media. Attend the live webcast
and join the prime developer group breaking into this new coding territory!
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=110944&bid=241720&dat=121642
_______________________________________________
Owfs-developers mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/owfs-developers

Reply via email to