Php Sending Data to Serial Port Problem In Linıux

Links for php scripts

Moderators: egami, macek, gesf

Post Reply
Mustafa
New php-forum User
New php-forum User
Posts: 5
Joined: Sat Mar 25, 2017 10:51 am

Sat Mar 25, 2017 10:55 am

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

User avatar
hyper
php-forum Fan User
php-forum Fan User
Posts: 583
Joined: Mon Feb 22, 2016 5:52 pm

Sun Mar 26, 2017 7:34 am

Is
" echo -ne 'hello' > /dev/ttymxc0 "
The name of a file?

How do you expect the output to appear?

Mustafa
New php-forum User
New php-forum User
Posts: 5
Joined: Sat Mar 25, 2017 10:51 am

Sun Mar 26, 2017 11:00 am

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

Post Reply