• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

alessandroaime/homebridge-ueboom: Homebridge plugin for UE Boom speakers.

原作者: [db:作者] 来自: 网络 收藏 邀请

开源软件名称:

alessandroaime/homebridge-ueboom

开源软件地址:

https://github.com/alessandroaime/homebridge-ueboom

开源编程语言:

JavaScript 100.0%

开源软件介绍:

Homebridge UE Boom (Speaker Plugin)

This is an accessory plugin for Homebridge allowing to turn on and off a UE Boom speaker and integrating it with HomeKit.

Installation

Homebridge

First, install Homebridge and gatttool via Bluez (you also need Node.js installed):

sudo npm install -g homebridge
sudo apt-get install bluez

Then install this plugin:

sudo npm install -g homebridge-ueboom

Homebridge Docker

In case you're using Homebridge Docker, add the following line to your container startup script:

apk add --no-cache bluez-deprecated

Then install this plugin:

sudo npm install -g homebridge-ueboom

Find out the MAC address

To get the plugin working you have to provide the following parameters:

  • speaker: MAC address of the speaker
  • host: MAC address of the music source device (iPhone, ...)

In case you don't know how to retrieve the MAC address of the speaker:

  1. Pair the speaker to your MacBook
  2. Click on Bluetooth icon in the Menu Bar while pressing ⌥ Option
  3. Select the speaker of which you need the address
  4. Write down the MAC address

To retrieve the MAC address of the host, it strictly depends on the device you're using. If you're playing music from an iPhone/iPad then you can find it in Settings > General > About > Bluetooth.

Configuration

Create a ~/.homebridge/config.json file (change name, speaker and host as necessary):

{
  "bridge": {
    "name": "Homebridge",
    "username": "E5:B9:0D:64:1E:CB",
    "port": 51826,
    "pin": "031-45-154"
  },
  "description": "This is an example configuration file with homebridge-ueboom plugin.",
  "accessories": [
    {
      "accessory": "UEBoomSpeaker",
      "name": "Bathroom Speaker",
      "speaker": "C0:28:8D:45:28:55",
      "host": "4098ADA356C4"
    }
  ],
  "platforms": []
}

Breaking change: in case you're transitioning from v0.0.1 or v0.0.2, update your config file with the newly requested variables!

How does it work

Since more than one person asked me how this works and that the speaker doesn't connect to the Pi after being turned on, I thought I could spend a couple of words about.

This is the command that does the whole work, everything else is just boilerplate code for the homebridge plugin:

gatttool -i hci0 -b $SPEAKER_ADDRESS --char-write-req -a 0x0003 -n ${HOST_ADDRESS}01

The gatttool command turns the speaker on but doesn’t associate the speaker with the Raspberry Pi. The speaker connects to the host device (in my case my iPhone).

I don't know the exact specifications so this is pure speculation: the speaker itself has the usual Bluetooth 4.0 module that allows to stream music, in addition to that there's also a BLE (Bluetooth Low Energy) module that for its own nature is always on and allows to turn the speaker on and off remotely (within range). The only reason why I'm not sure this is the real reason is that the two modules would probably have two separate MAC addresses, and from what I've observed there's only one single address available.

How I did it

I knew that the speaker could be turned on remotely (within range) using the proprietary Ultimate Ears app, and it was obvious that the bluetooth command was sent by the application itself.

I first installed Apple's Bluetooth logging profile on my iPhone, then connected it to the Mac via USB and used PacketLogger to trace the packages sent from the phone (specifically ATT Send type). By opening the UE app and tapping on the remote power button in it I was able to sniff the conversation between the phone and the speaker as shown in this screenshot.

packetLoggerScreenshot

From here I retrieved the MAC address of the speaker (as described above) and used gatttool to perform a write request, and BOOM I can turn on the speaker from my command line.

Contributors

Special thanks go to:




鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap