Pages: [1]   Go Down
Author Topic: 'stty - F /dev/ttyUSB0 -hupcl' doesn't work in php  (Read 1398 times)
0 Members and 1 Guest are viewing this topic.
0
Offline Offline
Jr. Member
**
Karma: 0
Posts: 66
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

I want to disable DTR (to avoid Arduino 10k autoreset) so I added the following code in php code to get this:

exec ("stty - F /dev/ttyUSB0 -hupcl'";

But it doesn't work: autoreset still works.

How I could disable DTR correctly via software (I use PHP)?

Thanks
Logged

0
Offline Offline
Sr. Member
****
Karma: 0
Posts: 430
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

An alternative would be to use a modern device / wulfden BBB Rev C without autoreset

http://wulfden.org/TheShoppe/freeduino/bbb.shtml

The BBB Rev C kit sells for $13 and $2 shipping

You may also need a P4B RS232 to TTL adapter ( $5 ), or a BUB USB adapter ( $13 ), or an FTDI cable ( $20 ), if you don't already have one

http://moderndevice.com/index.shtml

Or you can build your own RS232 to TTL adapter from parts

"stty -F /dev/ttyUSB0 -hupcl" might work if you put it in an init script

If it doesn't work on USB try a real RS232 port with an RS232 to TTL adapter

Good luck smiley
« Last Edit: February 01, 2009, 03:04:26 pm by gnu_linux » Logged

Bristol, UK
Offline Offline
Edison Member
*
Karma: 1
Posts: 1197
Exhibitor at UK Maker Faire
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

You have a space between the '-' and the 'F' in that code.  Is that intentional?  Doesn't look right to me...
Logged

0
Offline Offline
Sr. Member
****
Karma: 0
Posts: 430
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Thanks Anachrocomputer you can see a lot better than I can smiley

The correct command is

Code:
stty -F /dev/ttyUSB0 -hupcl

You should probably put it in an init script, however it may still not work

The user running the script must have the appropriate permissions to access /dev/ttyUSB0

/dev/ttyUSB0 is usually owner root and group uucp if you followed the arduino instructions

I still think you will probably get better results using a BBB Rev C where you can control autoreset in hardware

smiley
« Last Edit: February 01, 2009, 03:11:35 pm by gnu_linux » Logged

Pages: [1]   Go Up
Jump to: