Hello!!!
My problem is: i'm trying to send At commands from Pc to mobile phone using bluetooth and cygwin and i would like to read the device's answers on the shell bash. And so, i open two terminals in this way:
xterm &
In the first i write:
cat /dev/ttyS2
because the device is connected at com3.
In the second one i write the instruction with the AT commands:
echo "AT">/dev/ttyS2
However i'm facing with this error:
/dev/ttyS2: Device or resource busy
Is there anyone that can help me??HELPPPPPP
SORRY FOR MY BAD ENGLISH!!!!!!!!!
Remember, Cygwin is still subject to silly Windows limitations like two programs not being able to open one port. bash can't open a file for reading and writing simultaneously, so bash can't do it by itself. I'm trying to think of a common shell utility to do this or some way to trick bash into it but so far I'm coming up empty... There's things like minicom, but I'm guessing you want to automate something.
You could use putty if just typing in raw commands is what you want. It's what I use for raw serial port communication in UNIX, and there's a native Windows version with precisely the same functionality.
Or... It's entirely possible your phone doesn't have the control signals to tell it when the connection's broken, so that closing the device file doesn't lose anything. You might be able to
if you set it up with stty correctly first. There's a setting in stty somewhere to define the amount of time to wait before closing the connection. Set it to zero(or just something small) and it gives you only what's in the buffer, which lets you just keep reopening and reclosing it whenever you want to read or write. I've used this feature in actual UNIX, but I don't know if Windows will do this properly -- it might just discard everything while the file's closed.
---------- Post updated at 02:41 PM ---------- Previous update was at 02:11 PM ----------
I finally figured it out, maybe. Try this:
Windows may still complain. I'm not sure.
Last edited by Corona688; 09-15-2009 at 05:19 PM..
Using puTTy it works but my aim was to automate the process.
So I try:
# Open ttyS2 for reading and writing as FD 5
exec 5<>/dev/ttyS2
# Leave this running in the background
cat <&5 &
# Write a command to FD 5
echo "AT" >&5
and I think that it's a good idea!! But now, there is another problem: when I try to send an SMS through At commands I have to communicate the control character [ctrl+z] ^Z to serial port...and I have some troubles to do this.
echo "\032">&5
echo "^Z" >&5
They don't work probably because I had to set up some features with stty but when I try:
stty -F /dev/ttyS2 isig
I face with this error:
stty: /dev/ttyS3: unable to perform all requested operations
echo doesn't try to translate anything unless you tell it to. You can send arbitrary ASCII characters with echo like
The -e part tells it to convert \x codes into ASCII characters. -n tells it not to apppend a newline.
I also have a suspicion this fd-opening thing is only working because 'echo' is a bash builtin so doesn't need to launch a new process. Try to avoid pipes and such to avoid unexpected problems writing to the serial device..
---------- Post updated at 02:06 PM ---------- Previous update was at 01:59 PM ----------
Did you make a typo? That's not the device you were using before.
Hi,
Unable to make tape backup, please help.
/opt/ignite/bin/make_tape_recovery -a /dev/rmt/?mn -I -v -m tar -x inc_entire=vg00
* Creating local directories for configuration files and archive.
======= 04/25/16 16:28:08 IST Started /opt/ignite/bin/make_tape_recovery.
(Mon... (4 Replies)
Hi there
After making a backup copy of it sometimes happens that when I want to unmount an NFS indicates the error:umount: /path_mount busy: Device busy (Error 16)
if I run lsoff, I can not find the process that is blocking the application.
I'm using OpenServer 5.0.2c as one NFS server ... (14 Replies)
Is there a trick to mounting swap in n a lvm? I can't get it to work.
# swapon -va
swapon on /dev/mapper/VG-lv_swap
swapon: /dev/mapper/VG-lv_swap: found swap signature: version 1, page-size 4, same byte order
swapon: /dev/mapper/VG-lv_swap: pagesize=4096, swapsize=4294967296,... (1 Reply)
Hi Everyone,
I am trying to remove a directory:
$ rm -rf directory_name/
rm: cannot remove `directory_name/filename': Device or resource busy
What does this mean, and why can't I remove these files? I already tried moving into the directory, and removing the files individually, but I... (7 Replies)
hello to everybody
I have Ubuntu Lucid 10.04 installed on my Desktop and I have a PCI serial card in my computer and it has only one serial port.
Actually I want to use this serial port for the serial communication and for that I executed this command :
$ setserial -g /dev/ttyS
and I... (0 Replies)
Ciao a tutti!!!
il mio problema è questo: sto cercando di inviare dei comandi AT da PC a cellulare utilizzando il bluetooth e cygwin e vorrei visualizzare le risposte nella shell bash. Per farlo apro due terminali utilizzando le seguente istruzioni:
xterm &
Sul primo scrivo
cat /dev/ttyS2
... (1 Reply)
Ciao a tutti!!!
il mio problema è questo: sto cercando di inviare dei comandi AT da PC a cellulare utilizzando il bluetooth e cygwin e vorrei visualizzare le risposte nella shell bash. Per farlo apro due terminali utilizzando le seguente istruzioni:
xterm &
Sul primo scrivo
cat /dev/ttyS2
... (0 Replies)
Hi,
I'm trying to do a sharity mount to mount a terastation network drive.
I'm getting a Device or resource busy message after my mount command. Please see output below...
# /usr/local/sharity3/bin/sharity mount smb://labbackup01/bakup_data /mnt/labbackup01
Device or resource busy.... (2 Replies)
Anyone have any idea why I cannot umount a directory even though fuser shows no process attached to it?
fuser -cu /data/oracle/GMPSHRDM/export
/data/oracle/GMPSHRDM/export:
umount /data/oracle/GMPSHRDM/export
umount: cannot unmount /data/oracle/GMPSHRDM/export : Device busy
umount:... (2 Replies)
I'm trying to unmount a file system, but umount says the device is busy. A fuser -c /myfs tells me that nothing on this fs is in use. Any idea?
Oh, and btw, why isn't my signature beeing displayed? Show user's signature is enabled and I have entered one :/ (10 Replies)