Here is a weird hardware setup that I have got from someone:
There is a receiver module that receives data wirelessly via some RF modulation. The module has a uart interface which it uses to send out the received data.
There is an Android tablet. The tablet has exposed a built-in uart connector. If we connect it to a PC's COM port, we can get the Linux console of the tablet (with console input working)
Now, the receiver module's uart is connected to the tablet's uart connector. Therefore, the received data will be sent to the console as input.
Here is the question: I would like to write an application (either native or dalvik-based), running on the tablet, to read the received data (which is being sent to the linux console as input). Can this be done?
I do not have the kernel source or binary, though I have the adb root access.
Related
I am trying to establish bluetooth communication between my computer and an application that I am developing, installed on an android tablet.
How can I send data from my computer to my application to check if the communication is successful?
I try to send files via bluetooth from windows bluetooth related settings, but I need to be able to send strings readable by my application
I have a need: Build a system that allows a offline terminal(it´s a PC) to connect to a server. to do this, we decided to upload the data to a android 3G smartphone and, by network, send the data to the server, retrieve the response and send to terminal. See the scheme below:
GOING
TERMINAL --(?)--> Android App --(HTTP)--> Server
BACK
Server -- (HTTP) --> Android App --(?)--> Terminal
We have some constraints:
1 - The terminal becomes locked until the android send the response from server (It´s a sync message)
2 - We have only text content.
3 - The place where the terminal is connected does not have network signal.
4 - We have to provide a minimum security level possible.
5 - The terminal app will be developed using PHP.
So, my question is: i have to connect the terminal to pc to send and retrieve information from a android phone. Should i use bluetooth or build a wi-fi network (with android phone built-in feature) to connect them?
Did someone have this problem?
I decided to use Bluetooth, because it's easier create a client-server app with bluetooth than develop a "Wi-fi point" programatically and the bluetooth dongle is cheaper than a wi-fi module in old computers.
I am working with the Android Bluetooth Chat sample application. I am trying to read serial data from the Android device in Windows 7.
I have been able to pair the Android device to the Bluetooth adapter on my laptop. I replaced the UUID in the sample application with the following per some other discussions:
private static final UUID MY_UUID = UUID.fromString("00001101-0000-1000-8000-00805F9B34FB");
When I run the Android application I am able to connect to the laptop. In the "Hardware" properties of my Android device there is a "Device Function" entry called "Standards Serial over Bluetooth link (COM10)". When I attempt to connect CoolTerm to COM10 I receive "error 1168" (there is no additional description for the error).
Am I misunderstanding something about the process of sending serial data via Bluetooth to a Windows com port?
Be sure that you are selecting the correct COM. In my last Android application that required SPP (Serial Port Profile) Bluetooth communication, when Windows 7 paired I had several COM's open up.
If COM10 is not working, verify that it is the "incoming" COM (or maybe it's outgoing, I can't remember b/c it's been a few months).
You have to use the proper Bluetooth API from your Windows application to call and connect to your Android device, that is:
do an 'Inquiry' of all nearby devices, discoverable and exposing an SPP service/profile (SPP=Serial Profile Protocole). This profile has the aforementioned GUID {00001101-0000-1000-8000-00805F9B34FB}
once all found, select the one you're searching for (either by Name or MacAdress)
at this point, you can do a 'Discovery' of its Services and check out that it has the proper service exposed (SPP or RFCOMM)
then connect to it, using the Bluetooth socket API...
I am trying to write an Android app using the USB host mode on a Motorola Xoom with Android version 3.1 (build HMJ37) using the new Android host USB APIs to communicate over USB with a device that uses a Silicon Labs CP2102 Virtual COM Port Interface (USB to serial bridge). I have been using the AdbTest application example from the Android developer's site as a guideline.
I have been having trouble reading characters sent in on the UART side of the CP2102. Single byte bulk transfers work fine, but not if I ask for more than 1 byte of data. I know the data is there because I can send a GET_COMM_STATUS command using USBDeviceConnection.controlTransfer() and see that there are characters in the InQueue buffer on the CP2102. However, when I request more than one byte from the In Endpoint either by using USBRequest.queue() (asynchronous) or the SBDeviceConnection.bulkTransfer() (synchronous) functions, the buffer that is returned contains invalid characters.
Here's what does work:
intent fires upon insertion and deletion of USB device
application starts, finds USB device, connections, interfaces, endpoints, and claims interface
can configure the CP2102 by sending USBDeviceConnection.controlTransfer()
commands
Characters are successfully transmitted out the UART side of the CP2102 by sending data to the Out Endpoint using USBRequest.queue().
Single characters (separated by time delays) coming in the UART side of the CP2102 are successfully read from the bulk transfer In Endpoint using either the synchronous or asynchronous commands.
Problems arise when I try to send characters in a streak. However, I am only sending data at 9600 baud on the UART side and am not sending so many characters that I fill up the buffer on the CP2102.
I am using the Xoom as the power source for the device. I get the same behavior on
two different XOOMs. I'm using the Motorola Camera Connection Kit for MOTOROLA XOOM as my USB host cable.
Can anyone give me guidelines on how to make this work? Or is the Honeycomb 3.1 USB host API on the XOOM not yet really stable?
make sure that you examine the returned bytes count, so you will not consume more data from the buffer than the actual returned data.
also check if more than one thread are accessing the buffer which may corrupt the returned data if access to buffer is not synchronized properly.
Is there some way I can send data from an Android device to a computer over Bluetooth?
Thanks
Yes. Perhaps the most straightforward way to get started would be to use the Bluetooth Chat example, which you will hopefully find in the Samples directory of your SDK installation, or can of course be downloaded from Google.
The Bluetooth Chat demonstrates exchanging bytes of data from one Android device to another over the Bluetooth Serial Port Profile (SPP).
To exchange data between the Android device and your computer, you could use a Bluetooth driver on your computer that provides you with a virtual COM port when a remote Bluetooth SPP device connects. This way, you could simply launch Bluetooth Chat on your Android device, and exchange data with something that reads and writes to a COM port on your computer. For example, on a Windows machine you could simply use HyperTerminal.
The Bluetooth Chat example is then an excellent base upon which to create your own custom Bluetooth Android application.