Android: RS232 Serial Communication with android device
Asked Answered
D

2

11

I have a MR400s taximeter hardware. I want to communicate with this taximeter using RS232 cable and I have already achieved this connection and communication in windows. But I wanted to make connection using android device.

How can I achieve this?

Thanks Ishan jain

Disaccord answered 20/10, 2014 at 11:14 Comment(4)
I am not sure if this will help but I've found this library, hopefully this will helpPotter
Actually I have already seen this library but it requires root access. But I cannot provide root access to my tablet.Disaccord
what kind of data you want to transfer from android app to your RS232 cable ?Histone
hexa-decimal message codes e.g."0xf1 0xe2 0xc4 0x02" which gives hexa-decimal msg response. By decoding these messages we can get the status of meter (hire or vacant) etc.Disaccord
Z
9

I use the USB to serial library, you can find it here: USB Serial for Android. It doesn't require any root access. You'll need to check if your Android device supports USB host mode. Then, using a usb OTG cable and a USB to serial adapter cable you can start communicating with your serial device via RS232. There are code examples to get you started on the Github page of the USB to Serial library.

Zashin answered 2/2, 2015 at 9:16 Comment(0)
M
0

An alternative to a cable connection to the Android device (using the "USB Serial for Android" library, see the other answer) is a converter from RS232 to Bluetooth.

Such a converter will use the serial connection profile of Bluetooth, and ways access such a connection in Android are discussed in this question.

You can build such a converter based on an Arduino by adding a Bluetooth shield and simple code that converts incoming data from the serial port to outgoing data on the Bluetooth connection. (I could not find detailed instructions for this right now.) When you want to connect the Arduino's serial port to a RS232 device you would need another shield for logic level conversion (RS232 is ±12 V, Arduino is 5 V or 3.3 V).

There is also a commercial product implementing this Photologic Text Streamer (ca. 265 USD !!!). It seems that this provides a read-only connection for Android (not totally sure about that, though). A read-only connection is still ok for cases where you only want to read sensor values.

Finally, you could do a similar thing using an Arduino and a wifi shield.

Mick answered 7/4, 2019 at 20:16 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.