Print temperature on Images?

Forum for questions and support relating to the 1.24.x releases only.
mrd
Posts: 269
Joined: Wed Apr 26, 2006 12:39 am
Location: Boston USA

Post by mrd »

Here is my perl script that I use to feed room temperature to with a cron job...

Example:
./zm_trigger_sock.pl 4 32F


root@system-z:~/bin/cron_scripts# cat zm_trigger_sock.pl
#!/usr/bin/perl -w

use strict;
use IO::Socket;

our $mid = $ARGV[0]||'1';
our $string = $ARGV[1]||'Test';
our $port = $ARGV[2]||'6802';

my $buffer = $mid . '|show||||' . $string;

my $sock = new IO::Socket::INET (
PeerAddr => 'localhost',
PeerPort => $port,
Proto => 'tcp',
);

die "Could not create socket: $!\n" unless $sock;

print $sock "$buffer";

close($sock);

exit 0;
MRD
User avatar
Normando
Posts: 219
Joined: Sun Aug 17, 2008 5:34 am
Location: Rosario - Argentina

Post by Normando »

mrd wrote:I take it back.. My perl script is working... Not sure why the .php won't work though...
Tips:

1- Enable php errors in php.ini (restart apache)
2- Ensure you have sockets compiled in php
3- Put a few "echo xxx;" between lines
4- Look in /var/log/messages and httpd errors.log
Locked