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 |
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
Are you new to LinuxQuestions.org? Visit the following links:
Site Howto |
Site FAQ |
Sitemap |
Register Now
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
|
 |
08-21-2012, 08:32 PM
|
#1
|
LQ Newbie
Registered: Mar 2012
Posts: 2
Rep: 
|
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
|
|
|
08-21-2012, 08:47 PM
|
#2
|
LQ Newbie
Registered: Aug 2012
Distribution: ubuntu 11.10
Posts: 27
Rep:
|
Quote:
Originally Posted by j666gak
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.
|
|
|
08-22-2012, 01:12 AM
|
#3
|
LQ Guru
Registered: Aug 2004
Location: Sydney
Distribution: Rocky 9.x
Posts: 18,434
|
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 01:13 AM.
|
|
|
08-22-2012, 06:46 PM
|
#4
|
LQ Newbie
Registered: Mar 2012
Posts: 2
Original Poster
Rep: 
|
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 -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
|
|
|
08-23-2012, 07:16 AM
|
#5
|
LQ Newbie
Registered: Aug 2012
Distribution: ubuntu 11.10
Posts: 27
Rep:
|
Quote:
Originally Posted by j666gak
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 07:24 AM.
|
|
|
08-23-2012, 08:28 AM
|
#6
|
Member
Registered: Aug 2004
Location: Europe
Posts: 608
Rep:
|
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 .
|
|
|
08-23-2012, 06:31 PM
|
#7
|
LQ Guru
Registered: Aug 2004
Location: Sydney
Distribution: Rocky 9.x
Posts: 18,434
|
As above, what output did you get when you changed the line as requested ??
|
|
|
All times are GMT -5. The time now is 12:54 PM.
|
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.
|
Latest Threads
LQ News
|
|