6 Replies Latest reply on Jun 5, 2015 7:16 AM by ek

    Interacting with Mindstorms EV3 over bluetooth on Edison?

    ek

      Has anyone succeeded in communication between LEGO Mindstorms EV3 and Edison via Bluetooth?

       

      I would like to control a Brick of Mindstorms or read the sensor data by Edison. Use of Bluetooth seemed to be the most natural. But, the connection is unstable; Edison can connect to Mindstorms. But, it soon disconnects. No data or control is possible. I am wondering if it comes from the hardware (BT HW and Firmware) limitation OR if there is any work around.

       

      So, is there any LEGO player out there?

        • 1. Re: Interacting with Mindstorms EV3 over bluetooth on Edison?
          Intel_Peter

          Hello ek,

           

          I've never heard of anyone trying to do something like this, anyway it sound pretty cool. What exactly do you mean by "...Edison can connect to Mindstorms. But, it soon disconnects. No data or control is possible…"?

          You are able to find, pair and connect to your LEGO, right? How are you trying to control it? I mean which profile do you use? Also, which image are you using? You can find out about this using the command configure_edison --version

           

          Peter.

          1 of 1 people found this helpful
          • 2. Re: Interacting with Mindstorms EV3 over bluetooth on Edison?
            ek

            Hi Peter, thank you for the reply. I should have described those details in the first place...

            Anyway, below is the details. There are >2M Mindstorms in the world. I hope Edison can take advantage of the sensors and actuators, soon.

             

              Symptom : Edison and Mindstorms cannot communicate data / control

              Procedure :

                1. Start bluetoothctl

                2. Pair Mindstorms with Edison

                3. Connect Edison to Mindstorms

                    // Edison and Mindstorms disconnect...

              Log:

             

            ~~~~~~~~~~~

            root@edison:~# configure_edison --version

            146

            root@edison:~# uname -a

            Linux edison 3.10.17-poky-edison+ #1 SMP PREEMPT Wed Apr 29 03:54:01 CEST 2015 i686 GNU/Linux

            root@edison:~# rfkill unblock bluetooth

            root@edison:~# rfkill list

            0: phy0: wlan

                    Soft blocked: no

                    Hard blocked: no

            1: brcmfmac-wifi: wlan

                    Soft blocked: no

                    Hard blocked: no

            2: bcm43xx Bluetooth: bluetooth

                    Soft blocked: no

                    Hard blocked: no

            3: hci0: bluetooth

                    Soft blocked: no

                    Hard blocked: no

            root@edison:~# bluetoothctl

            [NEW] Controller 98:4F:EE:03:9A:47 edison [default]

            [NEW] Device 00:16:53:46:1F:97 EV3

            [NEW] Device 18:00:2D:58:55:59 Xperia Z

            [bluetooth]# scan on

            Discovery started

            [CHG] Controller 98:4F:EE:03:9A:47 Discovering: yes

            [bluetooth]# agent on

            Agent registered

            [NEW] Device EB:D5:CC:56:C5:C7 UP24

            [bluetooth]# default-agent

            Default agent request successful

            [CHG] Device 00:16:53:46:1F:97 LegacyPairing: yes

            [CHG] Device 00:16:53:46:1F:97 RSSI: -38

            [bluetooth]# pair 00:16:53:46:1F:97

            Attempting to pair with 00:16:53:46:1F:97

            Failed to pair: org.bluez.Error.AlreadyExists

            // above error can be ignored. It happened because the device is already paired.

            // the connection error happens, anyway.

            [bluetooth]# connect 00:16:53:46:1F:97

            Attempting to connect to 00:16:53:46:1F:97

            [CHG] Device 00:16:53:46:1F:97 Connected: yes

            Failed to connect: org.bluez.Error.NotAvailable

            [CHG] Device 00:16:53:46:1F:97 Connected: no

            [NEW] Device 6F:03:12:7B:5E:D2 6F-03-12-7B-5E-D2

            [CHG] Device 00:16:53:46:1F:97 RSSI: -48

            [bluetooth]# trust 00:16:53:46:1F:97

            [CHG] Device 00:16:53:46:1F:97 Trusted: yes

            Changing 00:16:53:46:1F:97 trust succeeded

            [bluetooth]# connect 00:16:53:46:1F:97

            Attempting to connect to 00:16:53:46:1F:97

            [CHG] Device 00:16:53:46:1F:97 Connected: yes

            Failed to connect: org.bluez.Error.NotAvailable

            [CHG] Device 00:16:53:46:1F:97 Connected: no

            [bluetooth]#

            • 3. Re: Interacting with Mindstorms EV3 over bluetooth on Edison?
              Intel_Peter

              I see… I'm not familiar with these LEGOs, are you able to edit their Bluetooth settings? I mean like on the Edison, if you enter the bluetoothctl environment, you can edit if you can see its MAC address, pair it or connect to it from other devices. Is there any option to edit this settings on your LEGOs?

              Also, remember to set an agent and make it default. Otherwise, (if I'm not mistaken) you won't be able to connect to any device. Also, I had an issue where I couldn't transfer files to a phone if I didn't set my Edison to trust the device, I know this doesn't seem related, but if you have issues connecting to your LEGO, maybe setting the Edison to trust it may help.

              Try those things out and let us know if you are able to connect to your LEGO, and if you do, keep us up to date with your project , as I said before it looks very interesting.

               

              Peter.

              • 4. Re: Interacting with Mindstorms EV3 over bluetooth on Edison?
                ek

                Hi Peter,

                The LEGO brick requires a special device to enter into the internal linux console. Unfortunately, I don't have the device. I can use the LEGO with PC, Mac, iPhone, or Android over Bluetooth. So, I was hoping that it could be solved on Edison side. It is true that console fix on LEGO side may still be necessary for this case (there are similar report, before).

                 

                Digging further into this, I found the symptom is similar to this post : How do I connect a bluetooth microphone to Edison?

                and this: https://github.com/ev3dev/ev3dev/issues/206

                Neither case seems to be solved ...

                 

                It is either LEGO disconnects Edison for some reason OR Edison prematurely thinks it was disconnected.

                 

                Of course, I set the the agent to be default, and trusted

                • 5. Re: Interacting with Mindstorms EV3 over bluetooth on Edison?
                  Intel_Peter

                  I'm not certain, but as you said, this might have to do with some setting that can only be changed on the LEGO's side. Can you connect the LEGO to your Linux PC and retrieve the LEGO's info to see if there's any weird setting we haven't thought of yet?

                   

                  Peter.

                  • 6. Re: Interacting with Mindstorms EV3 over bluetooth on Edison?
                    ek

                    I don't have access to LEGO side of Linux, yet. It's really weird that only Edison has this problem (among devices that I have).

                    I might try using a USB --> Bluetooth adapter, though it is an ugly solution...