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.

没有评论: