Friday, November 6, 2009

External GSM modem in Beagle board

My friend Tick just migrated 0xdroid to beagle-donut branch and then I go back to work on external GSM modem issue in Beagle board. This time I tried to connect two devices from my working Ubuntu machine via two USB cables. It becomes very easy to debug and trace the behaviour between GSM modem and Beagle board. I set up an ethernet bridge in Ubuntu machine (192.168.0.200) and two USB networks. One is to connect with NEO phone (192.168.0.202) and the other is to connect with Beagle board (192.168.0.201). All of these three devices can see each other. Therefore, I can use ssh or adb shell to control them.





GSM modem is a device "/dev/ttySAC0" in NEO GTA02 phone and I use netcat to make it be listened in port 4270. This modem becomes 192.168.0.202:4270 now. How to make Android to see it? I use a pty small program from OpenedHand. It's like a pseudo terminal and it can reads and writes to the socket. Running it can make GSM modem become a device "/dev/pts/0" in Android. After starting ril-daemon service, it would connect to GSM modem. Then, everything is like usual. We can camp to GSM network and can dial out a phone call.
I am going to close this issue and then file other issues about ril problems later.

Saturday, October 31, 2009

Download Bluetooth OBEX UI from CyanogenMod

I am very glad CyanogenMod use Bluetooth OBEX support in their new released ROM image "version 4.2.3.1". If you'd like to try this feature, you could flash with their Android image. Also, you can use CM updater to keep tracing with their works!

Monday, October 26, 2009

how to have OBEX function in Android?

Few months ago, I was working on porting openobex, obexpushd and obexftp in Android. They are using commands and I don't have any UI application to use. It's not that convenient for common users. My friend jserv sent me a link in September, then I found there is a Bluetooth UI application about OPUSH/FTP profiles from Aurora forum. Therefore, I started to work on it.

At first, we should prepare Android building environment and I am using Donut branch now. My target is Android Dev phone. I can build the images for this device and flash with my images successfully. If you are familiar with Android building environment, you can use my works as below:

(1) Android frameworks
base: http://android.git.kernel.org/?p=platform/frameworks/base.git;a=shortlog;h=refs/heads/donut
my work: http://androidobex.googlecode.com/files/0001-apply-Bluetooth-FTP-OPP-patch-from-aurora.patch

(2) Blueooth UI application patch from Aurora forum
base: https://www.codeaurora.org/gitweb/quic/la/?p=platform/packages/apps/Bluetooth.git;a=shortlog;h=refs/heads/donut_glazed
my work: http://androidobex.googlecode.com/files/0001-Modify-OBEX-received-file-path-to-sdcard-and-set-de.patch

(3) init.rc script patch
base: http://android.git.kernel.org/?p=platform/system/core.git;a=shortlog;h=refs/heads/donut
my work: http://androidobex.googlecode.com/files/0001-Add-obexd-and-obex-client-service.patch

(4) bluedroid patch
base: http://android.git.kernel.org/?p=platform/system/bluetooth.git;a=shortlog;h=refs/heads/donut
my work: http://androidobex.googlecode.com/files/0001-add-obexd-obex-client-service-start-and-stop.patch

(5) obexd (i use obexd-0.10 version)
http://gitorious.org/android-obex/obexd

(6) glib (i use glib-2.13.0 version)
http://gitorious.org/android-obex/glib

(7) bluez patch
base: http://android.git.kernel.org/?p=platform/external/bluez.git;a=shortlog;h=refs/heads/donut
from aurora: https://www.codeaurora.org/gitweb/quic/la/?p=platform/external/bluez.git;a=commit;h=c2fdca9be6ac9625c229728d83c9ca3b26b64bba

(8) openobex (i use openobex version 1.5)
http://gitorious.org/android-obex/openobex

Sunday, October 25, 2009

Android Bluetooth UI application from Aurora

Finally, I can use a friendly UI application in Android and it allows to use Bluetooth OPUSH/FTP profiles. I was working on porting obexd and merged some patches from Aurora forum to Donut tree. Here is a discussion in 0xlab-devel mailing list about OBEX integration in 0xdroid.

How is this Bluetooth UI application and what I can do? let's check some screen shots! Some examples between my nokia N73 phone and Android Dev phone.

Connect to other Bluetooth devices from G1
* scan nearby devices from Remote tab
* pair with it
* connect to it



Pull file from other Bluetooth device from G1
* explore file manager from Remote tab
* download an image file
* open it from Local tab



Push file from G1 to other Bluetooth device
* open Local tab
* choose a file
* send it out



Receive a vcard from other Bluetooth device to G1
* bluetooth authorize dialog
* accept a *.vcf file?
* press OK, it would store to Contact
* open Contact




Receive a mp3 file from other Bluetooth device to G1
* bluetooth authorize dialog
* accept a *.mp3 file?
* press OK, it would store to sdcard
* open Music


Sunday, September 13, 2009

Android Bluetooth Introduction

Check out this SlideShare Presentation :)

Tuesday, September 8, 2009

Android ROM images from community

When I got the Android Dev phone, I download the official Android images from HTC site. Sometimes I build some packages myself, then upload them to ADP. Yesterday, I started to try Android images from community. I am so surprised that I can see so many different and versatile images. Their images are even based on the newest Android code. jserv gave me a link that someone is using my work "android obex" in their Android images about two weeks ago, but I didn't figure it out. I was trying to find out how HTC HERO users can get root access and how I can flash Android images from community. I tried to flash about 5 different images and played all day long. Too interesting to quit...:D

Here is a very detailed table chart and it shows kinds of Android images. I can pick one based on its status, like kernel version, WiFi or BT status, what input method, or application status....etc.

The first image I tried is from CyanogenMod. I downloaded this image file and push it to /sdcard in ADP. We can enter into 'Recovery' mode to update this image.

I also found there is 'cyanogen-updater' application in Android Market. I can install it in ADP and then I can update with their newest image version. It can download ROM image and update it in Recovery mode automatically. After rebooting it, I found it has bluez utils and my obex stuff inside. It means users needn't download hidd, hcitool, or those binary files, and they needn't build those stuff themselves either. I think that is better for normal and common users. Some of my friends, they don't even know what Android phone is, but they know how to use Facebook, how to use Internet. If they buy an Android phone someday, they can use this application to flash image without pain or tears. How cool it is!

Furthermore, I found Chinese Input mothod in another Android image. It's my first time to try this HTC Chinese input method. I used handwriting method to write words and it's pretty good to use. It can recognize all my writings. I thought I would need a cell phone with qwerty keyboard, but now I think that I can use touch input as well. XD

Sunday, September 6, 2009

Android emulator + external GSM modem

Recently, I am working on this issue 'Use GTA02 GSM Passthrough mode as external Android GSM modem' and the goal is to use Beagle board as a platform. Since we are still using cupcake in beagle board, I choose to use Android emulator with latest donut in the beginning. When we have donut image in beagle board, i will switch it on that time.

In Android emulator, it would use a qemud socket as GSM modem and it can simulate GSM network. Like camp to GSM base station (Android 3G :P), receive incoming call, dial out a phone call, has a simulated SIM Card, send SMS messages....etc. In my previous article about tracing RIL, I tried to run two emulators and made a phone call to each other. It's pretty fun, coz it can simulate real GSM network.

But it's still a fake one, not real GSM network, it doesn't camp to the nearby network like your mobile does. Therefore..... I changed few lines and made Android emulator to run an external GSM modem. Here is my experiment!



rild: allow it to use other GSM device in qemu

diff --git a/rild/rild.c b/rild/rild.c
index 14a6ea9..bd91314 100644
--- a/rild/rild.c
+++ b/rild/rild.c
@@ -161,7 +161,7 @@ int main(int argc, char **argv)
}
close(fd);

- if (strstr(buffer, "android.qemud=") != NULL)
+ if (strstr(buffer, "android.qemud=") == NULL)
{
/* the qemud daemon is launched after rild, so
* give it some time to create its GSM socket


Modify rild lib argument and change device name

diff --git a/target/board/generic/system.prop b/target/board/generic/system.prop
index f2424c9..1b84596 100644
--- a/target/board/generic/system.prop
+++ b/target/board/generic/system.prop
@@ -3,4 +3,4 @@
#

rild.libpath=/system/lib/libreference-ril.so
-rild.libargs=-d /dev/ttyS0
+rild.libargs=-d /dev/ttyS2


GTA02 NEO phone

erin@daydreamer:~$ sudo ifconfig usb0 192.168.0.200
erin@daydreamer:~$ ssh root@192.168.0.202
root@om-gta02:~# echo 1 > /sys/devices/platform/neo1973-pm-gsm.0/power_on
root@om-gta02:~# echo ate1 | ./tickminicom
root@om-gta02:~# nc -l -p 4270 < /dev/ttySAC0 > /dev/ttySAC0 &

PS. tickminicom is here

Running pty in host machine

# ./pty 192.168.0.202 4270

PS.1 where is pty? how do I know it? it's from Thomas! I was co-working with him about gsmd and dialer UI in 2007.

Running emulator with serial port option

erin@daydreamer:~/android/mydroid_emu/out$ ./host/linux-x86/bin/emulator -system ./target/product/generic/system.img -sysdir ./target/product/generic/system -data ./target/product/generic/userdata.img -kernel ../prebuilt/android-arm/kernel/kernel-qemu -ramdisk ./target/product/generic/ramdisk.img -qemu -serial /dev/pts/2


Cannot receive any incoming call
I was stuck on this case and it would send hangup command to any incoming calls without any notification UI. I found this issue is a known one and we can set 'Settings.Secure.DEVICE_PROVISIONED' to 1. Then no problem now.

What it can do now?
* Camp to GSM network
* Dial out a phone call
* Receive an incoming call
* Send SMS
* Receive SMS