LeJOSDroid crashed in Droid phone

This is where you talk about the NXJ software itself, installation issues, and programming talk.

Moderators: roger, 99jonathan, imaqine

LeJOSDroid crashed in Droid phone

Postby ray80127 » Tue May 29, 2012 4:46 am

Hi,
I am learning how to control NXT by android phone recently.
My phone is HTC sensation 4g with version 4.0 .
My leJOS version is 0.9.1beta-2.

I have a similar problem as this post: http://lejos.sourceforge.net/forum/viewtopic.php?f=7&t=3035&p=15004&hilit=lejosdroid#p15004
My phone has paired to my NXT.
When I run the app, I can see the main menu (TachoCount, BTSend and RCNavigator)
As I touch the button of TachoCount or BTSend, the app crashed.
And also the message shows under the menu : "nxj.cache file not written as cache already exists. Choose one!"

However when I run the other program "MINDdroid", the app runs with no trouble.
I really want to solve this problem...
Can anyone help me?
Thanks for any opinion.

This is the log showed on eclipse when I touch the "BTSend" button :
05-28 21:38:58.496: D/memalloc(9278): /dev/pmem: Mapped buffer base:0x52bcb000 size:6266880 offset:4177920 fd:73
05-28 21:38:58.607: D/BTSend(9278): BTSend run
05-28 21:38:58.607: D/LeJOSDroid(9278): about to add LEJOS listener
05-28 21:38:58.607: E/LeJOSDroid NXJ log:(9278): Protocols = 2
05-28 21:38:58.607: E/LeJOSDroid NXJ log:(9278): Search Param = null
05-28 21:38:58.627: E/LeJOSDroid NXJ log:(9278): Searching cache file for known Bluetooth devices
05-28 21:38:58.627: E/LeJOSDroid NXJ log:(9278): Found NXT 00:16:53:13:CE:06 in cache file
05-28 21:38:58.637: E/LeJOSDroid NXJ log:(9278): Found 1 matching NXTs in cache file
05-28 21:38:58.637: E/LeJOSDroid NXJ log:(9278): Connecting to NXT 00:16:53:13:CE:06 in mode 0
05-28 21:38:58.647: I/BLZ20_WRAPPER(9278): blz20_wrp_socket: fam 31, type 1, prot BTPROTO_RFCOMM
05-28 21:38:58.647: D/BLZ20_WRAPPER(9278): blz20_init: initializing...
05-28 21:38:58.647: D/BTL_IFC_WRP(9278): __wsactive_init: init active list
05-28 21:38:58.657: D/BTL_IFC_WRP(9278): wrp_add_to_active_set_custom_fd: fd 78
05-28 21:38:58.657: D/BTL_IFC_WRP(9278): __wsactive_add: add fd 78 to active list
05-28 21:38:58.657: I/BTL-IFC(9278): main_client_thread: Client main thread starting
05-28 21:38:58.667: D/BLZ20_WRAPPER(9278): blz20_init: success
05-28 21:38:58.667: I/BTL-IFC(9278): BTL_IFC_RegisterSubSystem: Register subsystem [BTS]
05-28 21:38:58.667: I/BTL-IFC(9278): btl_ifc_ctrl_connect: Connect control channel for subsystem [BTS]
05-28 21:38:58.667: D/BTL_IFC_WRP(9278): wrp_sock_create: CTRL
05-28 21:38:58.667: D/BTL_IFC_WRP(9278): wrp_sock_create: ws->listen_fd -1, ws->wsock: 80, ws->pid: 9278
05-28 21:38:58.667: D/BTL_IFC_WRP(9278): wrp_sock_connect: wrp_sock_connect brcm.bt.btlif:9000 (80)
05-28 21:38:58.667: D/BTL_IFC_WRP(9278): wrp_sock_connect: BTLIF_MAKE_LOCAL_SERVER_NAME return name: brcm.bt.btlif.9000
05-28 21:38:58.667: D/BTL_IFC_WRP(9278): wrp_sock_connect: result 0, server name:brcm.bt.btlif.9000
05-28 21:38:58.667: I/BTL_IFC_WRP(9278): wrp_sock_connect: Connected. (80)
05-28 21:38:58.667: D/BTL-IFC(9278): send_ctrl_msg: [BTL_IFC CTRL] send msg id 4097 - BTLIF_REGISTER_SUBSYS_REQ (BTS) 0 pbytes (hdl 80)
05-28 21:38:58.667: D/BTL-IFC(9278): BTL_IFC_RegisterSubSystem: add new ctrl fd (80) to active set
05-28 21:38:58.667: D/BTL_IFC_WRP(9278): wrp_add_to_active_set_custom_fd: fd 80
05-28 21:38:58.667: D/BTL_IFC_WRP(9278): __wsactive_add: add fd 80 to active list
05-28 21:38:58.667: D/BTL_IFC_WRP(9278): wrp_wsock_create: BTS
05-28 21:38:58.667: D/BTL_IFC_WRP(9278): wrp_wsock_create: ws->listen_fd -1, ws->wsock: 81, ws->pid: 9278
05-28 21:38:58.667: D/BLZ20_WRAPPER(9278): dump_bsock: btsk_alloc_add [no_prot] listen_fd: -1, port 0, bta_srv -1, wsock: 81, rc: 0, wflags: 0x0
05-28 21:38:58.667: D/BLZ20_WRAPPER(9278): btsk_alloc_add: success (cnt 1)
05-28 21:38:58.667: I/BLZ20_WRAPPER(9278): blz20_wrp_socket: s:81
05-28 21:38:58.667: I/BLZ20_WRAPPER(9278): blz20_wrp_setsockopt: blz20_wrp_setsockopt->s:81
05-28 21:38:58.667: D/BLZ20_WRAPPER(9278): dump_bsock: setsocksopt [rfcomm] listen_fd: -1, port 0, bta_srv -1, wsock: 81, rc: 0, wflags: 0x0
05-28 21:38:58.667: I/BLZ20_WRAPPER(9278): blz20_wrp_setsockopt: configure rfcomm lm mode 0x26, (master:0, auth 1, enc 1)
05-28 21:38:58.667: I/BLZ20_WRAPPER(9278): blz20_wrp_setsockopt: success
05-28 21:38:58.667: I/BLZ20_WRAPPER(9278): blz20_wrp_setsockopt: blz20_wrp_setsockopt->s:81
05-28 21:38:58.667: D/BLZ20_WRAPPER(9278): dump_bsock: setsocksopt [rfcomm] listen_fd: -1, port 0, bta_srv -1, wsock: 81, rc: 0, wflags: 0x0
05-28 21:38:58.667: I/BLZ20_WRAPPER(9278): blz20_wrp_setsockopt: configure rfcomm sndbuf len 71680 bytes
05-28 21:38:58.667: I/BLZ20_WRAPPER(9278): blz20_wrp_setsockopt: success
05-28 21:38:58.667: I/BLZ20_WRAPPER(9278): blz20_wrp_fcntl: s 81, cmd 3
05-28 21:38:58.667: D/BLZ20_WRAPPER(9278): dump_bsock: fcntl [rfcomm] listen_fd: -1, port 0, bta_srv -1, wsock: 81, rc: 0, wflags: 0x0
05-28 21:38:58.667: I/BLZ20_WRAPPER(9278): blz20_wrp_fcntl: s 81, cmd 4
05-28 21:38:58.667: D/BLZ20_WRAPPER(9278): dump_bsock: fcntl [rfcomm] listen_fd: -1, port 0, bta_srv -1, wsock: 81, rc: 0, wflags: 0x0
05-28 21:38:58.667: D/BLZ20_WRAPPER(9278): blz20_wrp_fcntl: transparant fcntl
05-28 21:38:58.667: I/BLZ20_WRAPPER(9278): blz20_wrp_fcntl: s 83, cmd 3
05-28 21:38:58.667: I/BLZ20_WRAPPER(9278): blz20_wrp_fcntl: wsock not found, pass through transparantly
05-28 21:38:58.667: I/BLZ20_WRAPPER(9278): blz20_wrp_fcntl: s 83, cmd 4
05-28 21:38:58.667: I/BLZ20_WRAPPER(9278): blz20_wrp_fcntl: wsock not found, pass through transparantly
05-28 21:38:58.667: D/BLZ20_WRAPPER(9278): blz20_set_asocket: store asock in btsk
05-28 21:38:58.667: I/NXTCommAndroid >>>>(9278): BEGIN mConnectThread
05-28 21:38:58.677: E/LeJOSDroid NXJ log:(9278): Failed to open NXT 00:16:53:13:CE:06
05-28 21:38:58.677: E/LeJOSDroid NXJ log:(9278): Failed to connect to any NXT
05-28 21:38:58.677: W/dalvikvm(9278): threadid=11: thread exiting with uncaught exception (group=0x40a92228)
05-28 21:38:58.677: E/AndroidRuntime(9278): FATAL EXCEPTION: Thread-1089
05-28 21:38:58.677: E/AndroidRuntime(9278): java.lang.NullPointerException
05-28 21:38:58.677: E/AndroidRuntime(9278): at lejos.android.BTSend.run(BTSend.java:54)
05-28 21:38:58.687: E/NXTCommAndroid >>>>(9278): Connection failure -- unable to connect to socket
05-28 21:38:58.687: E/NXTCommAndroid >>>>(9278): java.io.IOException: Unable to start Service Discovery
05-28 21:38:58.687: E/NXTCommAndroid >>>>(9278): at android.bluetooth.BluetoothSocket$SdpHelper.doSdp(BluetoothSocket.java:393)
05-28 21:38:58.687: E/NXTCommAndroid >>>>(9278): at android.bluetooth.BluetoothSocket.connect(BluetoothSocket.java:209)
05-28 21:38:58.687: E/NXTCommAndroid >>>>(9278): at lejos.pc.comm.NXTCommAndroid$ConnectThread.run(NXTCommAndroid.java:81)
05-28 21:38:58.687: D/LeJOSDroid(9278): onPause() closing btSend
05-28 21:38:58.687: D/BTSend(9278): BTSend run loop finished and closing
05-28 21:38:58.697: I/BLZ20_WRAPPER(9278): blz20_wrp_shutdown: s 81, how 2
05-28 21:38:58.697: D/BLZ20_WRAPPER(9278): dump_bsock: shutdown [rfcomm] listen_fd: -1, port 0, bta_srv -1, wsock: 81, rc: 0, wflags: 0x0
05-28 21:38:58.697: I/BLZ20_WRAPPER(9278): blz20_wrp_shutdown: shutdown socket
05-28 21:38:58.697: I/BLZ20_WRAPPER(9278): blz20_wrp_shutdown: s 81, how 2
05-28 21:38:58.697: D/BLZ20_WRAPPER(9278): dump_bsock: shutdown [rfcomm] listen_fd: -1, port 0, bta_srv -1, wsock: 81, rc: 0, wflags: 0x0
05-28 21:38:58.697: I/BLZ20_WRAPPER(9278): blz20_wrp_shutdown: shutdown socket
05-28 21:38:58.707: I/BLZ20_WRAPPER(9278): blz20_wrp_close: s 83
05-28 21:38:58.707: I/BLZ20_WRAPPER(9278): blz20_wrp_close: s 82
05-28 21:38:58.707: I/BLZ20_WRAPPER(9278): blz20_wrp_close: s 81
05-28 21:38:58.707: D/BLZ20_WRAPPER(9278): dump_bsock: close [rfcomm] listen_fd: -1, port 0, bta_srv -1, wsock: 81, rc: 0, wflags: 0x0
05-28 21:38:58.707: I/BLZ20_WRAPPER(9278): __close_prot_rfcomm: fd 81
05-28 21:38:58.707: D/BLZ20_WRAPPER(9278): __close_prot_rfcomm: bta handle already closed
05-28 21:38:58.707: D/BTL_IFC_WRP(9278): wrp_close_s_only: wrp_close_s_only [81] (81:-1) []
05-28 21:38:58.707: D/BTL_IFC_WRP(9278): wrp_close_s_only: data socket closed
05-28 21:38:58.707: D/BTL_IFC_WRP(9278): __wsactive_del: delete fd 81 from active list [fc2288]
05-28 21:38:58.707: D/BTL_IFC_WRP(9278): wrp_close_s_only: wsock fully closed, return to pool
05-28 21:38:58.707: D/BLZ_WRAPPER(9278): ws_async_del: [ws_async_del] : (-1:-1), disc_pending 0, asnc 0, selct 0, flags 0
05-28 21:38:58.707: I/BLZ20_WRAPPER(9278): btsk_free_bta_conns: done
05-28 21:38:58.707: D/BLZ20_WRAPPER(9278): btsk_free: success (cnt 0)
05-28 21:38:59.037: D/memalloc(9278): /dev/pmem: Unmapping buffer base:0x52bcb000 size:6266880 offset:4177920
ray80127
New User
 
Posts: 2
Joined: Tue May 29, 2012 4:27 am

Re: LeJOSDroid crashed in Droid phone

Postby monroe » Fri Jun 01, 2012 7:55 pm

I got around the service discovery problem by modifying ConnectThread in NXTCommAndroid in a way similar to this post on Stack Overflow http://stackoverflow.com/questions/3397 ... on-android . I still cannot get the sample projects to work properly, there seems to be a problem with connecting to the NXT similar to this post http://stackoverflow.com/questions/2268 ... perability . What MINDroid app are you successfully running?

EDIT: Sorry about the confusion with MINDroid. I got BTSend to work using the edits i mentioned above. The problem seemed to be that my phone was not automatically displaying a message for me to enter the bluetooth pin, I needed to pull down the menu from the top myself. Hope this helps!
monroe
New User
 
Posts: 2
Joined: Fri Jun 01, 2012 7:47 pm

Re: LeJOSDroid crashed in Droid phone

Postby ray80127 » Thu Aug 02, 2012 8:32 am

Hi
the MindDroid app is the app that LEGO developed for android phone.
You can download it in the Google Play.
This is the site: https://play.google.com/store/apps/details?id=com.lego.minddroid
ray80127
New User
 
Posts: 2
Joined: Tue May 29, 2012 4:27 am


Return to NXJ Software

Who is online

Users browsing this forum: No registered users and 4 guests

more stuff