LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 08-21-2012, 09:32 PM   #1
j666gak
LQ Newbie
 
Registered: Mar 2012
Posts: 2

Rep: Reputation: Disabled
Perl problem


Hello,

I have found a very useful script when I get it working, it was posted a few years ago. It will pull information off my blood testing meter. However when trying to run the script I keep getting the following error, please can somebody help?

Code:
Can't call method "user_msg" on an undefined value at meter.pl line 11.
This is the script
Code:
#!/usr/bin/perl -w

use strict;

use Device::SerialPort qw( :PARAM :STAT 0.07 );

my $PortObj = new Device::SerialPort ("/dev/tty0", 1);

$| = 1;

$PortObj->user_msg(1);
$PortObj->handshake('none');
$PortObj->baudrate(9600);
#$PortObj->baudrate(19200);
$PortObj->parity("none");
$PortObj->stopbits(1);
$PortObj->write_settings || undef $PortObj;

my $fnum = 0;
my $fdelim;
my $rdelim;
my $cdelim;
my $edelim;
my $control = 0;

my $count;
my $saw;

do {
	($count, $saw) = $PortObj->read(1);
	sleep 1 if ($count <= 0);
} while ($count <= 0 || $saw ne chr(5));

my $count_out = $PortObj->write(chr(6));
my $buf;
my $ncount = 0;

do {
	$buf = '';

	do {
		($count, $saw) = $PortObj->read(1);
		$buf .= $saw if ($count > 0);
	} while ($count <= 0 || $saw ne "\n");

	my $data = &validate_line($buf);

	if (!defined($data)) {
		$count_out = $PortObj->write(chr(21));
		$ncount++;

		die "Failed communications.\n" if ($ncount >= 6);
	}
	else {
		$ncount = 0;
		$count_out = $PortObj->write(chr(4));
	}

	#print "$data\n";
	&parse_data($data);
} while ($buf !~ /\x03/);

sub validate_line {
	my $line = shift;
	my $chk;

	if ($line !~ (/^\x02(\d)(.*)\r([\x03\x17])([0-98A-F]{2})\r/)) {
		warn "Bad line. Did not match expected format.\n";
		return undef;
	}

	my $frame = $1;
	my $text = $2;
	my $ftype = $3;
	my $refchk = $4;

	my $next = ($fnum + 1)%8;

	if ($frame != $fnum && $frame != $next) {
		warn "Bad frame. Expected $fnum or $next, got $frame\n";
		return undef;
	}

	$fnum = $frame;

	for (my $i = 0; substr($line, $i, 1) !~ /[\x03\x17]/; $i++) {
		my $c = substr($line, $i, 1);

		if ($c eq "\x02") {
			$chk = 0;
		}
		else {
			$chk += ord($c);
			$chk &=0xff;
		}

	}

	$chk += ord($ftype);
	$chk &=0xff;
	$chk = sprintf("%02X", $chk);

	if ($chk ne $refchk) {
		warn "Bad checksum. Got $chk, needed $refchk\n";
		return undef;
	}

	return $text;
}

sub parse_data {
	my $data = shift;
	my $dtype = substr($data, 0, 1);


	if ($dtype eq 'R') {
		my @fields = split(/$fdelim/, $data);
		my $snum = $fields[1];
		my $id = $fields[2];
		my $mes = $fields[3];
		my $unit = $fields[4];
		my $flag = $fields[6];
		my $mark = $fields[7];
		my $stat = $fields[8];
		my $dstamp = $fields[11];
		$dstamp = '000000000000' if (!defined($dstamp));
		my $date = substr($dstamp, 4, 2) . '/'
			. substr($dstamp, 6, 2) . '/'
			. substr($dstamp, 0, 4);
		my $time = substr($dstamp, 8, 2) . ':' . substr($dstamp, 10, 2);

		@fields = split(/$cdelim/, $id);
		$id = $fields[3];
		@fields = split(/$cdelim/, $unit);
		$unit = $fields[0];
		my $ref = $fields[1];

		print "$snum,$id,$mes,$unit,$ref,$flag,$mark,$stat,$date,$time\n"
			if (!$control && $id eq 'Glucose');
	}
	elsif ($dtype eq 'O') {
		my @fields = split(/$fdelim/, $data);
		my $snum = $fields[1];

		if (@fields >= 12 && $fields[11] eq 'Q') {
			$control = 1;
		}
		else {
			$control = 0;
		}

	}
	elsif ($dtype eq 'H') {
		$fdelim = '\\' . substr($data, 1, 1);
		$rdelim = '\\' . substr($data, 2, 1);
		$cdelim = '\\' . substr($data, 3, 1);
		$edelim = '\\' . substr($data, 4, 1);
		my @fields = split(/$fdelim/, $data);
		my $passwd = $fields[3];
		my $id = $fields[4];
		my $pid = $fields[11];
		my $ver = $fields[12];
		my $date = $fields[13];
		@fields = split(/$cdelim/, $id);
		my $pcode = $fields[0];
		my $sver = $fields[1];
		my $sn = $fields[2];

		print STDERR "Meter results from $date\n";
		print STDERR " Meter: $pcode (SN $sn) software version $sver\n";
	}
	# Skipping any other record types.

}
Perl 5 = installed
CPAN (Device:SerialPort) = installed
OS = Fedora 17 64bit
Platform = VM on VirtualBox

I am new to Linux, so i'm sorry if i'm missing something

Many Thanks
Guy
 
Old 08-21-2012, 09:47 PM   #2
gregAstley
LQ Newbie
 
Registered: Aug 2012
Distribution: ubuntu 11.10
Posts: 27

Rep: Reputation: 4
Quote:
Originally Posted by j666gak View Post
Hello,

I have found a very useful script when I get it working, it was posted a few years ago. It will pull information off my blood testing meter. However when trying to run the script I keep getting the following error, please can somebody help?

Code:
Can't call method "user_msg" on an undefined value at meter.pl line 11.
This is the script
Code:
#!/usr/bin/perl -w

use strict;

use Device::SerialPort qw( :PARAM :STAT 0.07 );

my $PortObj = new Device::SerialPort ("/dev/tty0", 1);

$| = 1;

$PortObj->user_msg(1);
$PortObj->handshake('none');
$PortObj->baudrate(9600);
#$PortObj->baudrate(19200);
$PortObj->parity("none");
$PortObj->stopbits(1);
$PortObj->write_settings || undef $PortObj;

my $fnum = 0;
my $fdelim;
my $rdelim;
my $cdelim;
my $edelim;
my $control = 0;

my $count;
my $saw;

do {
	($count, $saw) = $PortObj->read(1);
	sleep 1 if ($count <= 0);
} while ($count <= 0 || $saw ne chr(5));

my $count_out = $PortObj->write(chr(6));
my $buf;
my $ncount = 0;

do {
	$buf = '';

	do {
		($count, $saw) = $PortObj->read(1);
		$buf .= $saw if ($count > 0);
	} while ($count <= 0 || $saw ne "\n");

	my $data = &validate_line($buf);

	if (!defined($data)) {
		$count_out = $PortObj->write(chr(21));
		$ncount++;

		die "Failed communications.\n" if ($ncount >= 6);
	}
	else {
		$ncount = 0;
		$count_out = $PortObj->write(chr(4));
	}

	#print "$data\n";
	&parse_data($data);
} while ($buf !~ /\x03/);

sub validate_line {
	my $line = shift;
	my $chk;

	if ($line !~ (/^\x02(\d)(.*)\r([\x03\x17])([0-98A-F]{2})\r/)) {
		warn "Bad line. Did not match expected format.\n";
		return undef;
	}

	my $frame = $1;
	my $text = $2;
	my $ftype = $3;
	my $refchk = $4;

	my $next = ($fnum + 1)%8;

	if ($frame != $fnum && $frame != $next) {
		warn "Bad frame. Expected $fnum or $next, got $frame\n";
		return undef;
	}

	$fnum = $frame;

	for (my $i = 0; substr($line, $i, 1) !~ /[\x03\x17]/; $i++) {
		my $c = substr($line, $i, 1);

		if ($c eq "\x02") {
			$chk = 0;
		}
		else {
			$chk += ord($c);
			$chk &=0xff;
		}

	}

	$chk += ord($ftype);
	$chk &=0xff;
	$chk = sprintf("%02X", $chk);

	if ($chk ne $refchk) {
		warn "Bad checksum. Got $chk, needed $refchk\n";
		return undef;
	}

	return $text;
}

sub parse_data {
	my $data = shift;
	my $dtype = substr($data, 0, 1);


	if ($dtype eq 'R') {
		my @fields = split(/$fdelim/, $data);
		my $snum = $fields[1];
		my $id = $fields[2];
		my $mes = $fields[3];
		my $unit = $fields[4];
		my $flag = $fields[6];
		my $mark = $fields[7];
		my $stat = $fields[8];
		my $dstamp = $fields[11];
		$dstamp = '000000000000' if (!defined($dstamp));
		my $date = substr($dstamp, 4, 2) . '/'
			. substr($dstamp, 6, 2) . '/'
			. substr($dstamp, 0, 4);
		my $time = substr($dstamp, 8, 2) . ':' . substr($dstamp, 10, 2);

		@fields = split(/$cdelim/, $id);
		$id = $fields[3];
		@fields = split(/$cdelim/, $unit);
		$unit = $fields[0];
		my $ref = $fields[1];

		print "$snum,$id,$mes,$unit,$ref,$flag,$mark,$stat,$date,$time\n"
			if (!$control && $id eq 'Glucose');
	}
	elsif ($dtype eq 'O') {
		my @fields = split(/$fdelim/, $data);
		my $snum = $fields[1];

		if (@fields >= 12 && $fields[11] eq 'Q') {
			$control = 1;
		}
		else {
			$control = 0;
		}

	}
	elsif ($dtype eq 'H') {
		$fdelim = '\\' . substr($data, 1, 1);
		$rdelim = '\\' . substr($data, 2, 1);
		$cdelim = '\\' . substr($data, 3, 1);
		$edelim = '\\' . substr($data, 4, 1);
		my @fields = split(/$fdelim/, $data);
		my $passwd = $fields[3];
		my $id = $fields[4];
		my $pid = $fields[11];
		my $ver = $fields[12];
		my $date = $fields[13];
		@fields = split(/$cdelim/, $id);
		my $pcode = $fields[0];
		my $sver = $fields[1];
		my $sn = $fields[2];

		print STDERR "Meter results from $date\n";
		print STDERR " Meter: $pcode (SN $sn) software version $sver\n";
	}
	# Skipping any other record types.

}
Perl 5 = installed
CPAN (Device:SerialPort) = installed
OS = Fedora 17 64bit
Platform = VM on VirtualBox

I am new to Linux, so i'm sorry if i'm missing something

Many Thanks
Guy
In lieu of someone else coming along with more perl experience than I could you change the line which says
Code:
my $PortObj = new Device::SerialPort ("/dev/tty0", 1);
to
Code:
my $PortObj = new Device::SerialPort ("/dev/tty0", 1) or die "some text here";
?

It looks like PortObj isn't being initialised properly and that the line above is the culprit. If we see the "some text here" string then this line is definitely failing.
 
Old 08-22-2012, 02:12 AM   #3
chrism01
LQ Guru
 
Registered: Aug 2004
Location: Sydney
Distribution: Centos 6.8, Centos 5.10
Posts: 17,240

Rep: Reputation: 2324Reputation: 2324Reputation: 2324Reputation: 2324Reputation: 2324Reputation: 2324Reputation: 2324Reputation: 2324Reputation: 2324Reputation: 2324Reputation: 2324
Try amending that line to
Code:
my $PortObj = new Device::SerialPort ("/dev/tty0", 1) or die "some text here $@ Or $! \n";
In most cases in Perl, $! contains the returned err status & msg, but I have found that some things (eg Object oriented and some other modules) use $@.
No harm in trying both.
Certainly your current err msg implies that the 'new Obj...' failed somehow.

You should read this http://search.cpan.org/~cook/Device-.../SerialPort.pm

Last edited by chrism01; 08-22-2012 at 02:13 AM.
 
Old 08-22-2012, 07:46 PM   #4
j666gak
LQ Newbie
 
Registered: Mar 2012
Posts: 2

Original Poster
Rep: Reputation: Disabled
Hi, thanks for the help. I have tried what you asked but getting no further I have run the command below to check I have the correct port, but being new to Linux I am ever so slightly confused.

From the information below I have point the script to /dev/sdb and then /dev/sdc, but still no joy

PHP Code:
[guy@fedora17 Downloads]$ sudo tail -/var/log/messages
[sudopassword for guy
Aug 23 00:30:52 fedora17 kernel: [ 3828.268050FAT-fs (sdc): Directory bread(block 526failed
Aug 23 00
:30:52 fedora17 kernel: [ 3828.268050FAT-fs (sdc): Directory bread(block 527failed
Aug 23 00
:30:52 fedora17 udisksd[1181]: Cleaning up mount point /run/media/guy/GLUCOFACTS (device 8:32 no longer exist)
Aug 23 00:31:37 fedora17 dbus-daemon[559]: dbus[559]: [systemActivating service name='net.reactivated.Fprint' (using servicehelper)
Aug 23 00:31:37 fedora17 dbus[559]: [systemActivating service name='net.reactivated.Fprint' (using servicehelper)
Aug 23 00:31:37 fedora17 dbus-daemon[559]: Launching FprintObject
Aug 23 00
:31:37 fedora17 dbus-daemon[559]: dbus[559]: [systemSuccessfully activated service 'net.reactivated.Fprint'
Aug 23 00:31:37 fedora17 dbus[559]: [systemSuccessfully activated service 'net.reactivated.Fprint'
Aug 23 00:31:37 fedora17 dbus-daemon[559]: ** MessageD-Bus service launched with namenet.reactivated.Fprint
Aug 23 00
:31:37 fedora17 dbus-daemon[559]: ** Messageentering main loop
Aug 23 00
:32:07 fedora17 dbus-daemon[559]: ** MessageNo devices in use, exit
Aug 23 00:32:36 fedora17 kernel: [ 3931.536522usb 1-2: new full-speed USB device number 7 using ohci_hcd
Aug 23 00
:32:36 fedora17 kernel: [ 3931.970502usb 1-2: New USB device foundidVendor=1a79idProduct=6002
Aug 23 00
:32:36 fedora17 kernel: [ 3931.970513usb 1-2: New USB device stringsMfr=1Product=2SerialNumber=3
Aug 23 00
:32:36 fedora17 kernel: [ 3931.970521usb 1-2ProductContour USB
Aug 23 00
:32:36 fedora17 kernel: [ 3931.970526usb 1-2ManufacturerBayer HealthCare LLC
Aug 23 00
:32:36 fedora17 kernel: [ 3931.970531usb 1-2SerialNumber0000000002116752
Aug 23 00
:32:36 fedora17 kernel: [ 3931.996666generic-usb 0003:1A79:6002.0005hiddev0,hidraw1USB HID v10.10 Device [Bayer HealthCare LLC Contour USBon usb-0000:00:06.0-2/input0
Aug 23 00
:32:36 fedora17 kernel: [ 3932.010527scsi6 usb-storage 1-2:1.1
Aug 23 00
:32:36 fedora17 mtp-probechecking bus 1device 7"/sys/devices/pci0000:00/0000:00:06.0/usb1/1-2"
Aug 23 00:32:36 fedora17 mtp-probebus1device7 was not an MTP device
Aug 23 00
:32:37 fedora17 kernel: [ 3933.034163scsi 6:0:0:0Direct-Access                                    PQ0 ANSI2
Aug 23 00
:32:37 fedora17 kernel: [ 3933.043509scsi 6:0:0:1Direct-Access                                    PQ0 ANSI2
Aug 23 00
:32:37 fedora17 kernel: [ 3933.058246sd 6:0:0:0Attached scsi generic sg2 type 0
Aug 23 00
:32:37 fedora17 kernel: [ 3933.060426sd 6:0:0:1Attached scsi generic sg3 type 0
Aug 23 00
:32:37 fedora17 kernel: [ 3933.245205sd 6:0:0:0: [sdb930240 512-byte logical blocks: (476 MB/454 MiB)
Aug 23 00:32:37 fedora17 kernel: [ 3933.254198sd 6:0:0:1: [sdc1000000 512-byte logical blocks: (512 MB/488 MiB)
Aug 23 00:32:37 fedora17 kernel: [ 3933.268180sd 6:0:0:0: [sdbWrite Protect is off
Aug 23 00
:32:37 fedora17 kernel: [ 3933.282191sd 6:0:0:1: [sdcWrite Protect is off
Aug 23 00
:32:37 fedora17 kernel: [ 3933.296179sd 6:0:0:0: [sdbNo Caching mode page present
Aug 23 00
:32:37 fedora17 kernel: [ 3933.296186sd 6:0:0:0: [sdbAssuming drive cachewrite through
Aug 23 00
:32:37 fedora17 kernel: [ 3933.310205sd 6:0:0:1: [sdcNo Caching mode page present
Aug 23 00
:32:37 fedora17 kernel: [ 3933.310211sd 6:0:0:1: [sdcAssuming drive cachewrite through
Aug 23 00
:32:38 fedora17 kernel: [ 3933.406179sd 6:0:0:0: [sdbNo Caching mode page present
Aug 23 00
:32:38 fedora17 kernel: [ 3933.406186sd 6:0:0:0: [sdbAssuming drive cachewrite through
Aug 23 00
:32:38 fedora17 kernel: [ 3933.420230sd 6:0:0:1: [sdcNo Caching mode page present
Aug 23 00
:32:38 fedora17 kernel: [ 3933.420237sd 6:0:0:1: [sdcAssuming drive cachewrite through
Aug 23 00
:32:38 fedora17 kernel: [ 3933.448220]  sdb:
Aug 23 00:32:38 fedora17 kernel: [ 3933.474609]  sdc:
Aug 23 00:32:38 fedora17 kernel: [ 3933.562300sd 6:0:0:0: [sdbNo Caching mode page present
Aug 23 00
:32:38 fedora17 kernel: [ 3933.562306sd 6:0:0:0: [sdbAssuming drive cachewrite through
Aug 23 00
:32:38 fedora17 kernel: [ 3933.562310sd 6:0:0:0: [sdbAttached SCSI removable disk
Aug 23 00
:32:38 fedora17 kernel: [ 3933.609102sd 6:0:0:1: [sdcNo Caching mode page present
Aug 23 00
:32:38 fedora17 kernel: [ 3933.609108sd 6:0:0:1: [sdcAssuming drive cachewrite through
Aug 23 00
:32:38 fedora17 kernel: [ 3933.609112sd 6:0:0:1: [sdcAttached SCSI removable disk
Aug 23 00
:32:43 fedora17 udisksd[1181]: Mounted /dev/sdb at /run/media/guy/CONTOUR USB on behalf of uid 1000
Aug 23 00
:32:43 fedora17 udisksd[1181]: Mounted /dev/sdc at /run/media/guy/GLUCOFACTS on behalf of uid 1000 
 
Old 08-23-2012, 08:16 AM   #5
gregAstley
LQ Newbie
 
Registered: Aug 2012
Distribution: ubuntu 11.10
Posts: 27

Rep: Reputation: 4
Quote:
Originally Posted by j666gak View Post
Hi, thanks for the help. I have tried what you asked but getting no further I have run the command below to check I have the correct port, but being new to Linux I am ever so slightly confused.

From the information below I have point the script to /dev/sdb and then /dev/sdc, but still no joy

Code:
[guy@fedora17 Downloads]$ sudo tail -f /var/log/messages
[sudo] password for guy: 
Aug 23 00:30:52 fedora17 kernel: [ 3828.268050] FAT-fs (sdc): Directory bread(block 526) failed
Aug 23 00:30:52 fedora17 kernel: [ 3828.268050] FAT-fs (sdc): Directory bread(block 527) failed
Aug 23 00:30:52 fedora17 udisksd[1181]: Cleaning up mount point /run/media/guy/GLUCOFACTS (device 8:32 no longer exist)
Aug 23 00:31:37 fedora17 dbus-daemon[559]: dbus[559]: [system] Activating service name='net.reactivated.Fprint' (using servicehelper)
Aug 23 00:31:37 fedora17 dbus[559]: [system] Activating service name='net.reactivated.Fprint' (using servicehelper)
Aug 23 00:31:37 fedora17 dbus-daemon[559]: Launching FprintObject
Aug 23 00:31:37 fedora17 dbus-daemon[559]: dbus[559]: [system] Successfully activated service 'net.reactivated.Fprint'
Aug 23 00:31:37 fedora17 dbus[559]: [system] Successfully activated service 'net.reactivated.Fprint'
Aug 23 00:31:37 fedora17 dbus-daemon[559]: ** Message: D-Bus service launched with name: net.reactivated.Fprint
Aug 23 00:31:37 fedora17 dbus-daemon[559]: ** Message: entering main loop
Aug 23 00:32:07 fedora17 dbus-daemon[559]: ** Message: No devices in use, exit
Aug 23 00:32:36 fedora17 kernel: [ 3931.536522] usb 1-2: new full-speed USB device number 7 using ohci_hcd
Aug 23 00:32:36 fedora17 kernel: [ 3931.970502] usb 1-2: New USB device found, idVendor=1a79, idProduct=6002
Aug 23 00:32:36 fedora17 kernel: [ 3931.970513] usb 1-2: New USB device strings: Mfr=1, Product=2, SerialNumber=3
Aug 23 00:32:36 fedora17 kernel: [ 3931.970521] usb 1-2: Product: Contour USB
Aug 23 00:32:36 fedora17 kernel: [ 3931.970526] usb 1-2: Manufacturer: Bayer HealthCare LLC
Aug 23 00:32:36 fedora17 kernel: [ 3931.970531] usb 1-2: SerialNumber: 0000000002116752
Aug 23 00:32:36 fedora17 kernel: [ 3931.996666] generic-usb 0003:1A79:6002.0005: hiddev0,hidraw1: USB HID v10.10 Device [Bayer HealthCare LLC Contour USB] on usb-0000:00:06.0-2/input0
Aug 23 00:32:36 fedora17 kernel: [ 3932.010527] scsi6 : usb-storage 1-2:1.1
Aug 23 00:32:36 fedora17 mtp-probe: checking bus 1, device 7: "/sys/devices/pci0000:00/0000:00:06.0/usb1/1-2"
Aug 23 00:32:36 fedora17 mtp-probe: bus: 1, device: 7 was not an MTP device
Aug 23 00:32:37 fedora17 kernel: [ 3933.034163] scsi 6:0:0:0: Direct-Access                                    PQ: 0 ANSI: 2
Aug 23 00:32:37 fedora17 kernel: [ 3933.043509] scsi 6:0:0:1: Direct-Access                                    PQ: 0 ANSI: 2
Aug 23 00:32:37 fedora17 kernel: [ 3933.058246] sd 6:0:0:0: Attached scsi generic sg2 type 0
Aug 23 00:32:37 fedora17 kernel: [ 3933.060426] sd 6:0:0:1: Attached scsi generic sg3 type 0
Aug 23 00:32:37 fedora17 kernel: [ 3933.245205] sd 6:0:0:0: [sdb] 930240 512-byte logical blocks: (476 MB/454 MiB)
Aug 23 00:32:37 fedora17 kernel: [ 3933.254198] sd 6:0:0:1: [sdc] 1000000 512-byte logical blocks: (512 MB/488 MiB)
Aug 23 00:32:37 fedora17 kernel: [ 3933.268180] sd 6:0:0:0: [sdb] Write Protect is off
Aug 23 00:32:37 fedora17 kernel: [ 3933.282191] sd 6:0:0:1: [sdc] Write Protect is off
Aug 23 00:32:37 fedora17 kernel: [ 3933.296179] sd 6:0:0:0: [sdb] No Caching mode page present
Aug 23 00:32:37 fedora17 kernel: [ 3933.296186] sd 6:0:0:0: [sdb] Assuming drive cache: write through
Aug 23 00:32:37 fedora17 kernel: [ 3933.310205] sd 6:0:0:1: [sdc] No Caching mode page present
Aug 23 00:32:37 fedora17 kernel: [ 3933.310211] sd 6:0:0:1: [sdc] Assuming drive cache: write through
Aug 23 00:32:38 fedora17 kernel: [ 3933.406179] sd 6:0:0:0: [sdb] No Caching mode page present
Aug 23 00:32:38 fedora17 kernel: [ 3933.406186] sd 6:0:0:0: [sdb] Assuming drive cache: write through
Aug 23 00:32:38 fedora17 kernel: [ 3933.420230] sd 6:0:0:1: [sdc] No Caching mode page present
Aug 23 00:32:38 fedora17 kernel: [ 3933.420237] sd 6:0:0:1: [sdc] Assuming drive cache: write through
Aug 23 00:32:38 fedora17 kernel: [ 3933.448220]  sdb:
Aug 23 00:32:38 fedora17 kernel: [ 3933.474609]  sdc:
Aug 23 00:32:38 fedora17 kernel: [ 3933.562300] sd 6:0:0:0: [sdb] No Caching mode page present
Aug 23 00:32:38 fedora17 kernel: [ 3933.562306] sd 6:0:0:0: [sdb] Assuming drive cache: write through
Aug 23 00:32:38 fedora17 kernel: [ 3933.562310] sd 6:0:0:0: [sdb] Attached SCSI removable disk
Aug 23 00:32:38 fedora17 kernel: [ 3933.609102] sd 6:0:0:1: [sdc] No Caching mode page present
Aug 23 00:32:38 fedora17 kernel: [ 3933.609108] sd 6:0:0:1: [sdc] Assuming drive cache: write through
Aug 23 00:32:38 fedora17 kernel: [ 3933.609112] sd 6:0:0:1: [sdc] Attached SCSI removable disk
Aug 23 00:32:43 fedora17 udisksd[1181]: Mounted /dev/sdb at /run/media/guy/CONTOUR USB on behalf of uid 1000
Aug 23 00:32:43 fedora17 udisksd[1181]: Mounted /dev/sdc at /run/media/guy/GLUCOFACTS on behalf of uid 1000
Hi, when you say "I have tried what you asked but getting no further", does this mean you did not see the texted you added to that line!? (that suggestion wasn't meant to fix the problem - it was meant to diagnose it)
You may want to post this in the programming forum also but, one question...a really daft question perhaps...I noticed that the logs refer to a USB connection whilst your script refers to a serial port connection. has the actual blood monitor been upgraded such that the connection is now USB? (if so then then you'd probably need to change the script such that it finds your device attached to whatever USB port you have it connected to... a couple of pages that would be useful:
http://search.cpan.org/~gwadej/Device-USB-0.35/USB.pm, http://search.cpan.org/dist/Device-S.../SerialPort.pm )

Last edited by gregAstley; 08-23-2012 at 08:24 AM.
 
Old 08-23-2012, 09:28 AM   #6
r0b0
Member
 
Registered: Aug 2004
Location: Europe
Posts: 608

Rep: Reputation: 50
Hi Guy,

You need to figure out the correct "device" to use in line 11 of your script. If your device is a USB serial device, it could be something like /dev/usb/hiddev0 .
 
Old 08-23-2012, 07:31 PM   #7
chrism01
LQ Guru
 
Registered: Aug 2004
Location: Sydney
Distribution: Centos 6.8, Centos 5.10
Posts: 17,240

Rep: Reputation: 2324Reputation: 2324Reputation: 2324Reputation: 2324Reputation: 2324Reputation: 2324Reputation: 2324Reputation: 2324Reputation: 2324Reputation: 2324Reputation: 2324
As above, what output did you get when you changed the line as requested ??
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
problem with perl modules declaration and perl/cgi script shifter Programming 9 02-24-2010 10:09 AM
need perl help...perl module problem john83reuben Programming 2 03-22-2008 10:08 PM
Problem with perl module for w3c validator to work on my local Apache+PHP+perl instal tbamt Linux - Software 0 12-16-2004 06:37 PM
perl(Cwd) perl(File::Basename) perl(File::Copy) perl(strict)....What are those? Baldorg Linux - Software 1 11-09-2003 09:09 PM
perl problem? apache problem? cgi problem? WorldBuilder Linux - Software 1 09-17-2003 08:45 PM


All times are GMT -5. The time now is 06:01 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration