Skip Menu |

This queue is for tickets about the Device-LaCrosse-WS23xx CPAN distribution.

Report information
The Basics
Id: 89969
Status: resolved
Priority: 0/
Queue: Device-LaCrosse-WS23xx

People
Owner: cpanrt [...] edsantiago.com
Requestors: sid [...] sidtupper.ca
Cc:
AdminCc:

Bug Information
Severity: (no value)
Broken in: (no value)
Fixed in: (no value)



Subject: dump2300 returns "serial device is locked by another program"
Date: Fri, 1 Nov 2013 16:21:58 -0700
To: <bug-Device-LaCrosse-WS23xx [...] rt.cpan.org>
From: "Sidney Tupper" <sid [...] sidtupper.ca>
Hi, I'm debugging a perl script (attached) that logs ws2308 data through /dev/ttyS1. OS Debian Squeeze hw MX945GSE (Atom N270) dump2300 works fine from the command line. It was working in the script too, called as system("/usr/local/bin/dump2300", "/home/sid/Documents/sump2300.txt", "6c6", "13d6"); Then the script began reporting: Serial device is locked by another program : Resource temporarily unavailable The error does not happen when I remove the dump2300 command from the script. I can't find a lock file. Rebooting the computer doesn't help. Rebooting the ws2308 station doesn't help. I'm not sure how to proceed and would appreciate suggestions. Thanks Sid

Message body is not shown because sender requested not to inline it.

Do you have lsof installed on your system, or can you install it? Try, as root: # lsof /dev/ttyS1 ...and see if it gives you anything useful such as the PID and name of a process that's using that device. If it does, try to understand what that process is and why it's running, then see if you an stop it gracefully (eg via init scripts). If you can't kill it gracefully, just kill the PID (as in "kill PID", not "kill -9 PID". Never use kill -9 except in direst extreme). If you don't see any output from lsof ... I guess I don't know what to suggest. But let me know either way, and I'll try to keep thinking.
Subject: RE: [rt.cpan.org #89969] dump2300 returns "serial device is locked by another program"
Date: Fri, 1 Nov 2013 18:54:41 -0700
To: <bug-Device-LaCrosse-WS23xx [...] rt.cpan.org>
From: "Sidney Tupper" <sid [...] sidtupper.ca>
Thank you for the quick response, that you responded at all, and particularly for ws23xx. lsof has no output. Perhaps if I run it in my script along with the dump2300 invocation it will reveal something useful. I think I will reinstall ws23xx which for some reason got made without several of the functions described in the README document, eg, bin2300. With bin2300 I could probably achieve the same outcome as dump2300. Sid Show quoted text
-----Original Message----- From: Eduardo Santiago Munoz via RT [mailto:bug-Device-LaCrosse-WS23xx@rt.cpan.org] Sent: Friday, November 01, 2013 6:29 PM To: sid@sidtupper.ca Subject: [rt.cpan.org #89969] dump2300 returns "serial device is locked by another program" <URL: https://rt.cpan.org/Ticket/Display.html?id=89969 > Do you have lsof installed on your system, or can you install it? Try, as root: # lsof /dev/ttyS1 ...and see if it gives you anything useful such as the PID and name of a process that's using that device. If it does, try to understand what that process is and why it's running, then see if you an stop it gracefully (eg via init scripts). If you can't kill it gracefully, just kill the PID (as in "kill PID", not "kill -9 PID". Never use kill -9 except in direst extreme). If you don't see any output from lsof ... I guess I don't know what to suggest. But let me know either way, and I'll try to keep thinking.
So, this wasn't entirely clear to me from your script (which got mangled by RT during upload), but: are you running dump2300 from within the same script that is using Device::LaCrosse::WS23xx ? That's not going to work, because both processes (script, dump2300) are trying to use the same /dev/ttyS1 ...
(It's bedtime over here, and tomorrow is mostly a backcountry day. If you write back with followup questions, please forgive me if I don't reply quickly).
Subject: RE: [rt.cpan.org #89969] dump2300 returns "serial device is locked by another program"
Date: Fri, 1 Nov 2013 19:54:13 -0700
To: <bug-Device-LaCrosse-WS23xx [...] rt.cpan.org>
From: "Sidney Tupper" <sid [...] sidtupper.ca>
Yes, you're right, that's the problem. Thanks so much for pointing this out to me. Sid Show quoted text
-----Original Message----- From: Eduardo Santiago Munoz via RT [mailto:bug-Device-LaCrosse-WS23xx@rt.cpan.org] Sent: Friday, November 01, 2013 7:00 PM To: sid@sidtupper.ca Subject: [rt.cpan.org #89969] dump2300 returns "serial device is locked by another program" <URL: https://rt.cpan.org/Ticket/Display.html?id=89969 > So, this wasn't entirely clear to me from your script (which got mangled by RT during upload), but: are you running dump2300 from within the same script that is using Device::LaCrosse::WS23xx ? That's not going to work, because both processes (script, dump2300) are trying to use the same /dev/ttyS1 ...