Ignore:
Timestamp:
Nov 24, 2014, 9:30:20 PM (9 years ago)
Author:
njw <njw@…>
Branches:
master
Children:
5ce93a3
Parents:
af9afaf
Message:

Daemonized monitoring scripts

File:
1 edited

Legend:

Unmodified
Added
Removed
  • de.wigbels.ruby/hotcoldrain/hotcoldrain.rb

    raf9afaf rdaaef3e  
    2121#------------------------------------------
    2222class HotColdRain < Logger::Application
    23   attr_accessor :temp1, :humidity1, :serialport
     23  attr_accessor :temp1, :humidity1, :serialport, :mypath
    2424
    2525  def initialize(application_name)
    2626    super(application_name)
    2727    @serialport = SerialPort.new("/dev/ttyUSB0", 9600, 8, 1, SerialPort::NONE)
     28    @mypath = File.expand_path(File.dirname(__FILE__))
    2829  end
    2930
     
    6263        rrddata = 'N:'+datagrams.join(':')
    6364
    64         system("rrdtool update weather.rrd #{rrddata}")
     65        system("rrdtool update #{mypath}/weather.rrd #{rrddata}")
    6566
    6667        MQTT::Client.connect('mqtt://notwist:pixies@wigbels.net') do |c|
Note: See TracChangeset for help on using the changeset viewer.