marco1957 / android-serialport-api

Automatically exported from code.google.com/p/android-serialport-api
0 stars 0 forks source link

can't serial port Native open return null #5

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. open prgram 
2. setup device
3. press console button
4  can't open serial can not be opened for an unknown reason

What is the expected output? What do you see instead?

What version of the product are you using? On what operating system?
android 2.2

Please provide any additional information below.

logcat debug
I/ActivityManager(  803): Starting activity: Intent { 
act=android.intent.action.MAIN cat=[android.intent.category.LAUNCHER] 
flg=0x10200000 cmp=android.serialport.samp}
I/dalvikvm(  803): Jit: resizing JitTable from 8192 to 16384
I/ActivityManager(  803): Displayed activity 
android.serialport.sample/.MainMenu: 136 ms (total 136 ms)
I/ActivityManager(  803): Starting activity: Intent { 
cmp=android.serialport.sample/.ConsoleActivity }
D/serial_port( 1190): Opening serial port /dev/ttyS2
D/serial_port( 1190): open() fd = -1
E/serial_port( 1190): Cannot open port
E/SerialPort( 1190): native open returns null
I/ActivityManager(  803): Displayed activity 
android.serialport.sample/.ConsoleActivity: 230 ms (total 230 ms)

Original issue reported on code.google.com by greatma...@gmail.com on 25 Nov 2010 at 11:21

GoogleCodeExporter commented 9 years ago
do you have a kernel that has serial port enabled? if so, please recompile the 
code with O_DIRECT removed from open() (see another issue reported here). 

Original comment by stephen....@gmail.com on 26 Nov 2010 at 9:41

GoogleCodeExporter commented 9 years ago
android 1.6 it work! but android 2.2  have problem.
serialport  driver  enable in kernel
I think that  beacause  Davik vitrual machine  doesn't understand JNI_ONLOAD.
Libserial_port.so isn't loaded
full  logcat
09-02 16:42:58.882: DEBUG/dalvikvm(4185): Trying to load lib 
/data/data/android.serialport.sample/lib/libserial_port.so0x434fb6f809-02 
16:42:58.892: DEBUG/dalvikvm(4185): Added shared lib 
/data/data/android.serialport.sample/lib/libserial_port.so 0x434fb6f809-02 
16:42:58.892: DEBUG/dalvikvm(4185): No JNI_OnLoad found in 
/data/data/android.serialport.sample/libserial_port.so not found

Original comment by greatma...@gmail.com on 26 Nov 2010 at 11:19

GoogleCodeExporter commented 9 years ago
android 2.2 works with the application. I've been running it. You can try 
download the source code and compile it yourself. You need to compile the 
native code as well as the java code. Otherwise, you will get missing shared 
library error. 

Original comment by stephen....@gmail.com on 29 Nov 2010 at 10:03

GoogleCodeExporter commented 9 years ago
Hi All, I'm facing the same issue with Android 2.1 device.

Please help me to resolve this.

Original comment by durga.n....@gmail.com on 4 Mar 2011 at 8:00

GoogleCodeExporter commented 9 years ago
I had the same problem at a nexus one, with cyanogenmod 7.0.2.1, fixed it using 
comment 1.

Original comment by drphro...@gmail.com on 17 May 2011 at 2:16

Attachments:

GoogleCodeExporter commented 9 years ago
me too ,using comment 1 is working,thx;

Original comment by hifoxk...@gmail.com on 27 May 2011 at 7:55

GoogleCodeExporter commented 9 years ago
using comment 1,the application is running on android 2.2,thanks!

Original comment by wisdom.l...@gmail.com on 16 Aug 2011 at 8:03

GoogleCodeExporter commented 9 years ago

Original comment by cedric.p...@gmail.com on 25 Oct 2011 at 10:15

GoogleCodeExporter commented 9 years ago
[deleted comment]
GoogleCodeExporter commented 9 years ago
here the application not running, i'm using on android 2.3.4 in beagleboard rev 
C4, help plaese? 

Original comment by gesseoli...@gmail.com on 8 Oct 2012 at 7:10