Coder Social home page Coder Social logo

mqtt2ble's Introduction

MQTT2BLE

A way to bridge MQTT topics to BLE Gatt characteristics

run: node index.js -c config.js

Where config.js looks like this:

module.exports = {
  broker: "mqtt://localhost",
  topic: "some/topic"
} 

The primary serivce UUID is

ba42561bb1d2440a8d040cefb43faece

and the topic charactristic is

6bcb06e2747542a9a62a54a1f3ce11e6

Background

There is a blog post that describes how I built this code here: http://www.hardill.me.uk/wordpress/2015/07/28/building-bluetooth-le-devices/

And another post about building a simple Android App to work with it here: http://www.hardill.me.uk/wordpress/2015/08/11/mqtt2ble-android-test-app/

Known issues

You have to be careful that the payload fits in the MTU

Running without root/sudo

Run the following command in the directory you ran npm install from:

find -path '*bleno*Release/hci-ble' -exec sudo setcap cap_net_raw+eip '{}' \;

This grants bleno's hci-ble binary cap_net_raw privileges, so it can start/stop BLE advertising.

Note: The above command requires setcap to be installed, it can be installed using the following:

  • apt: sudo apt-get install libcap2-bin
  • yum: su -c \'yum install libcap2-bin\'

mqtt2ble's People

Contributors

hardillb avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.