tarecha / php-serial

Automatically exported from code.google.com/p/php-serial
0 stars 0 forks source link

how to store each raw data received from $serial->readPort() #17

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
Now, I am able to send and receive data serially from arduino to raspberry pi 
and vice versa. 
one more thing I notice is.
I am sending  [Carriage Return(CR) character(0x0D)] [LineFeed(LF) 
character(0x0A)] after the string as shown in attached pic(serialrawdata.png),
but it shows [0x0A][0x0A] in serialphp as shown in pic(phpoutput.png)

I am facing another problem.
I am sending raw data from arduino to raspberry pi.
all regular char ( A to Z , a to z , 0 to 9 ) can be received normally in $read 
= $serial->readPort();
problem is when arduino sends 0x7F , one char is being deleted from $read.
I need to store each raw data.
how to solve this problem..?

Original issue reported on code.google.com by 143.mahe...@gmail.com on 13 Mar 2013 at 5:00

Attachments:

GoogleCodeExporter commented 9 years ago
If you haven't already, look at issue 16.  

I have had similar issues and were able to solve them by using setting the port 
to the raw state using stty.  'stty -F /dev/portToSetup raw' 

See stty man for more info.  

I realize this post is nearly a year old but others may find this useful.

Original comment by justcarr...@gmail.com on 29 Dec 2013 at 2:20