K
K
Kirill Petrov2013-12-26 22:54:55
linux
Kirill Petrov, 2013-12-26 22:54:55

How to send data to Serial connection using php exec()?

I want to send the number 1 to a device with a Serial connection from php without unnecessary troubles.
Problem in the following:
From under Windows the following functions:
exec('echo 1 >> COM5;');
Started linux mint.
Slightly rewrote the code:
exec('echo 1 > /dev/ttyACM0;');
Does not work, I found out that this is due to lack of access to the device. Therefore, after
$ sudo chmod 777 /dev/ttyACM0
Everything starts working, until you reconnect the device. After the right stray again.
I want everything to work right away when the device is connected, and preferably without extra crutches.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
R
Rsa97, 2013-12-27
@Recosh

Add the www-data user to the dialer group

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question