Console Serial Port Communication

piersante

New Member
Licensed User
Longtime User
I use a cubieboard for some development and testings. I would like to use the embedded serial port connector for communication with my own electronic board. This serial port is used currently for console and debug messages. It works at 115.200 bps.

There is any way or library that allow the use of the console/debug channel for a bidirectional communication?
 

piersante

New Member
Licensed User
Longtime User
well... /dev/ttS0 is working but I need to solve some issues with permissions and linux console service that get the input. I'll try to found a solution. maybe a root system.

Inviato dal mio A500
 
Upvote 0

EvgenyB4A

Active Member
Licensed User
Longtime User
Which device are you using? What do you mean with mirrored?
I use the industrial Android tablet with Android 4.1 that has 4 Uarts. I connect UART0 to PC COM port and use the PC program UART Terminal. In Android I use the following code:

Dim fo As OutputStream
Dim fi As InputStream
fo = File.OpenOutput("/dev/ttyS0", "", False)
fi = File.OpenInput("/dev/ttyS0", "")

astreams.Initialize(fi,fo,"astreams") 'connect with asyncstream
...
Sub astreams_NewData (Buffer() As Byte)
Log("NewData")
Log(BytesToString(Buffer, 0, Buffer.Length, "UTF8"))
End Sub
...
Sub btnAction_Click
' astreams.Write("abcde".GetBytes("UTF8"))
File.WriteString("/dev/ttyS0", "","abcdefghklm" & CRLF)
End Sub
...
When I send from PC any string(assume "12345" & CRLF) I get it in astreams_NewData, but at the same time it appears in the Receive window of PC Uart Terminal as if Android sent it back. That I mean mirror effect and I want to avoid this.
Using the command File.WriteString("/dev/ttyS0", "","abcdefghklm" & CRLF) I successfully send any data from Android To PC.
 
Upvote 0
Top