Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[CLOSED] Support for bluez bluetooth low energy #9

Closed
ffissore opened this issue Apr 30, 2014 · 16 comments
Closed

[CLOSED] Support for bluez bluetooth low energy #9

ffissore opened this issue Apr 30, 2014 · 16 comments

Comments

@ffissore
Copy link
Contributor

Issue by dragom
Wednesday Jan 08, 2014 at 19:54 GMT
Originally opened as arduino/linino#21


Is it possible to upgrade bluez libraries to latest one to have support for LE?
Current one looks that don't have le functions.

@ffissore
Copy link
Contributor Author

Comment by fibasile
Wednesday Jan 08, 2014 at 21:27 GMT


Hi, I've compiled the bluez 5 and it works fine. It's quite big package and many files must be removed to fit into flash. I think I can send a pull request during the weekend.

Il giorno 08/gen/2014, alle ore 20:54, Dragoslav Mlakar notifications@github.com ha scritto:

Is it possible to upgrade bluez libraries to latest one to have support for LE?
Current one looks that don't have le functions.


Reply to this email directly or view it on GitHub.

@ffissore
Copy link
Contributor Author

Comment by dragom
Wednesday Jan 08, 2014 at 21:38 GMT


Great!!!
I'm trying to use bleno (https://github.com/sandeepmistry/bleno) on top of it. So I will also use node and npm. Probably can also use your packages?

@ffissore
Copy link
Contributor Author

Comment by fibasile
Saturday Jan 11, 2014 at 12:15 GMT


While I find the time for a full pull request, please find attached the Makefile i'm using for the bluez package. Just create a bluez folder into the trunk/feeds/packages/utils/ and compile it.

#
# Copyright (C) 2006-2012 OpenWrt.org
#
# This is free software, licensed under the GNU General Public License v2.
# See /LICENSE for more information.
#

include $(TOPDIR)/rules.mk

PKG_NAME:=bluez
PKG_VERSION:=5.11
PKG_RELEASE:=1

PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
PKG_SOURCE_URL:=http://www.kernel.org/pub/linux/bluetooth
PKG_MD5SUM:=0e3b3d3f5bf40ac7cd4df96da9aa24aa

PKG_FIXUP:=autoreconf

include $(INCLUDE_DIR)/package.mk
include $(INCLUDE_DIR)/nls.mk

define Package/bluez
  SECTION:=utils
  CATEGORY:=Utilities
  DEPENDS:=+libpthread +libusb-compat +glib2 +dbus +udev $(INTL_DEPENDS) $(ICONV_DEPENDS)
  TITLE:=Bluetooth stack new version 
  URL:=http://www.bluez.org/
endef

define Package/bluez/conffiles
/etc/config/bluetooth
endef

CONFIGURE_ARGS += \
    --enable-library \
    --disable-systemd \
    --disable-monitor \
    --disable-cups \
        --disable-client \
        --disable-obex \
    --enable-usb \
    --disable-audio \
    --with-usb=yes \
    --with-udevdir="$(STAGING_DIR)/lib/udev"

define Build/Compile
    $(MAKE) -C $(PKG_BUILD_DIR) \
        LDFLAGS="$(TARGET_LDFLAGS) \
            -L$(ICONV_PREFIX)/lib \
            -L$(INTL_PREFIX)/lib -lm" \
        DESTDIR="$(PKG_INSTALL_DIR)" \
        all install
endef

define Package/bluez/install
    $(INSTALL_DIR) $(1)/usr/bin
    $(CP) $(PKG_INSTALL_DIR)/usr/bin/hciconfig $(1)/usr/bin/
    $(CP) $(PKG_INSTALL_DIR)/usr/bin/hcitool $(1)/usr/bin/
endef

$(eval $(call BuildPackage,bluez))

@ffissore
Copy link
Contributor Author

Comment by dragom
Saturday Jan 11, 2014 at 14:46 GMT


Great! Will try. I'm just struggling to make basic build work. Will let you know when I am able to test it.
https://github.com/dragom/linino

No additional patch, config files? Just Makefile?

@ffissore
Copy link
Contributor Author

Comment by fibasile
Saturday Jan 11, 2014 at 16:05 GMT


Yes, you need only this with the flags provided it compiles.
Il 11/gen/2014 15:46 "Dragoslav Mlakar" notifications@github.com ha
scritto:

Great! Will try. I'm just struggling to make basic build work. Will let
you know when I am able to test it.
https://github.com/dragom/linino

No additional patch, config files? Just Makefile?


Reply to this email directly or view it on GitHubhttps://github.com/arduino/linino/issues/21#issuecomment-32097779
.

@ffissore
Copy link
Contributor Author

Comment by dragom
Saturday Jan 11, 2014 at 16:13 GMT


Thnx again. Will let you know how it goes.
Probably will work the same also with 5.13 and appropriate PKG_MD5SUM.

Do you have any experience using bleno,noble on Yun?

@ffissore
Copy link
Contributor Author

Comment by dragom
Saturday Jan 11, 2014 at 20:53 GMT


It works! I am able to use Yun as ble beacon with this one
http://www.amazon.co.uk/Belkin-USB-4-0-Bluetooth-Adapter/dp/B009IQB3US
Now I will try to put also nodejs and bleno in action.

@ffissore
Copy link
Contributor Author

Comment by tigoe
Saturday Jan 11, 2014 at 22:13 GMT


Any luck getting BT Audio to work? I didn't have much luck with that.

t.

On Jan 11, 2014, at 3:53 PM, Dragoslav Mlakar notifications@github.com wrote:

It works! I am able to use Yun as ble beacon with this one
http://www.amazon.co.uk/Belkin-USB-4-0-Bluetooth-Adapter/dp/B009IQB3US
Now I will try to put also nodejs and bleno in action.


Reply to this email directly or view it on GitHub.

@ffissore
Copy link
Contributor Author

Comment by fibasile
Sunday Jan 12, 2014 at 10:14 GMT


Personally I didn't try with audio.

Anyway, to compile audio support you need to edit bluez Makefile removing the --disable-audio flag. No idea if it compiles without errors.

@ffissore
Copy link
Contributor Author

Comment by fibasile
Sunday Jan 12, 2014 at 10:16 GMT


@dragom I tried to have it working as a beacon with two different dongles with no success. Can you paste the commands you are using?

@ffissore
Copy link
Contributor Author

Comment by dragom
Sunday Jan 12, 2014 at 10:44 GMT


@fibasile
I have problems that device is recognized as bluetooth.
This works with ubuntu but not on linino:
///
As root:

  1. Create the file:
    /etc/udev/rules.d/99-local-bluetooth.rules

  2. Add the following line to the file:
    SUBSYSTEM=="usb", ATTRS{idVendor}=="050d", ATTRS{idProduct}=="065a", RUN+="/bin/sh -c 'modprobe btusb; echo 050d 065a > /sys/bus/usb/drivers/btusb/new_id'"

  3. To pick up the change
    either
    Restart the udev service:
    /etc/init.d/udev restart
    or
    reboot
    //

So I manually activate when dongle is plugged in with:
root@DrYun:# hciconfig
root@DrYun:
# echo 050d 065a > /sys/bus/usb/drivers/btusb/new_id
root@DrYun:~# hciconfig
hci0: Type: BR/EDR Bus: USB
BD Address: 00:02:72:3E:1C:44 ACL MTU: 1021:8 SCO MTU: 64:1
UP RUNNING
RX bytes:495 acl:0 sco:0 events:22 errors:0
TX bytes:369 acl:0 sco:0 commands:22 errors:0

root@DrYun:# hciconfig hci0 up
root@DrYun:
# hciconfig hci0 leadv

@tigoe Will try to compile with removing --disable-audio and version of bluez 5.13, publish ipk so you can try

@ffissore
Copy link
Contributor Author

Comment by fibasile
Sunday Jan 12, 2014 at 10:56 GMT


@dragom thx. I used a CSR 4.0 dongle and another unbranded one, both work fine on the detection phase. But none of them shows up as iBeacon. I was using the raspberry pi tutorial from radius network for that.
I just saw a new tutorial from Adafruit (http://learn.adafruit.com/pibeacon-ibeacon-with-a-raspberry-pi), so I'll try again. Looks like issuing hciconfig hci0 noscan after your last command should do it.

@ffissore
Copy link
Contributor Author

Comment by dragom
Sunday Jan 12, 2014 at 11:35 GMT


@tigoe
https://github.com/dragom/linino/releases/tag/bluez513

@ffissore
Copy link
Contributor Author

Comment by fibasile
Sunday Jan 12, 2014 at 13:06 GMT


Great, I can confirm iBeacon is now working using your latest ipk build and the adafruit tutorial linked above.

The dongle is an IOGear bluetooth 4.0 adapter (http://www.iogear.com/product/GBU521/)

@ffissore
Copy link
Contributor Author

Comment by dragom
Sunday Jan 12, 2014 at 18:54 GMT


@fibasile
How do you make that system recognize adapter as bluetooth device?
This do not work for me :
SUBSYSTEM=="usb", ATTRS{idVendor}=="050d", ATTRS{idProduct}=="065a", RUN+="/bin/sh -c 'modprobe btusb; echo 050d 065a > /sys/bus/usb/drivers/btusb/new_id'"

@ffissore
Copy link
Contributor Author

Comment by fibasile
Sunday Jan 12, 2014 at 19:02 GMT


I just installed kmod-bluetooth ipk and plugged the device. Modprobe stuff
should be long gone in these recent versions of linux.

2014/1/12 Dragoslav Mlakar notifications@github.com

@fibasile https://github.com/fibasile
How do you make that system recognize adapter as bluetooth device?
This do not work for me :

SUBSYSTEM=="usb", ATTRS{idVendor}=="050d", ATTRS{idProduct}=="065a",
RUN+="/bin/sh -c 'modprobe btusb; echo 050d 065a >
/sys/bus/usb/drivers/btusb/new_id'"

Reply to this email directly or view it on GitHubhttps://github.com/arduino/linino/issues/21#issuecomment-32130217
.

Fiore Basile
Mobile. +39 3284576081
Email. fiore.basile@gmail.com
Twitter. @fibasile

@ffissore ffissore mentioned this issue Apr 30, 2014
ffissore added a commit to arduino/openwrt-packages-yun that referenced this issue May 12, 2014
This required
 - a bluez-* upgrade to 5.13 (thanks fibasile and dragom arduino/openwrt-yun#9 (comment))
 - a glib2 upgrade to 2.28.8 (required by bluez)
 - patching cwiid as it was using deprecated hci_remote_name() function from bluez-libs
ffissore added a commit to arduino/openwrt-packages-yun that referenced this issue May 12, 2014
This required
 - a bluez-* upgrade to 5.13 (thanks fibasile and dragom arduino/openwrt-yun#9 (comment))
 - a glib2 upgrade to 2.28.8 (required by bluez)
 - patching cwiid as it was using deprecated hci_remote_name() function from bluez-libs
ffissore added a commit to arduino/openwrt-packages-yun that referenced this issue May 13, 2014
This required
 - a bluez-* upgrade to 5.13 (thanks fibasile and dragom arduino/openwrt-yun#9 (comment))
 - a glib2 upgrade to 2.28.8 (required by bluez)
 - patching cwiid as it was using deprecated hci_remote_name() function from bluez-libs
ffissore added a commit to arduino/openwrt-packages-yun that referenced this issue May 14, 2014
This required
 - a bluez-* upgrade to 5.13 (thanks fibasile and dragom arduino/openwrt-yun#9 (comment))
 - a glib2 upgrade to 2.28.8 (required by bluez)
 - patching cwiid as it was using deprecated hci_remote_name() function from bluez-libs
ffissore added a commit to arduino/openwrt-packages-yun that referenced this issue Jun 11, 2014
This required
 - a bluez-* upgrade to 5.13 (thanks fibasile and dragom arduino/openwrt-yun#9 (comment))
 - a glib2 upgrade to 2.28.8 (required by bluez)
 - patching cwiid as it was using deprecated hci_remote_name() function from bluez-libs
ffissore added a commit to arduino/openwrt-packages-yun that referenced this issue Jun 19, 2014
This required
 - a bluez-* upgrade to 5.13 (thanks fibasile and dragom arduino/openwrt-yun#9 (comment))
 - a glib2 upgrade to 2.28.8 (required by bluez)
 - patching cwiid as it was using deprecated hci_remote_name() function from bluez-libs
ffissore added a commit to arduino/openwrt-packages-yun that referenced this issue Jul 10, 2014
This required
 - a bluez-* upgrade to 5.13 (thanks fibasile and dragom arduino/openwrt-yun#9 (comment))
 - a glib2 upgrade to 2.28.8 (required by bluez)
 - patching cwiid as it was using deprecated hci_remote_name() function from bluez-libs
ffissore added a commit to arduino/openwrt-packages-yun that referenced this issue Jul 14, 2014
This required
 - a bluez-* upgrade to 5.13 (thanks fibasile and dragom arduino/openwrt-yun#9 (comment))
 - a glib2 upgrade to 2.28.8 (required by bluez)
 - patching cwiid as it was using deprecated hci_remote_name() function from bluez-libs
ffissore added a commit to arduino/openwrt-packages-yun that referenced this issue Jul 15, 2014
This required
 - a bluez-* upgrade to 5.13 (thanks fibasile and dragom arduino/openwrt-yun#9 (comment))
 - a glib2 upgrade to 2.28.8 (required by bluez)
 - patching cwiid as it was using deprecated hci_remote_name() function from bluez-libs
ffissore added a commit to arduino/openwrt-packages-yun that referenced this issue Aug 6, 2014
This required
 - a bluez-* upgrade to 5.13 (thanks fibasile and dragom arduino/openwrt-yun#9 (comment))
 - a glib2 upgrade to 2.28.8 (required by bluez)
 - patching cwiid as it was using deprecated hci_remote_name() function from bluez-libs
ffissore added a commit to arduino/openwrt-packages-yun that referenced this issue Aug 26, 2014
This required
 - a bluez-* upgrade to 5.13 (thanks fibasile and dragom arduino/openwrt-yun#9 (comment))
 - a glib2 upgrade to 2.28.8 (required by bluez)
 - patching cwiid as it was using deprecated hci_remote_name() function from bluez-libs
ffissore added a commit to arduino/openwrt-packages-yun that referenced this issue Sep 10, 2014
This required
 - a bluez-* upgrade to 5.13 (thanks fibasile and dragom arduino/openwrt-yun#9 (comment))
 - a glib2 upgrade to 2.28.8 (required by bluez)
 - patching cwiid as it was using deprecated hci_remote_name() function from bluez-libs
ffissore added a commit to arduino/openwrt-packages-yun that referenced this issue Sep 15, 2014
This required
 - a bluez-* upgrade to 5.13 (thanks fibasile and dragom arduino/openwrt-yun#9 (comment))
 - a glib2 upgrade to 2.28.8 (required by bluez)
 - patching cwiid as it was using deprecated hci_remote_name() function from bluez-libs
ffissore added a commit to arduino/openwrt-packages-yun that referenced this issue Sep 15, 2014
This required
 - a bluez-* upgrade to 5.13 (thanks fibasile and dragom arduino/openwrt-yun#9 (comment))
 - a glib2 upgrade to 2.28.8 (required by bluez)
 - patching cwiid as it was using deprecated hci_remote_name() function from bluez-libs
ffissore added a commit to arduino/openwrt-packages-yun that referenced this issue Sep 23, 2014
This required
 - a bluez-* upgrade to 5.13 (thanks fibasile and dragom arduino/openwrt-yun#9 (comment))
 - a glib2 upgrade to 2.28.8 (required by bluez)
 - patching cwiid as it was using deprecated hci_remote_name() function from bluez-libs
ffissore added a commit to arduino/openwrt-packages-yun that referenced this issue Sep 26, 2014
This required
 - a bluez-* upgrade to 5.13 (thanks fibasile and dragom arduino/openwrt-yun#9 (comment))
 - a glib2 upgrade to 2.28.8 (required by bluez)
 - patching cwiid as it was using deprecated hci_remote_name() function from bluez-libs
ffissore added a commit to arduino/openwrt-packages-yun that referenced this issue Oct 2, 2014
This required
 - a bluez-* upgrade to 5.13 (thanks fibasile and dragom arduino/openwrt-yun#9 (comment))
 - a glib2 upgrade to 2.28.8 (required by bluez)
 - patching cwiid as it was using deprecated hci_remote_name() function from bluez-libs
ffissore added a commit to arduino/openwrt-packages-yun that referenced this issue Oct 14, 2014
This required
 - a bluez-* upgrade to 5.13 (thanks fibasile and dragom arduino/openwrt-yun#9 (comment))
 - a glib2 upgrade to 2.28.8 (required by bluez)
 - patching cwiid as it was using deprecated hci_remote_name() function from bluez-libs
ffissore added a commit to arduino/openwrt-packages-yun that referenced this issue Oct 16, 2014
This required
 - a bluez-* upgrade to 5.13 (thanks fibasile and dragom arduino/openwrt-yun#9 (comment))
 - a glib2 upgrade to 2.28.8 (required by bluez)
 - patching cwiid as it was using deprecated hci_remote_name() function from bluez-libs
ffissore added a commit to arduino/openwrt-packages-yun that referenced this issue Oct 24, 2014
This required
 - a bluez-* upgrade to 5.13 (thanks fibasile and dragom arduino/openwrt-yun#9 (comment))
 - a glib2 upgrade to 2.28.8 (required by bluez)
 - patching cwiid as it was using deprecated hci_remote_name() function from bluez-libs
ffissore added a commit to arduino/openwrt-packages-yun that referenced this issue Oct 31, 2014
This required
 - a bluez-* upgrade to 5.13 (thanks fibasile and dragom arduino/openwrt-yun#9 (comment))
 - a glib2 upgrade to 2.28.8 (required by bluez)
 - patching cwiid as it was using deprecated hci_remote_name() function from bluez-libs
ffissore added a commit to arduino/openwrt-packages-yun that referenced this issue Mar 6, 2015
This required
 - a bluez-* upgrade to 5.13 (thanks fibasile and dragom arduino/openwrt-yun#9 (comment))
 - a glib2 upgrade to 2.28.8 (required by bluez)
 - patching cwiid as it was using deprecated hci_remote_name() function from bluez-libs
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant