Darshan
Darshan

Reputation: 1018

Implementation of Android on Raspberry-Pi

am working on a project where i run Raspberry Pi on Android(Gingerbread), what we are trying to do in this project is that we take readings(teperature and light) from a Zigbee(pikkerton) device,the Zigbee device sends the data to a dongle which is plugged in to raspberry pi, we should read the values on raspberry pi via dongle and display it on Android

  1. we have successfully installed Android OS on Raspberry pi, connect the output from raspberry pi on to a monitor and control it via mouse and Keyboard.
  2. we are developing the code in NDK(an App which reads the values from dongle and displays the same).
  3. Need some inputs on methods from which we can establish serial communication between the zigbee dongle and raspberry pi via NDK

Upvotes: 3

Views: 1931

Answers (1)

Chris Stratton
Chris Stratton

Reputation: 40397

It sounds like your dongle provides a serial interface, so you have two broad types of choices:

1. You can let a linux-level driver create a serial interface

You will need to have whatever creates the serial device (/dev/ttyUSB0 or /dev/ttyACM0 or the like) set the permissions to allow all users access. Or you can set the permissions to allow only access to a hard-coded unix-level user group id, and modify your Android installation to add a new android permission which results in membership of the app's userid in that unix group so that it can access the port. (See how Internet and External Storage permissions are handled for an example of doing this in a way any app can utilize, or how the radio device is handled for a restricted example) You then use normal linux serial APIs to access the port from your NDK code, or Java serial APIs to do so from Java code.

2. You can disable any linux-level driver, and talk to the raw USB device from Android application code

First check if the release of Android you are using has the USB host APIs; if not you will need to upgrade it first. This method will require less customization of Android, but may require more understanding of the actual USB communication with the dongle. However you will likely be able to track down example code for talking to similar devices from an Android app.

Upvotes: 2

Related Questions