Go Down

Topic: 'stty - F /dev/ttyUSB0 -hupcl' doesn't work in php (Read 2042 times) previous topic - next topic


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)?



Feb 01, 2009, 04:48 am Last Edit: Feb 01, 2009, 09:04 pm by gnu_linux Reason: 1
An alternative would be to use a modern device / wulfden BBB Rev C without autoreset


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


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 :)


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


Feb 01, 2009, 09:09 pm Last Edit: Feb 01, 2009, 09:11 pm by gnu_linux Reason: 1
Thanks Anachrocomputer you can see a lot better than I can :)

The correct command is

Code: [Select]

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


Go Up

Please enter a valid email to subscribe

Confirm your email address

We need to confirm your email address.
To complete the subscription, please click the link in the email we just sent you.

Thank you for subscribing!

via Egeo 16
Torino, 10131