Skip to content

Bluetooth does not start #572

Closed
Closed

Description

@laurensvalk

After launch, Bluetooth often does not come up, and it fails to turn on, showing '??':

Workaround: Attempt to turn bluetooth on; see '???' on the screen; reboot.

Essentially two boots are typically required to turn on BT. I am using ev3dev-jessie-2015-12-30.

Activity

  1. dlech commented on Mar 14, 2016

    @dlech
    Member

    This has always been a problem with jessie. Since we are using systemd for init, it does many things at once and the hciattach command times out. I haven't figured out a good way to fix it yet. You can tell when this happens by running sudo systemctl -l status ev3-bluetooth.service. This usually only happens to me on the very first boot with a new SD card image because we are generating ssh keys and a few extra things so the system is extra busy. After that, it is generally fine. But it sounds like you are saying that this happens randomly on subsequent boots?

    Is re-establishing connections a separate issue from the no Bluetooth at all ("???") ? If so, please open a second issue for this.

  2. laurensvalk commented on Mar 14, 2016

    @laurensvalk
    Author

    Indeed, this happens more often, and I haven't found a pattern yet.

    I'll open another issue for other BT issues.

  3. dlech commented on Mar 14, 2016

    @dlech
    Member

    Next time it happens, run sudo systemctl -l status ev3-bluetooth.service before you reboot and we will see if it is the same error I have seen.

  4. antonvh commented on Mar 16, 2016

    @antonvh

    Same issue here. Rebooting the mac AND the Ev3 usually does the trick. I suspect it has to do with computers going to sleep while bluetooth connections are open. I disabled 'connect automatically' in brickman for a more reliable boot of the ev3 brick: sometimes it doesn't boot at all, sometimes it boots in bluetooth "???" mode. @laurensvalk and I are working together on project anyway so we'll try to dig up the source of this.

  5. dlech commented on Mar 17, 2016

    @dlech
    Member

    When bluetooth does not start (indicated by "???" on the EV3), please post the output of sudo journalctl -b. Please use a Gist or pastebin since it will be quite long.

  6. dlech commented on Apr 12, 2016

    @dlech
    Member

    One thing I have noticed is that this happens more often if many EV3/UART sensors are attached. In particular the Gyro sensor which seems to use high CPU because of high data rates. In the 3.16.7-ckt26-10-ev3dev-ev3 kernel, I have offloaded EV3/UART sensor data processing to a separate kernel thread. I don't know if this will make a difference or not, but pay attention when you upgrade to this kernel and see if you can notice a difference.

  7. laurensvalk commented on Apr 30, 2016

    @laurensvalk
    Author

    When bluetooth does not start (indicated by "???" on the EV3), please post the output of sudo journalctl -b.

    It's here.

  8. dlech commented on Apr 30, 2016

    @dlech
    Member

    Just picking out the relevant parts for later comparison:

    Jan 01 01:00:04 ev3dev kernel: Linux version 3.16.7-ckt21-9-ev3dev-ev3
    ...
    Jan 01 01:00:24 ev3dev systemd[1]: Starting LEGO MINDSTORMS EV3 built-in Bluetooth...
    ...
    Jan 01 01:00:26 ev3dev kernel: Bluetooth: Core ver 2.19
    Jan 01 01:00:26 ev3dev kernel: NET: Registered protocol family 31
    Jan 01 01:00:26 ev3dev kernel: Bluetooth: HCI device and connection manager initialized
    Jan 01 01:00:26 ev3dev kernel: Bluetooth: HCI socket layer initialized
    Jan 01 01:00:26 ev3dev kernel: Bluetooth: L2CAP socket layer initialized
    Jan 01 01:00:26 ev3dev kernel: Bluetooth: SCO socket layer initialized
    Jan 01 01:00:26 ev3dev kernel: Bluetooth: HCI UART driver ver 2.2
    Jan 01 01:00:26 ev3dev kernel: Bluetooth: HCI H4 protocol initialized
    Jan 01 01:00:26 ev3dev kernel: Bluetooth: HCI BCSP protocol initialized
    Jan 01 01:00:26 ev3dev kernel: Bluetooth: HCILL protocol initialized
    ...
    Jan 01 01:00:27 ev3dev kernel: Bluetooth: hci0 sending frame failed
    ...
    Jan 01 01:00:28 ev3dev hciattach[259]: Cannot send hci command to socket: Connection timed out
    Jan 01 01:00:28 ev3dev hciattach[259]: Can't initialize device: Connection timed out
    ...
    Jan 01 01:00:29 ev3dev systemd[1]: ev3-bluetooth.service: control process exited, code=exited status=1
    Jan 01 01:00:29 ev3dev systemd[1]: Failed to start LEGO MINDSTORMS EV3 built-in Bluetooth.
    Jan 01 01:00:29 ev3dev systemd[1]: Unit ev3-bluetooth.service entered failed state.
    
  9. dlech commented on May 7, 2016

    @dlech
    Member

    Here's one from me. Very similar, but I don't have Bluetooth: hci0 sending frame failed.

    http://paste.debian.net/682670/

    ...
    May 07 03:45:03 ev3dev kernel: Linux version 4.4.9-dlech-ev3+ (david@freyr) (gcc version 5.2.1 20151005 (Linaro GCC 5.2-2015.11) ) #61 PREEMPT Fri May 6 22:34:52 CDT 2016
    ...
    
    May 07 03:45:44 ev3dev systemd[1]: Reached target Basic System.
    May 07 03:45:45 ev3dev systemd[1]: Starting LEGO MINDSTORMS EV3 UART Sensors...
    May 07 03:45:45 ev3dev systemd[1]: Starting LEGO MINDSTORMS EV3 UART Sensors...
    May 07 03:45:45 ev3dev systemd[1]: Starting LEGO MINDSTORMS EV3 built-in Bluetooth...
    May 07 03:45:45 ev3dev systemd[1]: Starting Login Service...
    ...
    May 07 03:45:46 ev3dev systemd[1]: Starting Avahi mDNS/DNS-SD Stack...
    May 07 03:45:46 ev3dev systemd[1]: Starting D-Bus System Message Bus...
    May 07 03:45:47 ev3dev systemd[1]: Started D-Bus System Message Bus.
    May 07 03:45:49 ev3dev kernel: Registered EV3 UART sensor line discipline. (29)
    May 07 03:45:50 ev3dev kernel: lego-sensor sensor0: Registered 'lego-ev3-gyro' on 'in2'.
    May 07 03:45:49 ev3dev avahi-daemon[274]: Found user 'avahi' (UID 103) and group 'avahi' (GID 105).
    May 07 03:45:49 ev3dev avahi-daemon[274]: Successfully dropped root privileges.
    May 07 03:45:50 ev3dev avahi-daemon[274]: avahi-daemon 0.6.32 starting up.
    May 07 03:45:50 ev3dev hciattach[266]: Found a Texas Instruments' chip!
    May 07 03:45:50 ev3dev hciattach[266]: Firmware file : /lib/firmware/ti-connectivity/TIInit_6.2.31.bts
    May 07 03:45:50 ev3dev hciattach[266]: Loaded BTS script version 1
    May 07 03:45:50 ev3dev hciattach[266]: texas: changing baud rate to 2000000, flow control to 1
    May 07 03:45:51 ev3dev hciattach[266]: Cannot send hci command to socket: Connection timed out
    May 07 03:45:51 ev3dev hciattach[266]: Can't initialize device: Connection timed out
    May 07 03:45:51 ev3dev kernel: lego-sensor sensor1: Registered 'lego-ev3-color' on 'in4'.
    May 07 03:45:51 ev3dev kernel: lego-sensor sensor2: Registered 'lego-ev3-us' on 'in3'.
    May 07 03:45:52 ev3dev avahi-daemon[274]: Successfully called chroot().
    May 07 03:45:52 ev3dev avahi-daemon[274]: Successfully dropped remaining capabilities.
    May 07 03:45:52 ev3dev avahi-daemon[291]: chroot.c: open() failed: No such file or directory
    May 07 03:45:52 ev3dev avahi-daemon[274]: Failed to open /etc/resolv.conf: Invalid argument
    May 07 03:45:52 ev3dev avahi-daemon[274]: No service file found in /etc/avahi/services.
    May 07 03:45:52 ev3dev dbus[278]: [system] Successfully activated service 'org.freedesktop.systemd1'
    May 07 03:45:52 ev3dev avahi-daemon[274]: socket() failed: Address family not supported by protocol
    May 07 03:45:52 ev3dev avahi-daemon[274]: Failed to create IPv6 socket, proceeding in IPv4 only mode
    May 07 03:45:53 ev3dev avahi-daemon[274]: socket() failed: Address family not supported by protocol
    May 07 03:45:53 ev3dev avahi-daemon[274]: Network interface enumeration completed.
    May 07 03:45:53 ev3dev avahi-daemon[274]: Server startup complete. Host name is ev3dev.local. Local service cookie is 2844453812.
    May 07 03:45:52 ev3dev systemd[1]: Started Avahi mDNS/DNS-SD Stack.
    May 07 03:45:52 ev3dev systemd[1]: Starting Permit User Sessions...
    May 07 03:45:53 ev3dev systemd[1]: Starting Turn on global VT cursor...
    May 07 03:45:53 ev3dev systemd[1]: Started getty on tty2-tty6 if dbus and logind are not available.
    May 07 03:45:53 ev3dev systemd[1]: Starting USB Gadget for LEGO MINDSTORMS EV3 hardware...
    May 07 03:45:54 ev3dev systemd[1]: Started Restore Sound Card State.
    May 07 03:45:55 ev3dev systemd[1]: Started LEGO MINDSTORMS EV3 UART Sensors.
    May 07 03:45:55 ev3dev systemd[1]: Started LEGO MINDSTORMS EV3 UART Sensors.
    May 07 03:45:55 ev3dev systemd[1]: Started LEGO MINDSTORMS EV3 UART Sensors.
    May 07 03:45:55 ev3dev systemd[1]: ev3-bluetooth.service: control process exited, code=exited status=1
    May 07 03:45:56 ev3dev systemd[1]: Failed to start LEGO MINDSTORMS EV3 built-in Bluetooth.
    May 07 03:45:56 ev3dev systemd[1]: Unit ev3-bluetooth.service entered failed state.
    May 07 03:45:56 ev3dev systemd[1]: Started Permit User Sessions.
    May 07 03:45:56 ev3dev systemd[1]: Started Turn on global VT cursor.
    
  10. dlech commented on May 7, 2016

    @dlech
    Member

    Interesting. One time, I had a sensor fail instead of Bluetooth.

    
    May 07 04:15:03 ev3dev systemd[1]: Started LEGO MINDSTORMS EV3 UART Sensors.
    May 07 04:15:03 ev3dev systemd[1]: Started LEGO MINDSTORMS EV3 UART Sensors.
    May 07 04:15:03 ev3dev systemd[1]: ev3-uart@in3.service: control process exited, code=exited status=1
    May 07 04:15:03 ev3dev systemd[1]: Failed to start LEGO MINDSTORMS EV3 UART Sensors.
    May 07 04:15:03 ev3dev systemd[1]: Unit ev3-uart@in3.service entered failed state.
    May 07 04:15:04 ev3dev systemd[1]: Started LEGO MINDSTORMS EV3 built-in Bluetooth.
    
  11. dlech commented on May 8, 2016

    @dlech
    Member
  12. dlech commented on May 10, 2016

    @dlech
    Member

    Possibly. You could try adjusting the dependencies in ev3-bluetooth.service. (Docs)

    But first, please try with the 4.4.9-11-ev3dev-ev3 kernel and see if there is any difference.

  13. dlech commented on May 10, 2016

    @dlech
    Member

    Also, legoev3_bluetooth is probably being loaded as a module. If we compiled it into the kernel, that would make it available earlier.

  14. gagnus commented on Jul 11, 2016

    @gagnus

    As requested, moving my comment to this bug as similar issue. I'm getting roughly the same symptoms - the same ??? in the bluetooth menus as above. The key information in sudo journalctl looks to be:

    Jan 01 00:01:00 ev3dev brickman[321]: ** (process:321): CRITICAL **: bluez5_manager_get_devices: assertion 'self != NULL' failed
    Jan 01 00:01:00 ev3dev dbus[272]: [system] Failed to activate service 'org.bluez': timed out
    Jan 01 00:01:22 ev3dev systemd[1]: ev3-bluetooth.service: control process exited, code=exited status=1
    Jan 01 00:01:22 ev3dev systemd[1]: Failed to start LEGO MINDSTORMS EV3 built-in Bluetooth.
    Jan 01 00:01:22 ev3dev systemd[1]: Unit ev3-bluetooth.service entered failed state.
    Jan 01 00:01:22 ev3dev systemd[1]: Starting Connection service...
    Jan 01 00:01:22 ev3dev systemd[1]: Starting Bluetooth service...
    Jan 01 00:01:23 ev3dev bluetoothd[451]: Bluetooth daemon 5.23
    Jan 01 00:01:23 ev3dev systemd[1]: Started Bluetooth service.
    Jan 01 00:01:24 ev3dev kernel: Bluetooth: Core ver 2.19

    I'm on kernel 3.16.7-ckt21-9-ev3dev-ev3 (willing to try later - seen mention of 4.4.9 above) but 3.16.7 seems to be the latest that apt-get will get for me?)

  15. dlech commented on Jul 11, 2016

    @dlech
    Member

    You have to run `sudo apt-get dist upgrade to upgrade the kernel. However, I don't expect that to make any difference. As I mentioned in the duplicate issue, unplugging sensors and upgrading flash-kernel may help.

    Although, if bluetooth is failing to start every time and not just sometimes, there may be something else going on.

  16. dlech commented on Jul 24, 2016

    @dlech
    Member

    I think we have this mostly sorted out. Please try with the latest nightly image build.

    Download

  17. gagnus commented on Jul 25, 2016

    @gagnus

    Bluetooth seems to work for me with this image. Thanks!

  18. dlech commented on Oct 11, 2016

    @dlech
    Member

    Please re-open if this is still an issue.

  19. antonvh commented on Oct 12, 2016

    @antonvh

    It is in the latest image on ev3dev.org (dec 2015), but it's fixed in the
    latest nightly build.
    Op di 11 okt. 2016 om 17:24 schreef David Lechner notifications@github.com

    Closed #572 #572.

    —
    You are receiving this because you commented.
    Reply to this email directly, view it on GitHub
    #572 (comment), or mute
    the thread
    https://github.com/notifications/unsubscribe-auth/AAVunLh_j5pH-BNda7YB_1C52iuZ0iRuks5qy6pCgaJpZM4HwZN9
    .

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions