tty serial library

fabpalma

Member
Licensed User
Longtime User
Hello,

what about a serial library to open tty ports ? yes, normally on the Android devices we haven't this kind of ports BUT a library that can open a standard tty port can be used to connect an external device to tablet and allow the app to interact to external hardware.

Currently there is the Yoyo library that allow to communicate with a specific hardware (build with MicroChip PIC microcontroller with a real USB port).

Other library use BlueTooth communcation, but I don't have find anything to talk via serial port with an external device.

Ok, I have a device that have a FTDI chip that convert it's standard serial port into a USB port: normally I can connect it to my pc installing a FTDI driver that create a virtual serial port that I can open as a real serial port and talk to my device.

I have installed a FTDI driver to my tablet with Android 2.2 and I'm able to talk with it using the terminal, opening the virtual port ttyUSB and configuring the ttyUSB at 4800E81.

... BUT I cannot build an application with B4A to talk with my device :(

Question: it's very hard to derivate a ttySerialLibrary from the GPS Library (for example) that should use a special serial port to get data from internal or external GPS devices ?

I hope ....

Thanks.
Fabrizio.
 

fabpalma

Member
Licensed User
Longtime User
Erel said:
This project seems to concentrate on HTC devices so I'm not sure that it will be too useful for many users.

agraham said:
That code appears to need the phone to be rooted and a new re-configured Linux kernel installed. It also appears to be HTC specific. See the wiki entry...

I reread the instructions provided in the project site ... seems to me that we are talking about mobile specific qauanto regards the modified kernel that enables the serial that is normally used as a debugging or as a serial firmware upgrade serial as "standard" ...
I do not think you understand that the API that is installed depends heavily on the modified kernel.
I did download the source of the library - out - generates an APK file and saw that - of course - are the source in Java.
I saw that there are also some examples ....
The libraries used by your environment B4A are generated from Java code? If yes, what could be the reason why the code in this project can not work?

I, for my project, I had to ask to install a FTDI driver for my tablet because I know that was not present but instead the driver for the Prolific chip is present by default in the Linux kernel. E 'likely, although I have not tested that without installing drivers so I can open a terminal serial port created by the Prolific drivers and use the door.

And now the big question:
What would be the steps needed to add to B4A the possibility of opening a ... any device type "stream" that has a name just like a standard Linux serial port?

Thanks again for your answer .... in advance.....

Fab
 

fabpalma

Member
Licensed User
Longtime User
you could connect the PIC over a Bluethooth - chip
with the serial library.

like this (mini shuttle) :

Robotrack Elektronik - Projekte Live Webcam - Steuerung mit Server AVR Servo Relais

It is a class 1 BT-module and can used over 100 meters
and the big advantage is : no cable is needed.

Hello Heinz, I had already considered the possibility of using a bluetooth module but this forces me to add external hardware to my module and I wanted to avoid both problems of cost and of construction. That's why I tried the solution to the USB connection and with the kernel and the driver I was ok... but not with Android and B4A.
On some blog I read that Google is talking about this possibility for Android 3.1 as the great interest that is moving around Android to control external hardware ... I was hoping that the Java library that I find might be a good starting point for Erel to introduce serial port management in B4A but evidently not.
Thanks again.
Hello
Fab
 
Top