Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

can't serial port Native open return null #5

Closed
GoogleCodeExporter opened this issue Jul 24, 2015 · 10 comments
Closed

can't serial port Native open return null #5

GoogleCodeExporter opened this issue Jul 24, 2015 · 10 comments

Comments

@GoogleCodeExporter
Copy link

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
Copy link
Author

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
Copy link
Author

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
Copy link
Author

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
Copy link
Author

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
Copy link
Author

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
Copy link
Author

me too ,using comment 1 is working,thx;

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

@GoogleCodeExporter
Copy link
Author

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
Copy link
Author

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

  • Changed state: Duplicate

@GoogleCodeExporter
Copy link
Author

[deleted comment]

@GoogleCodeExporter
Copy link
Author

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant