Re: [PHP] problem with sending AT command in php

2011-11-18 Thread a dehqan
In The Name Of Allah

Thank you all for attentions ;
Weird but solved with using another symbolink of Device
Weird because other App in linux in the same time were using for example
/dev/ttyusb1 but php code works with /dev/ttyusb3 ..

Regards dehqan


On Tue, Nov 15, 2011 at 7:39 PM, Richard Quadling rquadl...@gmail.comwrote:

 On 15 November 2011 15:12, Mike Mackintosh
 mike.mackint...@angrystatic.com wrote:
 
 
  On Nov 15, 2011, at 8:25, Richard Quadling rquadl...@gmail.com wrote:
 
  On 15 November 2011 11:50, a dehqan dehqa...@gmail.com wrote:
  \n is for Linux
  \r is for Windows
 
  On 11/14/11, Richard Quadling rquadl...@gmail.com wrote:
  On 12 November 2011 20:02, a dehqan dehqa...@gmail.com wrote:
  dio_write($handle, 'AT')  dio_write($handle, AT) make firefox
 times out
  on Waiting for localhost ... .
  But dio_write($handle, AT\n) makes it prints AT exactly the same
 command
  or  A  A , ..
 
  On Sat, Nov 12, 2011 at 10:02 PM, Negin Nickparsa
  nickpa...@gmail.comwrote:
 
  are you sure about ATD03518726535\n?
 
   can you try if ( dio_write($handle, 'AT') )?
 
 
 
  Don't use \n, use \r.
 
  http://en.wikipedia.org/wiki/AT_commands#Example_session
 
 
 
  --
  Richard Quadling
  Twitter : EE : Zend : PHPDoc : Fantasy Shopper
  @RQuadling : e-e.com/M_248814.html : bit.ly/9O8vFY : bit.ly/lFnVea :
  fan.sh/6/370
 
 
 
  No, \r is the requirement of the modem. Nothing to do with the OS.
 
  Windows uses \r\n as its line terminators, but when you talk to a
  modem, you use \r.
 
 
 
  --
  Richard Quadling
  Twitter : EE : Zend : PHPDoc : Fantasy Shopper
  @RQuadling : e-e.com/M_248814.html : bit.ly/9O8vFY : bit.ly/lFnVea :
  fan.sh/6/370
 
  --
  PHP General Mailing List (http://www.php.net/)
  To unsubscribe, visit: http://www.php.net/unsub.php
 
 
 
  I've had better luck with PHP_EOL instead of \r or \n.

 I think I've not explained myself properly.

 The modem wants a carriage return. That is a \r.

 It doesn't matter what OS you are on. If you don't send the right
 string to the modem, then the modem won't process it properly.

 If your OS maps \r to PHP_EOL, then, obviously PHP_EOL will be just
 fine. But I would recommend ...

 ?php
 define('CR', chr(13));
 ?



 --
 Richard Quadling
 Twitter : EE : Zend : PHPDoc : Fantasy Shopper
 @RQuadling : e-e.com/M_248814.html : bit.ly/9O8vFY : bit.ly/lFnVea :
 fan.sh/6/370



Re: [PHP] problem with sending AT command in php

2011-11-15 Thread a dehqan
\n is for Linux
\r is for Windows

On 11/14/11, Richard Quadling rquadl...@gmail.com wrote:
 On 12 November 2011 20:02, a dehqan dehqa...@gmail.com wrote:
 dio_write($handle, 'AT')  dio_write($handle, AT) make firefox times out
 on Waiting for localhost ... .
 But dio_write($handle, AT\n) makes it prints AT exactly the same command
 or  A  A , ..

 On Sat, Nov 12, 2011 at 10:02 PM, Negin Nickparsa
 nickpa...@gmail.comwrote:

 are you sure about ATD03518726535\n?

  can you try if ( dio_write($handle, 'AT') )?



 Don't use \n, use \r.

 http://en.wikipedia.org/wiki/AT_commands#Example_session



 --
 Richard Quadling
 Twitter : EE : Zend : PHPDoc : Fantasy Shopper
 @RQuadling : e-e.com/M_248814.html : bit.ly/9O8vFY : bit.ly/lFnVea :
 fan.sh/6/370


--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] problem with sending AT command in php

2011-11-15 Thread Richard Quadling
On 15 November 2011 11:50, a dehqan dehqa...@gmail.com wrote:
 \n is for Linux
 \r is for Windows

 On 11/14/11, Richard Quadling rquadl...@gmail.com wrote:
 On 12 November 2011 20:02, a dehqan dehqa...@gmail.com wrote:
 dio_write($handle, 'AT')  dio_write($handle, AT) make firefox times out
 on Waiting for localhost ... .
 But dio_write($handle, AT\n) makes it prints AT exactly the same command
 or  A  A , ..

 On Sat, Nov 12, 2011 at 10:02 PM, Negin Nickparsa
 nickpa...@gmail.comwrote:

 are you sure about ATD03518726535\n?

  can you try if ( dio_write($handle, 'AT') )?



 Don't use \n, use \r.

 http://en.wikipedia.org/wiki/AT_commands#Example_session



 --
 Richard Quadling
 Twitter : EE : Zend : PHPDoc : Fantasy Shopper
 @RQuadling : e-e.com/M_248814.html : bit.ly/9O8vFY : bit.ly/lFnVea :
 fan.sh/6/370



No, \r is the requirement of the modem. Nothing to do with the OS.

Windows uses \r\n as its line terminators, but when you talk to a
modem, you use \r.



-- 
Richard Quadling
Twitter : EE : Zend : PHPDoc : Fantasy Shopper
@RQuadling : e-e.com/M_248814.html : bit.ly/9O8vFY : bit.ly/lFnVea :
fan.sh/6/370

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] problem with sending AT command in php

2011-11-15 Thread Mike Mackintosh


On Nov 15, 2011, at 8:25, Richard Quadling rquadl...@gmail.com wrote:

 On 15 November 2011 11:50, a dehqan dehqa...@gmail.com wrote:
 \n is for Linux
 \r is for Windows
 
 On 11/14/11, Richard Quadling rquadl...@gmail.com wrote:
 On 12 November 2011 20:02, a dehqan dehqa...@gmail.com wrote:
 dio_write($handle, 'AT')  dio_write($handle, AT) make firefox times out
 on Waiting for localhost ... .
 But dio_write($handle, AT\n) makes it prints AT exactly the same command
 or  A  A , ..
 
 On Sat, Nov 12, 2011 at 10:02 PM, Negin Nickparsa
 nickpa...@gmail.comwrote:
 
 are you sure about ATD03518726535\n?
 
  can you try if ( dio_write($handle, 'AT') )?
 
 
 
 Don't use \n, use \r.
 
 http://en.wikipedia.org/wiki/AT_commands#Example_session
 
 
 
 --
 Richard Quadling
 Twitter : EE : Zend : PHPDoc : Fantasy Shopper
 @RQuadling : e-e.com/M_248814.html : bit.ly/9O8vFY : bit.ly/lFnVea :
 fan.sh/6/370
 
 
 
 No, \r is the requirement of the modem. Nothing to do with the OS.
 
 Windows uses \r\n as its line terminators, but when you talk to a
 modem, you use \r.
 
 
 
 -- 
 Richard Quadling
 Twitter : EE : Zend : PHPDoc : Fantasy Shopper
 @RQuadling : e-e.com/M_248814.html : bit.ly/9O8vFY : bit.ly/lFnVea :
 fan.sh/6/370
 
 -- 
 PHP General Mailing List (http://www.php.net/)
 To unsubscribe, visit: http://www.php.net/unsub.php
 


I've had better luck with PHP_EOL instead of \r or \n.
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] problem with sending AT command in php

2011-11-15 Thread Richard Quadling
On 15 November 2011 15:12, Mike Mackintosh
mike.mackint...@angrystatic.com wrote:


 On Nov 15, 2011, at 8:25, Richard Quadling rquadl...@gmail.com wrote:

 On 15 November 2011 11:50, a dehqan dehqa...@gmail.com wrote:
 \n is for Linux
 \r is for Windows

 On 11/14/11, Richard Quadling rquadl...@gmail.com wrote:
 On 12 November 2011 20:02, a dehqan dehqa...@gmail.com wrote:
 dio_write($handle, 'AT')  dio_write($handle, AT) make firefox times out
 on Waiting for localhost ... .
 But dio_write($handle, AT\n) makes it prints AT exactly the same command
 or  A  A , ..

 On Sat, Nov 12, 2011 at 10:02 PM, Negin Nickparsa
 nickpa...@gmail.comwrote:

 are you sure about ATD03518726535\n?

  can you try if ( dio_write($handle, 'AT') )?



 Don't use \n, use \r.

 http://en.wikipedia.org/wiki/AT_commands#Example_session



 --
 Richard Quadling
 Twitter : EE : Zend : PHPDoc : Fantasy Shopper
 @RQuadling : e-e.com/M_248814.html : bit.ly/9O8vFY : bit.ly/lFnVea :
 fan.sh/6/370



 No, \r is the requirement of the modem. Nothing to do with the OS.

 Windows uses \r\n as its line terminators, but when you talk to a
 modem, you use \r.



 --
 Richard Quadling
 Twitter : EE : Zend : PHPDoc : Fantasy Shopper
 @RQuadling : e-e.com/M_248814.html : bit.ly/9O8vFY : bit.ly/lFnVea :
 fan.sh/6/370

 --
 PHP General Mailing List (http://www.php.net/)
 To unsubscribe, visit: http://www.php.net/unsub.php



 I've had better luck with PHP_EOL instead of \r or \n.

I think I've not explained myself properly.

The modem wants a carriage return. That is a \r.

It doesn't matter what OS you are on. If you don't send the right
string to the modem, then the modem won't process it properly.

If your OS maps \r to PHP_EOL, then, obviously PHP_EOL will be just
fine. But I would recommend ...

?php
define('CR', chr(13));
?



-- 
Richard Quadling
Twitter : EE : Zend : PHPDoc : Fantasy Shopper
@RQuadling : e-e.com/M_248814.html : bit.ly/9O8vFY : bit.ly/lFnVea :
fan.sh/6/370

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] problem with sending AT command in php

2011-11-14 Thread Richard Quadling
On 12 November 2011 20:02, a dehqan dehqa...@gmail.com wrote:
 dio_write($handle, 'AT')  dio_write($handle, AT) make firefox times out
 on Waiting for localhost ... .
 But dio_write($handle, AT\n) makes it prints AT exactly the same command
 or  A  A , ..

 On Sat, Nov 12, 2011 at 10:02 PM, Negin Nickparsa nickpa...@gmail.comwrote:

 are you sure about ATD03518726535\n?

  can you try if ( dio_write($handle, 'AT') )?



Don't use \n, use \r.

http://en.wikipedia.org/wiki/AT_commands#Example_session



-- 
Richard Quadling
Twitter : EE : Zend : PHPDoc : Fantasy Shopper
@RQuadling : e-e.com/M_248814.html : bit.ly/9O8vFY : bit.ly/lFnVea :
fan.sh/6/370

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] problem with sending AT command in php

2011-11-12 Thread Negin Nickparsa
are you sure about ATD03518726535\n?

 can you try if ( dio_write($handle, 'AT') )?


Re: [PHP] problem with sending AT command in php

2011-11-12 Thread a dehqan
dio_write($handle, 'AT')  dio_write($handle, AT) make firefox times out
on Waiting for localhost ... .
But dio_write($handle, AT\n) makes it prints AT exactly the same command
or  A  A , ..

On Sat, Nov 12, 2011 at 10:02 PM, Negin Nickparsa nickpa...@gmail.comwrote:

 are you sure about ATD03518726535\n?

  can you try if ( dio_write($handle, 'AT') )?