Android Question Android 4 and RS232

jarda

Member
Licensed User
Longtime User
Hi

I have an industrial facility with Android 4 and RS232 ports (/ tty1, / tty2 and under). Does anyone have experience with this port to communicate?

BT device is not. Only physical connectors RS232 (Rx, Tx, GND) type DB9.

How do I get started with programming in communication B4A? Send a Hello World :)
(RS232 has no MAC address when I want to use Serial)
 
Last edited:

Beja

Expert
Licensed User
Longtime User
Hi,
You can still use bluetooth unless you really don't want it.. even if the industrial device has no bt there's an adapter to fix that. BT <> RS232
Wireless and more convenient.
If you need specific help let me know.
 
Upvote 0

jarda

Member
Licensed User
Longtime User
The device does not have Bluetooth. So there is no MAC address. It has only COM1 and COM2 under

So I can not use Bluetooth

something like

ser = OpenSerial ("COM1")

ser.Setting ("9600,8, N, 1")

ser.SendData ("Hello")
 
Upvote 0

Picena Informatica

Active Member
Licensed User
Longtime User
You can use a Bt-RS232 dongle. Otherwise an Usb-Rs232 dongle if the tablet has an Usb host port.
 
Upvote 0

Beja

Expert
Licensed User
Longtime User
As I said in the second post, since you have a serial port (RS232, RS485...etc.. then you can still use BT by using an adapter
BT <-> RS232. my controller has no BT but I still use the Android device to send / receive BT information, that will later be translated
by the adapter, completely transparent to you.
 
Upvote 0

Beja

Expert
Licensed User
Longtime User
You wouldn't need to change anything in your code, because you are talking to the Bluetooth side of the adapter, and not to your controller directly.
That means you can use, for testing, the Bluetooth example and BT chat example without ANY modification.

E.g. the the SEND part should look something like this:

Sub btnSend_Click
Dim txtToSend As String
txtToSend = "This is a test string to be sent by way of Bluetooth"
AStream.Write(txtToSend.GetBytes("UTF8"))
End Sub
 
Upvote 0
Top