Bluetooth not working with Lejos (Resolved)

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

Moderators: roger, gloomyandy, skoehler

Bluetooth not working with Lejos (Resolved)

Postby huha » Sat Feb 15, 2014 5:10 pm

I got everything working besides bluetooth. It works with the original lego software without problems.
I am using Lejos 0.0.0.6 (but also previous versions I could not get to work) and Windows 8.1 64 bit
My bluetooth usb is a goobay dongle Bluetooth v2.0.
Everything looks fine in the beginning:
- visibility on PC is turned on
- searching bluetooth on EV3 works fine and the PC is found
- the pin can be entered on the EV3
- the pin confirmation is showing up on the PC
- then the PC shows EV3 connected, but after a few seconds the status goes to disconnected
- in the blue tooth settings I can see a Com3 port for EV3 out serial port and a Com 4 port for EV3 in port
- the windows device manager shows no errors for the com 3 port, the com4port or the bluetooth pan network adapter

Reconnecting does not help. Any idea what I am doing wrong?
Last edited by huha on Sat Feb 15, 2014 10:49 pm, edited 1 time in total.
huha
New User
 
Posts: 19
Joined: Tue Sep 24, 2013 9:24 pm

Re: Bluetooth not working with Lejos

Postby lawrie » Sat Feb 15, 2014 5:37 pm

What are you trying to do with Bluetooth? Are you trying to do TCP networking over PAN or Bluetooth serial comms?

You may well have achieved pairing between the EV3 and the PC, but it is usually easier to do it from the PC rather than from the EV3.

It probably disconnects as you are not connected to any application on the PC.

If you want to use TCP connections to the EV3, you should do "Join a Personal Area Network" from the PC. I have not tried it on Windows 8.1.
lawrie
leJOS Team Member
 
Posts: 929
Joined: Mon Feb 05, 2007 1:27 pm

Re: Bluetooth not working with Lejos

Postby huha » Sat Feb 15, 2014 6:22 pm

Lawrie,
thanks, I was trying to do a network connection via bluetooth. I was assuming that after pairing i could do a ssh connection via putty or use the 10.0.1.1 for eclipse to transfer files via bluetooth.
I do see the same effect when trying to connect from the PC to the EV3. I see for a few seconds connected and then it turns to disconnected. I do see on the PC the ethernet adapter when entering ipconfig /all. The dhcp is activated, but it cannot hold a connection. After about 10s it is disconnecting.
All the microsoft help information I saw for "bluetooth personal area network" was only for windows 7. So it looks like the connection is lost as there is no program to hold it.
Could anyone use bluetooth on windows 8.1 with lejos?
huha
New User
 
Posts: 19
Joined: Tue Sep 24, 2013 9:24 pm

Re: Bluetooth not working with Lejos

Postby lawrie » Sat Feb 15, 2014 6:33 pm

Hi huha, Our posts overlapped. I hope the extra information helps. I don't have access to a Windows 8.1 machine at the moment to try it from that,but I am sure it has a way to connect to a Personal Area Network, which is what you want to do. I just tried it from my Windows 7 laptop and it worked fine. I usually use Wifi. Lawrie
lawrie
leJOS Team Member
 
Posts: 929
Joined: Mon Feb 05, 2007 1:27 pm

Re: Bluetooth not working with Lejos

Postby huha » Sat Feb 15, 2014 6:47 pm

Lawrie,
thanks to your answer I am a big step ahead.
With windows 8.1 you need to search at "Devices and Printers" in the control panel.
There is at "Others" the EV3.
Rightclick on the symbol and use the menu "connect via accesspoint"
Then the connection stays.
I am still not able to access via putty on 10.0.1.1 port22 . i probably have the wrong settings here.
I changed from SSH to serial COM4 at 9600.

Update:
With ipconfig/all I see:
Bluetooth device (PAN)
IPv4address: 169.254.162.118 (preferred)

The EV3 shows 10.0.1.1

I am not able to connect withPutty SSH to either of them.
huha
New User
 
Posts: 19
Joined: Tue Sep 24, 2013 9:24 pm

Re: Bluetooth not working with Lejos

Postby lawrie » Sat Feb 15, 2014 7:05 pm

Putty with 10.0.1.1 and port 22 should work, after you have connected to the access point. It works for me on Windows 7 and on Linux. COM4 won't work, as that is only used for serial connections: it won't be connected to anything and even if it was, there is no responder program on the EV3 for tenet of ssh (or anything else) on it.
lawrie
leJOS Team Member
 
Posts: 929
Joined: Mon Feb 05, 2007 1:27 pm

Re: Bluetooth not working with Lejos

Postby huha » Sat Feb 15, 2014 7:28 pm

I compared the USB network adapter with the bluetooth network adapter.
Code: Select all
Ethernet-Adapter Ethernet:

   Verbindungsspezifisches DNS-Suffix:
   Beschreibung. . . . . . . . . . . : RNDIS/Ethernet Gadget
   Physische Adresse . . . . . . . . : BA-79-2F-1F-F0-A8
   DHCP aktiviert. . . . . . . . . . : Ja
   Autokonfiguration aktiviert . . . : Ja
   Verbindungslokale IPv6-Adresse  . : fe80::fc36:49da:c8c5:18b7%10(Bevorzugt)
   IPv4-Adresse (Auto. Konfiguration): 169.254.24.183(Bevorzugt)
   Subnetzmaske  . . . . . . . . . . : 255.255.0.0
   Standardgateway . . . . . . . . . :
   DHCPv6-IAID . . . . . . . . . . . : 231615296
   DHCPv6-Client-DUID. . . . . . . . : 00-01-00-01-18-38-3B-5C-6C-F0-49-E0-B1-D0

   DNS-Server  . . . . . . . . . . . : fec0:0:0:ffff::1%1
                                       fec0:0:0:ffff::2%1
                                       fec0:0:0:ffff::3%1
   NetBIOS über TCP/IP . . . . . . . : Aktiviert


Ethernet-Adapter Bluetooth-Netzwerkverbindung:

   Verbindungsspezifisches DNS-Suffix:
   Beschreibung. . . . . . . . . . . : Bluetooth-Gerät (PAN)
   Physische Adresse . . . . . . . . : 01-35-05-23-0D-F3
   DHCP aktiviert. . . . . . . . . . : Ja
   Autokonfiguration aktiviert . . . : Ja
   Verbindungslokale IPv6-Adresse  . : fe80::28c0:f629:891a:a276%9(Bev
   IPv4-Adresse (Auto. Konfiguration): 169.254.162.118(Bevorzugt)
   Subnetzmaske  . . . . . . . . . . : 255.255.0.0
   Standardgateway . . . . . . . . . :
   DHCPv6-IAID . . . . . . . . . . . : 151074053
   DHCPv6-Client-DUID. . . . . . . . : 00-01-00-01-18-38-3B-5C-6C-F0-4

   DNS-Server  . . . . . . . . . . . : fec0:0:0:ffff::1%1
                                       fec0:0:0:ffff::2%1
                                       fec0:0:0:ffff::3%1
   NetBIOS über TCP/IP . . . . . . . : Aktiviert


Both look ok to me. The only difference is that i can connect via putty using SSH on 10.0.1.1 port 22, but via bluetooth i cannot connect using 10.0.1.1 port 22.
huha
New User
 
Posts: 19
Joined: Tue Sep 24, 2013 9:24 pm

Re: Bluetooth not working with Lejos

Postby huha » Sat Feb 15, 2014 8:05 pm

I just tried the same procedure from a different computer (laptop) running win8.1 32bit and everything works fine. So it is most likely my bluetooth dongle which is not fully compliant.
Thanks for your help lawrie.
huha
New User
 
Posts: 19
Joined: Tue Sep 24, 2013 9:24 pm

Re: Bluetooth not working with Lejos (Resolved)

Postby huha » Sun Feb 16, 2014 10:05 am

I put a short summary on if anyone else is running into the same issue (and for myself to remember :D )

Step1:
- on the EV3 go to Bluetooth, change pin code and make sure EV3 is visible (do not search for other computers)

Step2:
- On Windows 8 (8.1) goto Windows start screen, top right corner, settings, change PC settings
- In the Windows 8 settings app, goto PC and devices, bluetooth and search for the EV3
- Connect to the EV3 and enter the pin from Step1. The EV3 will connect and then disconnect again.

Step3:
- go to the Windows 8 desktop screen and open the control panel (if you have classic shell) and open devices and printers
- search for EV3 (at others)
- right mouse click on EV3 and connect via access point. You will see connected and the connection stays.

Step4:
- open puTTY and use 10.0.1.1 port 22 with SSH to connect to the EV3
- if you cannot connect your bluetooth dongle may not support network adopters (my Goobay dongle with a Generic Bluetooth radio driver did not work)
huha
New User
 
Posts: 19
Joined: Tue Sep 24, 2013 9:24 pm

Re: Bluetooth not working with Lejos (Resolved)

Postby huha » Fri Feb 21, 2014 7:15 am

I can confirm now that the problem was my old Bluetooth dongle. I got a LogiLink BT0015 (Bluetooth V4.0) and everything was working.
You need to follow the procedure in the LogiLink manual on the CD to get it connected via PAN.
huha
New User
 
Posts: 19
Joined: Tue Sep 24, 2013 9:24 pm

Re: Bluetooth not working with Lejos

Postby SegmentFault » Sun Feb 23, 2014 7:31 pm

Well i got a different problem with the bluetooth. I'm trying to use bluetooth as a communication option without joining windows and the EV3 together as a network, in other words not using a tcp socket. So far i got:

Code: Select all
public class Bluetooth {
    public Bluetooth() {
        BTConnector btc = new BTConnector();

        NXTConnection bc = btc.waitForConnection(0, 2);
        System.out.println("something connected, yay!!");


        DataInputStream dataInputStream = bc.openDataInputStream();
        DataOutputStream dataOutputStream = bc.openDataOutputStream();

        String s =  "Hello World!";
        bc.write(s.getBytes(), s.length());
        bc.write(s.getBytes(), s.length());
     }
}


I do manage to both connect and receive data from a python program, but i can't for some reason receive any data sent from the code above. Only receive "None" in the python code. (using pybluez if wondering)

(Using the bc directly to see if there is any problems with the DataOutputStream)

NOTE: for some reason i can't seem to use the BufferedReader instead of the DataInputStream for writing data, not really an issue as the DataInputStream works, but still worth noticing
SegmentFault
New User
 
Posts: 8
Joined: Tue Feb 04, 2014 5:56 pm


Return to EV3 Software

Who is online

Users browsing this forum: Google [Bot], Yahoo [Bot] and 3 guests

more stuff