Stationskoordinaten: 53°34'17.1"N 9°29'21.8"E, Stade-Ottenbeck
+ + + diff --git a/de.wigbels.ruby/hothotread/archiv/Systemoverview.pdf b/de.wigbels.ruby/hothotread/archiv/Systemoverview.pdf new file mode 100644 index 0000000..69f1229 Binary files /dev/null and b/de.wigbels.ruby/hothotread/archiv/Systemoverview.pdf differ diff --git a/de.wigbels.ruby/hothotread/archiv/daemon_run.rb b/de.wigbels.ruby/hothotread/archiv/daemon_run.rb new file mode 100755 index 0000000..4e2f9f6 --- /dev/null +++ b/de.wigbels.ruby/hothotread/archiv/daemon_run.rb @@ -0,0 +1,7 @@ +#!/usr/bin/env ruby + +require 'rubygems' +require 'daemons' + +mypath = File.expand_path(File.dirname(__FILE__)) +Daemons.run("#{mypath}/hothotpiper.rb") diff --git a/de.wigbels.ruby/hothotread/archiv/deploy b/de.wigbels.ruby/hothotread/archiv/deploy new file mode 100755 index 0000000..ad31fac --- /dev/null +++ b/de.wigbels.ruby/hothotread/archiv/deploy @@ -0,0 +1 @@ +scp -P 2342 hothotread.rb root@192.168.14.7:/root/hothotread/hothotread.rb diff --git a/de.wigbels.ruby/hothotread/archiv/draw_graphs.sh b/de.wigbels.ruby/hothotread/archiv/draw_graphs.sh new file mode 100755 index 0000000..869d75a --- /dev/null +++ b/de.wigbels.ruby/hothotread/archiv/draw_graphs.sh @@ -0,0 +1,57 @@ +#!/bin/bash +#DEF:temps9=../hotcoldrain/weather.rrd:temps9:AVERAGE \ +#LINE1:temps9#4e9a06:"Temperatur aussen\n" \ + +rrdtool graph web/gas_1tag.png \ +-w 800 -h 500 \ +-s 'now - 1 day' -e 'now' \ +--title "Gasverbrauch im Tagesverlauf" \ +--font TITLE:12 --vertical-label="Liter/Stunde" \ +DEF:gas=gas.rrd:gas:AVERAGE \ +CDEF:gash=gas,120,* \ +VDEF:gastotal=gas,TOTAL \ +GPRINT:gastotal:"Total %6.0lf Liter Gas" \ +LINE2:gash#c17d11:"Gasverbrauch" + +rrdtool graph web/gas_1woche.png \ +-w 800 -h 500 \ +-s 'now - 1 week' -e 'now' \ +--title "Gasverbrauch im Wochenverlauf" \ +--font TITLE:12 --vertical-label="Liter/Tag" \ +DEF:gas=gas.rrd:gas:AVERAGE \ +CDEF:gasd=gas,2880,* \ +VDEF:gastotal=gas,TOTAL \ +GPRINT:gastotal:"Total %6.0lf Liter Gas" \ +LINE2:gasd#c17d11:"Gasverbrauch/Tag" + +rrdtool graph web/gas_1monat.png \ +-w 800 -h 500 \ +-s 'now - 1 month' -e 'now' \ +--title "Gasverbrauch im Monatsverlauf" \ +--font TITLE:12 --vertical-label="Liter/Tag" \ +DEF:gas=gas.rrd:gas:AVERAGE \ +CDEF:gasd=gas,2880,* \ +VDEF:gastotal=gas,TOTAL \ +GPRINT:gastotal:"Total %6.0lf Liter Gas" \ +LINE2:gasd#c17d11:"Gasverbrauch/Tag" + +rrdtool graph web/gas_1jahr.png \ +-w 800 -h 500 \ +-s 'now - 1 year' -e 'now' \ +--title "Gasverbrauch im Jahresverlauf" \ +--font TITLE:12 --vertical-label="Liter/Tag" \ +DEF:gas=gas.rrd:gas:AVERAGE \ +CDEF:gasd=gas,2880,* \ +VDEF:gastotal=gas,TOTAL \ +GPRINT:gastotal:"Total %6.0lf Liter Gas" \ +LINE2:gasd#c17d11:"Gasverbrauch/Tag" + + + +rrdtool graph web/consum_1day.png -s 'now -1 day' -e 'now' -Y -A DEF:consum=power.rrd:consum:AVERAGE LINE2:consum#00FF00:"Verbrauch [W]" +rrdtool graph web/consum_1week.png -s 'now -1 week' -e 'now' -Y -A DEF:consum=power.rrd:consum:AVERAGE LINE2:consum#00FF00:"Verbrauch [W]" +rrdtool graph web/consum_1month.png -s 'now -1 month' -e 'now' -Y -A DEF:consum=power.rrd:consum:AVERAGE LINE2:consum#00FF00:"Verbrauch [W]" +rrdtool graph web/consum_1year.png -s 'now -1 year' -e 'now' -Y -A DEF:consum=power.rrd:consum:AVERAGE LINE2:consum#00FF00:"Verbrauch [W]" + +rrdtool graph web/counter_1week.png -s 'now -1 week' -e 'now' -X 0 -Y -A DEF:counter=power.rrd:counter:LAST LINE2:counter#000000:"Zählerstand [kWh]" +rrdtool graph web/counter_1month.png -s 'now -1 month' -e 'now' -X 0 -Y -A DEF:counter=power.rrd:counter:LAST LINE2:counter#000000:"Zählerstand [kWh]" diff --git a/de.wigbels.ruby/hothotread/archiv/gas.rrd b/de.wigbels.ruby/hothotread/archiv/gas.rrd new file mode 100644 index 0000000..d42b3cf Binary files /dev/null and b/de.wigbels.ruby/hothotread/archiv/gas.rrd differ diff --git a/de.wigbels.ruby/hothotread/archiv/hothotpiper.rb b/de.wigbels.ruby/hothotread/archiv/hothotpiper.rb new file mode 100644 index 0000000..f8fe7f4 --- /dev/null +++ b/de.wigbels.ruby/hothotread/archiv/hothotpiper.rb @@ -0,0 +1,56 @@ +#!/usr/bin/env ruby +# +# Author: Norbert Wigbels - foobla.wigbels.de/uber-foobla +# +# HotHotPiper continously reads the status of a +# reed contact attached to the Raspberry Pi GPIO +# +# The reed measures gas usage. +# +# A magig URL is formed and called; the url +# stores the sensor-data to wigbels.net +# +# todo: status-led +# + +#------------------------------------------ +# Tainted mode 0-4 +$SAFE=0 + +#------------------------------------------ +require 'pi_piper' +include PiPiper + +$mypath = File.expand_path(File.dirname(__FILE__)) + + +def last_rrd_count + val = 0.0 + handle = IO.popen("rrdtool lastupdate #{$mypath}/power.rrd") + handle.each_line do |line| + m = line.match("^[0-9]*: ([0-9.]*) [0-9.]*") + if m + val = m[1].to_f + break + end + end + return val +end + + +watch :pin => 4, :trigger => :falling do + puts('added 10 liter of gas to sensor-database') + system("rrdtool update #{$mypath}/gas.rrd N:10") +end + +watch :pin => 11, :trigger => :falling do + puts('updated power consumption') + $counter = $counter + $trigger_step + trigger_update = $trigger_step * 3600000.0 + system("rrdtool update #{$mypath}/power.rrd N:#{$counter}:#{trigger_update}") +end + +$trigger_step = 1.0 / 96 +$counter = last_rrd_count + +PiPiper.wait diff --git a/de.wigbels.ruby/hothotread/archiv/hothotpiper_gas.rb b/de.wigbels.ruby/hothotread/archiv/hothotpiper_gas.rb new file mode 100644 index 0000000..18f6bb8 --- /dev/null +++ b/de.wigbels.ruby/hothotread/archiv/hothotpiper_gas.rb @@ -0,0 +1,42 @@ +#!/usr/bin/env ruby + +require 'pi_piper' +include PiPiper + +mypath = File.expand_path(File.dirname(__FILE__)) +trigger_step = 0.01 +trigger_watch = 0 +counter = 0 +timestamp = Time.now.to_i + +def last_rrd_count(concretepath) + val = 0.0 + handle = IO.popen("rrdtool lastupdate #{concretepath}") + handle.each_line do |line| + m = line.match("^[0-9]*: ([0-9.]*) [0-9.]*") + if m + val = m[1].to_f + break + end + end + return val +end + + +watch :pin => 4, :trigger => :falling do + puts('added 10 liter of gas to sensor-database') + system("rrdtool update #{mypath}/gas.rrd N:10") +end + +rrdpath = mypath + "/gasneu.rrd" +counter = last_rrd_count(rrdpath) +#loop do +# if trigger_watch == 1 then +# puts('trigger 1 detected') +# trigger_watch = 0 +# else +# puts('trigger 0 detected') +# end +# sleep(1) +#end +PiPiper.wait diff --git a/de.wigbels.ruby/hothotread/archiv/hothotread.rb b/de.wigbels.ruby/hothotread/archiv/hothotread.rb new file mode 100644 index 0000000..2cc1be7 --- /dev/null +++ b/de.wigbels.ruby/hothotread/archiv/hothotread.rb @@ -0,0 +1,79 @@ +#!/usr/bin/env ruby +# +# Author: Norbert Wigbels - foobla.wigbels.de/uber-foobla +# +# HotHotRead continously reads the status of a +# reed contact attached to the avr-net-io +# +# The reed measures gas usage. +# +# A magig URL is formed and called; the url +# stores the sensor-data to wigbels.net +# +# todo: status-led +# + +#------------------------------------------ +# Tainted mode 0-4 +$SAFE=0 + + +#------------------------------------------ +require 'logger' +require 'socket' +require 'net/http' + +#------------------------------------------ +class HotHotRead < Logger::Application + attr_accessor :socket, :socketaddr + + def initialize(application_name) + super(application_name) + @socket = Socket.new(Socket::AF_INET, Socket::SOCK_STREAM, 0) + @sockaddr = Socket.sockaddr_in(2701, '192.168.14.42') + end + + def run + begin + @socket.connect(@sockaddr) + high2low = false; + while true do + @socket.print "io get pin 0\r\n" + rawdata = @socket.recvfrom(128) + # data contains "port 0: 0xfe"; extract last part + data = rawdata.to_s.split(" ")[2] + # we are only interested in the changes from high to low of the reed sensor + if (data=="0xff") + high2low = true + else + if (high2low==true) + high2low = false + Net::HTTP.get(URI.parse('http://www.wigbels.net/cgi-bin/hhw.rb?sensorid=1&data=10')) + # fixme: response.body auswerten + # bei fehler, lokales backlog schreibe + log(INFO, 'added 100 liter of gas to sensor-database') + end + end + sleep(0.2) + end + # and terminate the connection when we're done + rescue => msg + log(ERROR, "error: #{msg}") + retry + ensure + @socket.close + end + #puts "Filename: "+__FILE__.to_s + #puts "Linenumber: "+__LINE__.to_s + #log(WARN, 'warning', 'mymethod' ) + #@log.error('my_method2') { 'Error!' } + end +end + + +#------------------------------------------ +status = HotHotRead.new("HotHotRead").start + +#if status != 0 +# puts "Some error occured." +#end diff --git a/de.wigbels.ruby/hothotread/archiv/lastupdate.rb b/de.wigbels.ruby/hothotread/archiv/lastupdate.rb new file mode 100644 index 0000000..92f9e3a --- /dev/null +++ b/de.wigbels.ruby/hothotread/archiv/lastupdate.rb @@ -0,0 +1,14 @@ +def last_rrd_count + val = 0.0 + handle = IO.popen("rrdtool lastupdate power.rrd") + handle.each_line do |line| + m = line.match("^[0-9]*: ([0-9.]*) [0-9.]*") + if m + val = m[1].to_f + break + end + end + return val +end + +puts last_rrd_count diff --git a/de.wigbels.ruby/hothotread/archiv/sockconnect.rb b/de.wigbels.ruby/hothotread/archiv/sockconnect.rb new file mode 100644 index 0000000..4c26bb7 --- /dev/null +++ b/de.wigbels.ruby/hothotread/archiv/sockconnect.rb @@ -0,0 +1,16 @@ +require 'socket' + +s = Socket.new(Socket::AF_INET, Socket::SOCK_STREAM, 0) +sockaddr = Socket.sockaddr_in(2701, '192.168.14.42') +begin +s.connect(sockaddr) +rescue + puts "error: #{$!}" +else + s.print "version\r\n" + data = s.recvfrom(1024) + puts data + # and terminate the connection when we're done + s.close +end + diff --git a/de.wigbels.ruby/hothotread/archiv/test.rb b/de.wigbels.ruby/hothotread/archiv/test.rb new file mode 100644 index 0000000..33ea82f --- /dev/null +++ b/de.wigbels.ruby/hothotread/archiv/test.rb @@ -0,0 +1,19 @@ +require 'pi_piper' +include PiPiper + +trigger_watch = 0 + +watch :pin => 11, :trigger => :falling do + puts('trigger registered') + trigger_watch = 1 +end + +loop do + if trigger_watch == 1 then + puts('trigger 1 detected') + trigger_watch = 0 + else + puts('trigger 0 detected') + end + sleep(5) +end diff --git a/de.wigbels.ruby/hothotread/archiv/todo b/de.wigbels.ruby/hothotread/archiv/todo new file mode 100644 index 0000000..2faa493 --- /dev/null +++ b/de.wigbels.ruby/hothotread/archiv/todo @@ -0,0 +1,4 @@ +http://www.blackberryforums.com/developer-forum/2730-persistant-tcp-connection.html + +nested retry +restart diff --git a/de.wigbels.ruby/hothotread/daemon_run_gas.rb b/de.wigbels.ruby/hothotread/daemon_run_gas.rb new file mode 100755 index 0000000..b403b6c --- /dev/null +++ b/de.wigbels.ruby/hothotread/daemon_run_gas.rb @@ -0,0 +1,7 @@ +#!/usr/bin/env ruby + +require 'rubygems' +require 'daemons' + +mypath = File.expand_path(File.dirname(__FILE__)) +Daemons.run("#{mypath}/hothotpiper_gas.rb") diff --git a/de.wigbels.ruby/hothotread/daemon_run_power.rb b/de.wigbels.ruby/hothotread/daemon_run_power.rb new file mode 100755 index 0000000..d25a563 --- /dev/null +++ b/de.wigbels.ruby/hothotread/daemon_run_power.rb @@ -0,0 +1,7 @@ +#!/usr/bin/env ruby + +require 'rubygems' +require 'daemons' + +mypath = File.expand_path(File.dirname(__FILE__)) +Daemons.run("#{mypath}/hothotpiper_power.rb") diff --git a/de.wigbels.ruby/hothotread/daemon_run_water.rb b/de.wigbels.ruby/hothotread/daemon_run_water.rb new file mode 100755 index 0000000..9c441ca --- /dev/null +++ b/de.wigbels.ruby/hothotread/daemon_run_water.rb @@ -0,0 +1,7 @@ +#!/usr/bin/env ruby + +require 'rubygems' +require 'daemons' + +mypath = File.expand_path(File.dirname(__FILE__)) +Daemons.run("#{mypath}/hothotpiper_water.rb") diff --git a/de.wigbels.ruby/hothotread/draw_graphs.sh b/de.wigbels.ruby/hothotread/draw_graphs.sh new file mode 100755 index 0000000..6d6e8a9 --- /dev/null +++ b/de.wigbels.ruby/hothotread/draw_graphs.sh @@ -0,0 +1,45 @@ +#!/bin/bash + +rrdtool graph web/gas_3hour.png -s 'now - 3 hour' -e 'now' DEF:consum=gasneu.rrd:consum:AVERAGE CDEF:conph=consum,3600,* CDEF:conpd=conph,24,* VDEF:gastotal=conpd,AVERAGE GPRINT:gastotal:"Total %4.2lf m³/d" LINE2:conph#c17d11:m³/h +rrdtool graph web/gas_6hour.png -s 'now - 6 hour' -e 'now' DEF:consum=gasneu.rrd:consum:AVERAGE CDEF:conph=consum,3600,* CDEF:conpd=conph,24,* VDEF:gastotal=conpd,AVERAGE GPRINT:gastotal:"Total %4.2lf m³/d" LINE2:conph#c17d11:m³/h +rrdtool graph web/gas_12hour.png -s 'now - 12 hour' -e 'now' DEF:consum=gasneu.rrd:consum:AVERAGE CDEF:conph=consum,3600,* CDEF:conpd=conph,24,* VDEF:gastotal=conpd,AVERAGE GPRINT:gastotal:"Total %4.2lf m³/d" LINE2:conph#c17d11:m³/h +rrdtool graph web/gas_1tag.png -s 'now - 1 day' -e 'now' DEF:consum=gasneu.rrd:consum:AVERAGE CDEF:conph=consum,3600,* CDEF:conpd=conph,24,* VDEF:gastotal=conpd,AVERAGE GPRINT:gastotal:"Total %4.2lf m³/d" LINE2:conph#c17d11:m³/h +rrdtool graph web/gas_1week.png -s 'now - 1 week' -e 'now' DEF:consum=gasneu.rrd:consum:AVERAGE CDEF:conpd=consum,3600,*,24,* LINE2:conpd#c17d11:m³/h +rrdtool graph web/gas_1month.png -s 'now - 1 month' -e 'now' DEF:consum=gasneu.rrd:consum:AVERAGE CDEF:conpd=consum,3600,*,24,* LINE2:conpd#c17d11:m³/h +rrdtool graph web/gas_1year.png -s 'now - 1 year' -e 'now' DEF:consum=gasneu.rrd:consum:AVERAGE CDEF:conpm=consum,3600,*,24,*,30,* LINE2:conpm#c17d11:m³/h +rrdtool graph web/gas_2year.png -s 'now - 2 year' -e 'now' DEF:consum=gasneu.rrd:consum:AVERAGE CDEF:conpm=consum,3600,*,24,*,30,* LINE2:conpm#c17d11:m³/h + +rrdtool graph web/gascounter_1week.png -s 'now -1 week' -e 'now' -X 0 -Y -A DEF:counter=gasneu.rrd:counter:LAST LINE2:counter#000000:"Zählerstand [m³]" +rrdtool graph web/gascounter_1month.png -s 'now -1 month' -e 'now' -X 0 -Y -A DEF:counter=gasneu.rrd:counter:LAST LINE2:counter#000000:"Zählerstand [m³]" + + +rrdtool graph web/consum_10minutes.png -s 'now -10 minutes' -e 'now' -Y -A DEF:consum=power.rrd:consum:AVERAGE LINE2:consum#00FF00:"Verbrauch [W]" +rrdtool graph web/consum_30minutes.png -s 'now -30 minutes' -e 'now' -Y -A DEF:consum=power.rrd:consum:AVERAGE LINE2:consum#00FF00:"Verbrauch [W]" +rrdtool graph web/consum_1hour.png -s 'now -1 hour' -e 'now' -Y -A DEF:consum=power.rrd:consum:AVERAGE LINE2:consum#00FF00:"Verbrauch[W]" +rrdtool graph web/consum_3hour.png -s 'now -3 hour' -e 'now' -Y -A DEF:consum=power.rrd:consum:AVERAGE LINE2:consum#00FF00:"Verbrauch [W]" +rrdtool graph web/consum_6hour.png -s 'now -6 hour' -e 'now' -Y -A DEF:consum=power.rrd:consum:AVERAGE LINE2:consum#00FF00:"Verbrauch [W]" +rrdtool graph web/consum_12hour.png -s 'now -12 hour' -e 'now' -Y -A DEF:consum=power.rrd:consum:AVERAGE LINE2:consum#00FF00:"Verbrauch [W]" +rrdtool graph web/consum_1day.png -s 'now -1 day' -e 'now' -Y -A DEF:consum=power.rrd:consum:AVERAGE LINE2:consum#00FF00:"Verbrauch [W]" +rrdtool graph web/consum_1week.png -s 'now -1 week' -e 'now' -Y -A DEF:consum=power.rrd:consum:AVERAGE LINE2:consum#00FF00:"Verbrauch [W]" +rrdtool graph web/consum_1month.png -s 'now -1 month' -e 'now' -Y -A DEF:consum=power.rrd:consum:AVERAGE LINE2:consum#00FF00:"Verbrauch [W]" +rrdtool graph web/consum_1year.png -s 'now -1 year' -e 'now' -Y -A DEF:consum=power.rrd:consum:AVERAGE LINE2:consum#00FF00:"Verbrauch [W]" +rrdtool graph web/consum_2year.png -s 'now -2 year' -e 'now' -Y -A DEF:consum=power.rrd:consum:AVERAGE LINE2:consum#00FF00:"Verbrauch [W]" + +rrdtool graph web/counter_1week.png -s 'now -1 week' -e 'now' -X 0 -Y -A DEF:counter=power.rrd:counter:LAST LINE2:counter#000000:"Zählerstand [kWh]" +rrdtool graph web/counter_1month.png -s 'now -1 month' -e 'now' -X 0 -Y -A DEF:counter=power.rrd:counter:LAST LINE2:counter#000000:"Zählerstand [kWh]" + + +rrdtool graph web/wconsum_10minutes.png -s 'now -10 minutes' -e 'now' -Y -A DEF:consum=water.rrd:consum:AVERAGE CDEF:wconsum=consum,3,/ LINE2:wconsum#0066ff:"Verbrauch [L]" +rrdtool graph web/wconsum_30minutes.png -s 'now -30 minutes' -e 'now' -Y -A DEF:consum=water.rrd:consum:AVERAGE CDEF:wconsum=consum,3,/ LINE2:wconsum#0066ff:"Verbrauch [L]" +rrdtool graph web/wconsum_1hour.png -s 'now -1 hour' -e 'now' -Y -A DEF:consum=water.rrd:consum:AVERAGE CDEF:wconsum=consum,3,/ LINE2:wconsum#0066ff:"Verbrauch[L]" +rrdtool graph web/wconsum_3hour.png -s 'now -3 hour' -e 'now' -Y -A DEF:consum=water.rrd:consum:AVERAGE CDEF:wconsum=consum,3,/ LINE2:wconsum#0066ff:"Verbrauch [L]" +rrdtool graph web/wconsum_6hour.png -s 'now -6 hour' -e 'now' -Y -A DEF:consum=water.rrd:consum:AVERAGE CDEF:wconsum=consum,3,/ LINE2:wconsum#0066ff:"Verbrauch [L]" +rrdtool graph web/wconsum_12hour.png -s 'now -12 hour' -e 'now' -Y -A DEF:consum=water.rrd:consum:AVERAGE CDEF:wconsum=consum,3,/ LINE2:wconsum#0066ff:"Verbrauch [L]" +rrdtool graph web/wconsum_1day.png -s 'now -1 day' -e 'now' -Y -A DEF:consum=water.rrd:consum:AVERAGE CDEF:wconsum=consum,3,/ LINE2:wconsum#0066ff:"Verbrauch [L]" +rrdtool graph web/wconsum_1week.png -s 'now -1 week' -e 'now' -Y -A DEF:consum=water.rrd:consum:AVERAGE CDEF:wconsum=consum,3,/ LINE2:wconsum#0066ff:"Verbrauch [L]" +rrdtool graph web/wconsum_1month.png -s 'now -1 month' -e 'now' -Y -A DEF:consum=water.rrd:consum:AVERAGE CDEF:wconsum=consum,3,/ LINE2:wconsum#0066ff:"Verbrauch [L]" +rrdtool graph web/wconsum_1year.png -s 'now -1 year' -e 'now' -Y -A DEF:consum=water.rrd:consum:AVERAGE CDEF:wconsum=consum,3,/ LINE2:wconsum#0066ff:"Verbrauch [L]" +rrdtool graph web/wconsum_2year.png -s 'now -2 year' -e 'now' -Y -A DEF:consum=water.rrd:consum:AVERAGE CDEF:wconsum=consum,3,/ LINE2:wconsum#0066ff:"Verbrauch [L]" + +rrdtool graph web/wcounter_1week.png -s 'now -1 week' -e 'now' -X 0 -Y -A DEF:counter=water.rrd:counter:LAST CDEF:wcounter=counter,3,/ LINE2:wcounter#000000:"Zählerstand [qm2]" +rrdtool graph web/wcounter_1month.png -s 'now -1 month' -e 'now' -X 0 -Y -A DEF:counter=water.rrd:counter:LAST CDEF:wcounter=counter,3,/ LINE2:wcounter#000000:"Zählerstand [qm2]" diff --git a/de.wigbels.ruby/hothotread/fix.xml b/de.wigbels.ruby/hothotread/fix.xml new file mode 100644 index 0000000..baed631 --- /dev/null +++ b/de.wigbels.ruby/hothotread/fix.xml @@ -0,0 +1,9920 @@ + + + +Path: | +m2a.rb + | +
Last Update: | +Tue Aug 23 20:43:38 CEST 2005 | +
+A little script that copies imagefiles from your Sony Ericsson K700i +mobilephone to <destination> +
+ +BD_ADDR | += | +"trebroN" | ++ | +SE K700i organizes the camera pictures in Bilder/camera_semc + + | +
OBEX_DIR1 | += | +"Bilder" | +||
OBEX_DIR2 | += | +"camera_semc" | +
+A little script that copies imagefiles from your Sony Ericsson K700i +mobilephone to <destination> +
+# File m2a.rb, line 10 +def usage + puts "usage: m2a.rb <destination>" + exit(-1) +end+ + \ No newline at end of file diff --git a/de.wigbels.ruby/mob2archiv/doc/files/m2a_rb.src/M000002.html b/de.wigbels.ruby/mob2archiv/doc/files/m2a_rb.src/M000002.html new file mode 100755 index 0000000..c2a18b8 --- /dev/null +++ b/de.wigbels.ruby/mob2archiv/doc/files/m2a_rb.src/M000002.html @@ -0,0 +1,44 @@ + + + + + +
# File m2a.rb, line 24 +def doCrudeObexAppComm + begin + cam = getObexIOObject + cam.puts "ls" + cam.close_write + lines = cam.readlines + cam = getObexIOObject + lines.each do |line| + line =~ /Bild\(\d+\).jpg/ + #black-magic-ruby $& holds the match + if !$&.nil? + cam.puts "get" + cam.puts $& + cam.puts $destination+'/'+$& + puts "copy picture "+$&+" to to "+$destination + #delete picturea after copying? uncomment... + #doesn't work on my phone:( + #cam.puts "delete" + #cam.puts $& + end + end + rescue Exception => ex + puts(ex.to_s) + ensure + # TODO: ensure connection is closed + cam.puts "disconnect" + cam.close + end +end+ + \ No newline at end of file diff --git a/de.wigbels.ruby/mob2archiv/doc/files/m2a_rb.src/M000003.html b/de.wigbels.ruby/mob2archiv/doc/files/m2a_rb.src/M000003.html new file mode 100755 index 0000000..2f0a6e3 --- /dev/null +++ b/de.wigbels.ruby/mob2archiv/doc/files/m2a_rb.src/M000003.html @@ -0,0 +1,21 @@ + + + + + +
# File m2a.rb, line 54 +def getObexIOObject + cam = IO.popen("obexapp -a #{BD_ADDR} -C OPUSH", "w+") + cam.puts "cd #{OBEX_DIR1}" + cam.puts "cd #{OBEX_DIR2}" + return cam +end+ + \ No newline at end of file diff --git a/de.wigbels.ruby/mob2archiv/doc/fr_class_index.html b/de.wigbels.ruby/mob2archiv/doc/fr_class_index.html new file mode 100755 index 0000000..49ce9e2 --- /dev/null +++ b/de.wigbels.ruby/mob2archiv/doc/fr_class_index.html @@ -0,0 +1,26 @@ + + + + + + + +