Page 1 of 1

Php Sending Data to Serial Port Problem In Linıux

Posted: Sat Mar 25, 2017 10:55 am
by Mustafa
Hello guys;

I have a little problem on PHP , I need to send some datas to the serial port with php in linux .

I m using this ;

exec (" echo -ne 'hello' > /dev/ttymxc0 ");

it is okey but I can't see anything on my console . After I write ;

echo -ne 'World ' > /dev/ttymxc0

the output is like ;

Worldhellohello

Can you give me any advise or do you have suggestion about that? what should I have to do ?

Thanks...

Best Regards
Mustafa

Re: Php Sending Data to Serial Port Problem In Linıux

Posted: Sun Mar 26, 2017 7:34 am
by hyper
Is
" echo -ne 'hello' > /dev/ttymxc0 "
The name of a file?

How do you expect the output to appear?

Re: Php Sending Data to Serial Port Problem In Linıux

Posted: Sun Mar 26, 2017 11:00 am
by Mustafa
It should be just hello
I made this code it s very very simple :D and It works ;

Code: Select all

<?php
$echo = ` echo 'hello' > /dev/ttymxcXX `;
echo $echo ;
?>
I hope it helps others ..

Thanks