Re: lock access to serial port

2008-03-19 Thread Andra
I tried ready-made commands for file locking, and turned to that LCK file just in case some permissions are wrong and that's the reason the commands fail. On 19 Marts, 15:43, Grant Edwards <[EMAIL PROTECTED]> wrote: > On 2008-03-18, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote: > > > how to get tty

Re: lock access to serial port

2008-03-19 Thread [EMAIL PROTECTED]
hmm, now it seems I get to the locking try: ser = serial.Serial(dev, 19200, rtscts=1, timeout=1) if ser.isOpen(): try: fcntl.lockf(ser,fcntl.LOCK_EX) but get into some weirdness - trying to lock does not time out! The script stops at this line and wai

Re: lock access to serial port

2008-03-19 Thread Grant Edwards
On 2008-03-18, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote: > how to get ttyS0 serial port for exclusive access? I have a python > script that uses this device with AT commands. I need that two > instances can call simultaneosuly this python script but only one of > them gets the device. I tried f

Re: lock access to serial port

2008-03-19 Thread [EMAIL PROTECTED]
not the goal setup but the way I tried it out - a webpage to send an sms to mobile phone. This is an php what calls a python script. A python script opens serial device, checks for gsm network, sends a message - on all the way I try to make sure that appropriate answers are received from the gsm de

Re: lock access to serial port

2008-03-19 Thread taco
[EMAIL PROTECTED] wrote: > hello group, > > how to get ttyS0 serial port for exclusive access? I have a python > script that uses this device with AT commands. I need that two > instances can call simultaneosuly this python script but only one of > them gets the device. I tried fcntl.flock, it wa

lock access to serial port

2008-03-18 Thread [EMAIL PROTECTED]
hello group, how to get ttyS0 serial port for exclusive access? I have a python script that uses this device with AT commands. I need that two instances can call simultaneosuly this python script but only one of them gets the device. I tried fcntl.flock, it was just ignored, put writtable file LCK