lejos_Droid not connecting

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

Moderators: roger, 99jonathan, imaqine

lejos_Droid not connecting

Postby roger » Mon Dec 05, 2011 6:54 am

My Droid phone is paired via bluetooth with my NXT. I have loaded the lejos-Droid/apk using Eclipse. When I run the app on the phone, the choice menu showing TachoCount, BTSend and RCNavigator appears, but so does the message
"nxj.cache file not written as cache already exists. Choose one!"
When I touch the screen the app closes. When I look at the sdcard files, the Lejos file is empty.
What am I doing wrong?
Roger
roger
Moderator
 
Posts: 308
Joined: Fri Jun 01, 2007 4:31 am
Location: Berkeley, CA

Re: lejos_Droid not connecting

Postby Shawn » Mon Dec 05, 2011 11:10 am

roger wrote:When I touch the screen the app closes. When I look at the sdcard files, the Lejos file is empty.
What am I doing wrong?


Well if you have the android sdk you can use adb from a command line to see what is going on.

Once you get it set up
http://developer.android.com/guide/developing/device.html

it should be under <sdk>/platform-tools/

either put it in your path or change to the dir in a shell and run
Code: Select all
adb logcat


I'm guessing (on of the following):

1) bluetooth got turned off
2) your version of android is 1.6
3) your handset is one of the flakey ones (like the htc hero) with a handset maker custom stack

I apologize for not knowing how to build android apps under netbeans.

Anyway, it should be able to make a connection even without the cache.

Please try the adb debugger as you will need it anyway if you do anything with Android, and let me know what it says.
User avatar
Shawn
Advanced Member
 
Posts: 723
Joined: Wed Sep 12, 2007 4:59 am
Location: Tokyo

Re: lejos_Droid not connecting

Postby roger » Mon Dec 05, 2011 6:11 pm

HI Shawn ,
Here is the log from Eclipse:

12-05 10:01:16.470: I/Process(11972): Sending signal. PID: 11972 SIG: 9
12-05 10:01:46.916: D/LeJOSDroid(12136): about to add LEJOS listener
12-05 10:01:46.916: E/LeJOSDroid NXJ log:(12136): Protocols = 2
12-05 10:01:46.923: E/LeJOSDroid NXJ log:(12136): Search Param = NXT
12-05 10:01:46.923: E/LeJOSDroid NXJ log:(12136): No NXTs found in cache file
12-05 10:01:46.923: E/LeJOSDroid NXJ log:(12136): Searching for NXT using Bluetooth inquiry
12-05 10:01:46.923: E/LeJOSDroid NXJ log:(12136): Inquiry found 0 NXTs
12-05 10:01:46.923: E/LeJOSDroid NXJ log:(12136): Saving cached names
12-05 10:01:46.939: E/LeJOSDroid NXJ log:(12136): Failed to find any NXTs
12-05 10:01:46.939: E/LeJOSDroid NXJ log:(12136): Failed to connect to any NXT
12-05 10:01:46.939: W/dalvikvm(12136): threadid=9: thread exiting with uncaught exception (group=0x4001e560)
I am using a Motorola Droid 3
Under settings/Bluetooth/BluetoothDevices it shows NR3 the name of my robot
The robot is turned on, and visible, and has been paired with the phone.
I have not tried the adb debugger - will it give any more info?
thanks
Roger
roger
Moderator
 
Posts: 308
Joined: Fri Jun 01, 2007 4:31 am
Location: Berkeley, CA

Re: lejos_Droid not connecting

Postby Shawn » Mon Dec 05, 2011 10:15 pm

roger wrote:HI Shawn ,
Here is the log from Eclipse:

12-05 10:01:16.470: I/Process(11972): Sending signal. PID: 11972 SIG: 9
12-05 10:01:46.916: D/LeJOSDroid(12136): about to add LEJOS listener
12-05 10:01:46.916: E/LeJOSDroid NXJ log:(12136): Protocols = 2
12-05 10:01:46.923: E/LeJOSDroid NXJ log:(12136): Search Param = NXT
12-05 10:01:46.923: E/LeJOSDroid NXJ log:(12136): No NXTs found in cache file
12-05 10:01:46.923: E/LeJOSDroid NXJ log:(12136): Searching for NXT using Bluetooth inquiry
12-05 10:01:46.923: E/LeJOSDroid NXJ log:(12136): Inquiry found 0 NXTs
12-05 10:01:46.923: E/LeJOSDroid NXJ log:(12136): Saving cached names
12-05 10:01:46.939: E/LeJOSDroid NXJ log:(12136): Failed to find any NXTs
12-05 10:01:46.939: E/LeJOSDroid NXJ log:(12136): Failed to connect to any NXT
12-05 10:01:46.939: W/dalvikvm(12136): threadid=9: thread exiting with uncaught exception (group=0x4001e560)


Nice. Yeah that is the adb logcat output. Eclipse picks it up too but I wasn't sure how to set it up -- easily it seems.

It looks like your are trying to run tachoCount.

AFAICT, leJOSDroid is working ok and the failure is at the leJOS code of
lejos.pc.comm.NXTConnector.connectTo(String deviceURL, int mode)

The exact code that gets called is:
conn.connectTo("btspp://NXT", NXTComm.LCP);

It's just crashing because the connection comes back null and I didn't check for that.

roger wrote:I am using a Motorola Droid 3


The apk was compiled with SDK 8 but your handset is SDK 9. It should run but perhaps rebuilding it will do the trick.

Make sure to remove the apk via your handset. It's been signed and any new apk you build will have a different signature so you can't just update it from eclipse.
User avatar
Shawn
Advanced Member
 
Posts: 723
Joined: Wed Sep 12, 2007 4:59 am
Location: Tokyo

Re: lejos_Droid not connecting

Postby Shawn » Mon Dec 05, 2011 10:35 pm

roger wrote:Under settings/Bluetooth/BluetoothDevices it shows NR3 the name of my robot
The robot is turned on, and visible, and has been paired with the phone.


Also, leJOSDroid will not turn on the handset's bluetooth for you. Please make sure it's on.
User avatar
Shawn
Advanced Member
 
Posts: 723
Joined: Wed Sep 12, 2007 4:59 am
Location: Tokyo

Re: lejos_Droid not connecting

Postby gloomyandy » Mon Dec 05, 2011 11:35 pm

It looks like you are trying to connect to a brick called "NXT" but is this the name of your nxt? If not you may need to edit the program...
User avatar
gloomyandy
leJOS Team Member
 
Posts: 3004
Joined: Fri Sep 28, 2007 2:06 pm
Location: UK

Re: lejos_Droid not connecting

Postby someonesomewhere » Thu Jul 12, 2012 9:51 am

Where do you download lejosDroid.apk?

I'm am new to lejos and would simply like to send some data from an android to the NXT.
Could someone please provide and example?
someonesomewhere
New User
 
Posts: 2
Joined: Thu Jul 12, 2012 9:47 am

Re: lejos_Droid not connecting

Postby Shawn » Thu Jul 12, 2012 9:37 pm

lejosDroid is in SVN.
User avatar
Shawn
Advanced Member
 
Posts: 723
Joined: Wed Sep 12, 2007 4:59 am
Location: Tokyo

Re: lejos_Droid not connecting

Postby plontko » Sun Feb 03, 2013 10:15 pm

Hi,

sorry i am new here.

Were can i download lejosDroid?
What you mean with "SVN"?

THX
plontko
New User
 
Posts: 2
Joined: Sun Feb 03, 2013 9:57 pm


Return to NXJ Software

Who is online

Users browsing this forum: No registered users and 2 guests

more stuff