Hayes AT command support on Android - android

A current product I work on supports standard modem AT commands over the serial link. Commands such as ATD, ATH, ATV, ATQ ATE etc to either get information from the device or seti info on the device.
The device also supports dial-up PPP connection which is typically preceded by some AT commands when initiated from the PC - ATD for e.g.
We are looking at creating a similar device using Android and I searched whether Android or Linux support Hayes modem AT commands over the serial interface such as RS232 or USB and am unable to find such a layer or component.
On Android RIL page I see it says that, "Android provides a reference Vendor RIL, using the Hayes AT command set, that you can use as a quick start for telephony testing and a guide for commercial vendor RILs". But I believe this may be for interfacing with the Baseband or Telephony layer. Is this also typically used with the serial interface where a DTE can issue AT commands and talk to the Android device ?
I also researched Linux and it does have a basic set of AT commands but they are not modem related and serve a different purpose - e.g. atq lists the user's pending jobs, atrm deletes jobs, identified by their job number.
So I am looking to undestand, whether Android or the Linux kernel has a default AT command parser which supports the Hayes AT Command set, which can be accessed by a DTE connected to the Android device over a serial link.
I think this is a typical case for phones and other may have come across the same question or issue, but I have not found an answer searching on the Android forums.
adding more info to clarify my question as it seems from the answers, it wasnt very clear what I was asking
To clarify my question, I am not trying to issue AT commands from the Android phone. Rather I am looking to issue AT commands from a PC to an Android phone over a serial link such as RS232/USB/Bluetooth.
I am trying to understand if Android inherently supports AT commands and has an AT parser ?
For e.g. to establish a PPP link (dial-up connection) from Windows to a device that supports PPP, windows will first send some AT commands and finally the ATD (dial) command. The device responds with a CONNECT response, afterwhich it switches to online mode and a PPP link is established and IP data cab be sent between the PC and the device. Thus typically such devices (modems) by default are in AT mode. ATD is just one such command. There are several other AT commands supported by the device.
Now to develop a similar device using Android, I'd like to do that without significantly altering the Linux kernel or Andorid architecture and am looking to understand if a AT command parser which recognizes the standard set of AT commands is inhenrently supported by android.
To make my question clearer, consider the case where a PC for e.g. connects to a device (phone) using the BT DUNS (dialup networking) profile. The DUNS profile requires the phone to support i.e. parse and recognize certain AT commands such as AT&C, &D, &F, +GCAP, +GMI, +GMM, +GMR, ATA, D, E, H, L, M etc.
How does Android address this ? Does it have native support for reconizing and responding to such AT commands ?
thanks in advance!

If I understood you correctly you like to send AT-commands via a serial communication from an Android device to your hardware - and get the responses back.
Basically one would implement a serial communication either via Bluetooth - or starting with level 12 using USB communication.
I have done quite extensive serial communication in both ways it it works quite well. The main problem so far has been that while Bluetooth serial-Adapters are quite expensive - the new USB-serial communication has flaws on certain devices.
The last time I tested Samsung Galaxy Tab, the USB driver's were not functional. On some other Android device there were no USB-drivers at all installed.
But once you have a working Android device serial communication (with or without using AT-commands) works fine
For more info you might like to check http://developer.android.com/guide/topics/usb/host.html

On linux, there's the chat command, which was typically used by the pppd demon. Then there's the classical TCL expect, which allows scripting. It has been ported to many languages, eg expect for Java, Python expect. I haven't used the latter two, but it looks as if you can use them as a library and don't have to call them as external programs.
It's a curious thing that the most advanced mobile phones still use the archaic Hayes AT command set instead of a proper API..

Related

Connecting android app with application on a pc

I am currently trying to write an android App that is connected to a application running on a pc (even though windows is preferred linux would be ok, too) via either USB or Bluetooth. Right now I'm not really sure how far this is possible. As far as I understand the USB Android API, I can not really use USB to talk to another application. Only raw file exchange seems to be possible. The Bluetooth idea seems a lot more feasible as I see it. I'd write a bluetooth server for the PC and connect to it via a Bluetooth client written via Android API. Point is, is that possible with windows? Has anyone seen any examples for what I am looking for? All I can find for USB is teethering which is not what I want.
There are android applications which allow you to use your mobile's touchscreen act like a touch pad which can be used to control your pc or laptop via bluetooth or wifi connection just like you are using your laptop's touch pad. PremoteDroid, RemoteDroid, Gmote etc.. to name a few (or only these are available i guess!).
But to do so you also need to develop a server application which will run on the device you wish to control and help u make connection between your mobile and the device. I have used PremoteDroid and RemoteDroid and they both work well on my laptop which runs windows 7. You can even add keyboard functionality.
PremoteDroid is openly available here: http://code.google.com/p/premotedroid/
I have a Bluetooth server application on my Mac that I use to test an Android app I'm writing. The app will eventually be used to communicate with a device with a microcontroller and bluetooth modem, but I needed a way to test the app in the absence of that device. The server app is written in Java, so I think it should work on a PC (and almost certainly in Linux).
I'm happy to share the code with you--I found it somewhere on the Internet (though I can't seem to figure out where now) and modified it as I needed to. It uses the BlueCove library, and is only about 60 lines, including several imports (and the code I commented out but didn't bother deleting :). I also have a Bluetooth client program on my Mac, since my app also has server functionality.
I have never tried to do anything like this using USB.

controlling Embedded system from MOBILE. ANDROID or iOS? suggestions and explanations please

As a part of feasibly study. I need to choose between Android or iOS for integrating it with an embedded system.
Basically, that embedded system will have an AVR or a PIC Microcontroller. I want to establish a communication between a mobile and that particular system.
Need some wireless technology for communication (bluetooth,wifi,internet etc..)
Micro Controllers have communication ports like UART, USART etc..
It really depends on the kind of communication you need.
I particular, if you have a normal WIFI connection and your controller can work with receiving & sending your data via wifi, you may go iOS or Android.
If however you need some kind of free format serial communication, you need to go Android, serial cable via USB.
recarding other factors, I guess it really is just a personal taste issue.
Could you give more info on how & what needs to be communicated and what kind of communication device you have between your phone and the device itself.
Not sure if this is similar to what you have in minde, but you might look at this: http://www.arduino.cc/ being probably the best known example in this context.
Using some serial to bluetooth module would be the most easier to implement.
I would go with Android unless your target audience are photographers. Seriously. Also, with iOS you need to be careful. For instance you want to use BlueTooth, but not all iOS devices will connect to, say, the Bluetooth protocol for a keyboard. (Ah! You didn't know there were more then one Bluetooth protocol did you?) And I don't think any iOS device will let you connect using the Bluetooth serial port protocol.
With Android you can jump in and start flying immediately by using the (or a copy of) the PIC 24F based IOIO board. And if you are an Android / Eclipse developer (I think) you can down load and use the IOIO JAVA / Android libraries. I have been told this makes programming the IOIO board just about as easy as programming an Arduino. Especially if you are well versed in JAVA, Android and the Eclipse editor. Add to this the IOIO board can be a host to the Android (i.e. connected by wired USB) or host to some Bluetooth modules (i.e. connect to the Andoid's bluetooth radio).
If you don't want to go it along you can buy the Microchip Android Development Kit (ADK) board which is also a PIC 24F based "USB wired" using AOA protocol to connect to an Android. I say "not going it alone" as I would expect you can then get limited support from Microchip w.r.t. their hardware (the ADK board), software (Android) and firmware (PIC ADk board). This solution, however, does not have built in Bluetooth support. I am guessing you can add it, it's just not part of the ADK software/firmware that Microchip put together.

Android mobile as a GSM modem?

Is it possible to use an Android mobile device as a GSM modem?
I have been working with GSM modems for several years. I am developing apps under .net to make data calls, send/reieve SMSs and so on, i used normal GSM modems so far, not mobiles.
Now I'd like to connect some android devices via USB to my PC and use it as a GSM modem, communicate with it via standard AT commands.
Is there any kind of driver/app/etc to handle it? It would be nice to communicate with it via RS232.
Thanks!
Environment: Windows XP/Windows 7
Mobile to test: Sony Ericsson Xperia Mini
I honestly don't know a straight answer to your question, but I would recommend perusing the docs on USB to see what data/info you can transfer.
http://developer.android.com/reference/android/hardware/usb/package-summary.html
With what you're wanting, though, you'd also need to develop your own desktop app. You may be able to use ADB/shell to communicate. Phones may also need to be rooted for it, depending on how much control you want.
Drivers required would be the device manufacturer's USB drivers, if any were needed (which they are for ADB/Shell).
I have found very helpful what I want in my application. Following android application today I have found and worked for me.
It gives the two APIs through JSON. First for sending SMS and second for receiving SMS in my Server side programming language.
https://play.google.com/store/apps/details?id=com.gsmmodem

How to communicate with a USB device from Android tablet?

From a year ago, Is there a way to communicate with USB devices on Android? this didn't look like a common requirement, but tablets have evolved, and hopefully, the OS has, as well.
I need to operate a simple USB relay card from my Curtis LT8025 tablet, currently running 2.1 patched.
I'm also a newcomer to both Android and java, so relatively clueless!
No need for bi-directional communication, just a simple serial command out to the device.
Any suggestions?
Thanks!
Dave
Sadly, there is currently no standard API to achieve wired communication with Android devices. I was facing a similar issue a while back (see Android: Communicating with a USB device which acts as host ).
I was able to successfully implement the solution provided by CommonsWare. Leave a comment if you need more help regarding this and I can provide details.
Edit (more details) -
Basically, I narrowed down to two possible solutions for this problem:
Modify the Android source itself to include custom drivers for whatever purpose you need and install this in your tablet. Since its mostly based on Linux, if you develop the drivers for Linux, the same can be used in Android with a little modification. This solution is simpler to develop, but not practical commercially if you are not providing the tablet/phone yourself.
Make your USB device act as an host and implement the ADB driver/command-set in your device. When connected, you can issue "adb forward" to forward tcp ports so you can interact with your Android apps and have two way communication between the device and the app.
I used the second method and it works flawlessly. But its only practical if you are making USB host devices. for USB slaves, first method is the only way I recon.
If you are using a serial device and have the ability to talk to it over native serial, you might want to consider IOIO (see http://ytai-mer.blogspot.com/2011/04/meet-ioio-io-for-android.html for more details).
I'm building an Android custom system. I did connect several devices on the USB. I looked to connect a device on the OTG port, the one that usually gets out of a tablet on which you use ADB. I gave up. This is a nightmare. I don't think you can use ADB on the OTG USB that is currently a device and expect to be able to use another device like a USB to serial converter. That means that you loose the whole ADB toolchain for debugging when you want to use the port as a host. On top of that, the USB OTG drivers you have for your tablet was probably not very well tested in host mode since it's not really used that way. So lots of headakes.
The simple way that I found was to use the second USB port on the CPU. This one is a plain HOST port (unfortunately limited to 12 Mbit/s). Unfortunately, I don't know if there are any tablet out there with 2 USB port available from outside (One OTG and one host).
If you get a set-up with two USB port (one HOST) then it's possible to compile as a module (drivername.ko), a usb to serial converter. There are several chipset supported in the kernel source tree and I already used a few of them and it works.
hope this bit of info is helpful.

Serial port on an APAD - where to discuss this?

I've got an application that is written in Java and which talks to a device using virtual serial port (ie a USB CDC ACM device). Currently it runs an a PC (Windows/Linux/Mac OS X),
but it would be a perfect match to be able to port this to a cheap tablet PC to create a stand alone system.
I've been googling for hours now and it seems quite a lot of people are interested in this sort of thin (no surprise there) and some have managed, but I've not found a good match for what I'm looking for or a good place to discuss this.
I'm looking at something like this:
http://www.prlog.org/10776061-101-inch-android-ipad-android-google-mid-tablet-pc.html
I would like to discuss the following:
This says that it supports USB host so it should be doable, eh?
Android is a kind of Linux so I should be able to use a serial dongle there, right?
Has Android got drivers so that I could just plug in a serial port dongle and open it as /dev/tty?
Would the above quoted APAD be usable as a development platform ?
So where would be a best place to discuss this?
br Kusti
To keep this at least partly programming-related: If your application has a GUI, moving to Android is not going to be a load-it-and-go effort. Android has a very different application structure that you're used to and doesn't have Swing (if that's what you're using) or any GUI toolkits other than its own.
On your USB problem: There is support for a few USB-to-RS232C adapters in the stock kernel, but there are a bunch of practical reasons not to use it. Most involve limiting yourself to devices that support host mode, cabling and powering the Android device and the serial adapter. You might be better off using a Bluetooth-to-RS232 adapter on your serial device, which would allow your app to run on a wider variety of devices and gets you the bonus feature of being wireless to put in your marketing material.
I just ported the RXTX library to the Android. Unfortunately I had to fork it to accomodate for different layout of the android projects. More details are here http://v-lad.org/projects/gnu.io.android/
You need to have a device that supports host USB mode. Also the kernel on the device has to support the USB to Serial converter or you have to recompile the kernel yourslef.

Categories

Resources