2011年9月21日星期三

draft 2

I plan to do a project to transmit data from sensor and update the data to internet through android phone.

First, I need to check if the cellphone has the kernal to support for serial usb driver. If it doesn't have, I need to rebuild the kernel and may be recompile the shared library for my environment. If it has, I need to use the JAVACOMM(GNU RXTX)library to the android cellphone. RXTX native code will be the keypoint to solve this issue. I need to have a java library for the task to read data from serial port in Android. What is more important, I need to creat a java application which use this java library in order to read from the serial port(USB).

If there is no library, I will try to do one.

Here is the specific procedure:

1 do the programming of reading and writing serial port under linux, test it first
2 compile as library through NDK
3 use java to call the API of the library

Generally, I plan to use C to do operation of reading and writing the serial port in JNI, use gcc to compile to produce a so library and use upper level APK to call the so library and achieve serial communication.

If I succeed in receiving data from sensor, the second step is to setup a database to receive the data and upload the received data to internet. The data will be sent to internet periodically if it is used for supervised application like micro-climate scenario or send data immidiately when receiving any data such as parking lot. In the latter case, the received data in the serial port will trigger the uploading.

Another alternative is to use bluetooth to transmit data which is much faster. There are some cases use bluetooth serial converter which is also more practical. In this scenario, the problem is that the telosb do not have bluetooth device. But power of bluetooth is a big problem.

The third application I proposed is to use android to connect zigbee device. The device should use 802.15.4 USB dongle-jennic.



challenge:

1 get data from serial port
2 transmit and receive data through serial port in android environment
3 use the received data to trigger the uploading

device needed: I need a cellphone, telosb, and a serial<->usb converter.

2011年9月16日星期五

1st project draft of CSE 646 course

My target is to connect sensor to android cellphone and send data to cellphone which can connect to internet.

In the case of telosb, there is a usb interface. But I am not sure if it can use usb interface to transport the data. If it can't do so, using serial port to transmit data is very slow and need to update the mechanism. In the case of XSM, there is a converter of serial to USB, but it is a virtual devices which means the laptop also need serial terminal to communicate with XSM. I will do some study of serial communication including driver and hardware.

To the android terminal, first it need a super terminal for debugging. Secondly, it need the driver for android for the connection of usb and serial port. At last, android might need to allocate separate interrupt number.

In this project, the sensor will send data to the cellphone, so sensor should be a android USB accessory. It must adhere to Android accessory protocol. USB accessory and host modes are directly supported in Android 3.1 (API level 12) or newer platforms.

In the next week, I will learn how the sensor send data. I prefer to use telesb first and then try XSM. Then I will study the android open accessory development kit.