{"id":187,"date":"2022-02-24T10:21:20","date_gmt":"2022-02-24T10:21:20","guid":{"rendered":"https:\/\/www.bleuio.com\/blog\/?p=187"},"modified":"2022-07-01T10:26:13","modified_gmt":"2022-07-01T10:26:13","slug":"send-ble-sensor-data-over-mqtt-using-bleuio","status":"publish","type":"post","link":"https:\/\/www.bleuio.com\/blog\/send-ble-sensor-data-over-mqtt-using-bleuio\/","title":{"rendered":"Send BLE sensor data over MQTT using BleuIO"},"content":{"rendered":"\n<p>We\u2019re living in the world of connected devices. The internet of things helps us live and work smarter, as well as gain complete control over our lives. One of the latest technological advancements in IoT is the MQTT gateway, which acts as a mediator between the cloud and IoT platforms.<\/p>\n\n\n\n<p>MQTT&nbsp;stands for Message Queuing Telemetry Transport. It\u2019s among the key communication protocols for the internet of things devices and local networks. It\u2019s an ideal protocol for communication between smart devices or machine-to-machine communication.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\"><strong>What Is MQTT Gateway?<\/strong><\/h3>\n\n\n\n<p>Generally, the MQTT gateway can be defined as an intermediary between any internet of things platform and sensors. It works by getting data from these sensors or smart devices and translating it into MQTT. It then transmits that data to either the internet of things platform or to the MQTT broker.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\"><strong>The publish\/subscribe pattern<\/strong><\/h3>\n\n\n\n<p>The publish\/subscribe pattern (also known as pub\/sub) provides an alternative to a traditional client-server architecture. In the client-server model, a client communicates directly with an endpoint. The pub\/sub model decouples the client that sends a message (the publisher) from the client or clients that receive the messages (the subscribers). The publishers and subscribers never contact each other directly. In fact, they are not even aware that the other exists. The connection between them is handled by a third component (the broker). The job of the broker is to filter all incoming messages and distribute them correctly to subscribers.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\"><strong>MQTT Broker<\/strong><\/h3>\n\n\n\n<p>A broker helps in handling clients in MQTT technology. It can manage hundreds, thousands, or millions of connected MQTT clients at once, depending on the implementation. Its main functions are;<\/p>\n\n\n\n<ul class=\"wp-block-list\"><li>Receiving information<\/li><li>Decoding and filtering the messages received<\/li><li>Determining which client will be interested in which message<\/li><li>Transmitting these messages to clients depending on their interests<\/li><\/ul>\n\n\n\n<h3 class=\"wp-block-heading\"><strong>The project<\/strong><\/h3>\n\n\n\n<p>Let\u2019s make a simple BLE 2 MQTT project that collects sensor data from a BLE&nbsp;<a rel=\"noreferrer noopener\" href=\"https:\/\/www.hibouair.com\/\" target=\"_blank\">Air quality monitor device called HibouAir<\/a>&nbsp;and sends it to a free public MQTT broker.<\/p>\n\n\n\n<p>For this project, we will use Flespi. You can choose any public or private MQTT broker as you like.<\/p>\n\n\n\n<p><strong>Steps<\/strong><\/p>\n\n\n\n<p><strong>Requirments&nbsp;<\/strong><\/p>\n\n\n\n<ul class=\"wp-block-list\"><li>A&nbsp;<a rel=\"noreferrer noopener\" href=\"https:\/\/www.bleuio.com\/\" target=\"_blank\">BleuIO&nbsp;<\/a>dongle.<\/li><li>A&nbsp;<a href=\"https:\/\/www.hibouair.com\/\" target=\"_blank\" rel=\"noreferrer noopener\">air quality monitor device HibouAir<\/a>.<\/li><li>A public MQTT broker (Flepsi token) https:\/\/flespi.com\/mqtt-broker<\/li><li>BleuIO Javascript library. https:\/\/www.npmjs.com\/package\/bleuio<\/li><li>A build tool for Javascript (parcel) https:\/\/parceljs.org\/docs\/<\/li><\/ul>\n\n\n\n<p><strong>Get the Flespi token<\/strong><\/p>\n\n\n\n<ul class=\"wp-block-list\"><li>Create an account at Flespi.<\/li><li>Log into the Flespi dashboard.<\/li><li>Copy the token<\/li><\/ul>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"78\" src=\"https:\/\/www.bleuio.com\/blog\/wp-content\/uploads\/2022\/02\/image-3-1024x78-1.png\" alt=\"\" class=\"wp-image-188\" srcset=\"https:\/\/www.bleuio.com\/blog\/wp-content\/uploads\/2022\/02\/image-3-1024x78-1.png 1024w, https:\/\/www.bleuio.com\/blog\/wp-content\/uploads\/2022\/02\/image-3-1024x78-1-300x23.png 300w, https:\/\/www.bleuio.com\/blog\/wp-content\/uploads\/2022\/02\/image-3-1024x78-1-768x59.png 768w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><\/figure>\n\n\n\n<p><\/p>\n\n\n\n<p><strong>Download source file<\/strong><\/p>\n\n\n\n<p>Get the source file from https:\/\/github.com\/smart-sensor-devices-ab\/ble2mqtt_bleuio.git<\/p>\n\n\n\n<p>And run&nbsp;<strong>npm install<\/strong><\/p>\n\n\n\n<p>In the root folder, we will see two Html files called index.html and subscribe.html and two js files called pub.js and sub.js<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"669\" height=\"315\" src=\"https:\/\/www.bleuio.com\/blog\/wp-content\/uploads\/2022\/02\/image-4.png\" alt=\"\" class=\"wp-image-189\" srcset=\"https:\/\/www.bleuio.com\/blog\/wp-content\/uploads\/2022\/02\/image-4.png 669w, https:\/\/www.bleuio.com\/blog\/wp-content\/uploads\/2022\/02\/image-4-300x141.png 300w\" sizes=\"auto, (max-width: 669px) 100vw, 669px\" \/><\/figure>\n\n\n\n<p><\/p>\n\n\n\n<p>Index.html file collects sensor data from a BLE Air quality monitor device called <strong>HibouAir <\/strong>with the help of <strong>BleuIO<\/strong>. It has three buttons. connect, device info and Scan and Send BLE Data. <\/p>\n\n\n\n<p>First we need to connect a BleuIO dongle into the computer and connect to it using connect button. The device info button will show BleuIO dongle status on console log. And the Scan and Send BLE data will scan for Air quality data and send it to the cloud. For this script I am scanning and collecting a fixed device with the board id of  <strong>0578E0<\/strong>. You can change the value in pub.js file line number 4<\/p>\n\n\n\n<p>Here is the index.html file<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>&lt;!DOCTYPE html&gt;\n&lt;html lang=\"en\"&gt;\n  &lt;head&gt;\n    &lt;meta charset=\"UTF-8\" \/&gt;\n    &lt;meta http-equiv=\"X-UA-Compatible\" content=\"IE=edge\" \/&gt;\n    &lt;meta name=\"viewport\" content=\"width=device-width, initial-scale=1.0\" \/&gt;\n    &lt;link\n      href=\"https:\/\/cdn.jsdelivr.net\/npm\/bootstrap@5.1.3\/dist\/css\/bootstrap.min.css\"\n      rel=\"stylesheet\"\n      integrity=\"sha384-1BmE4kWBq78iYhFldvKuhfTAU6auU8tT94WrHftjDbrCEXSU1oBoqyl2QvZ6jIW3\"\n      crossorigin=\"anonymous\"\n    \/&gt;\n    &lt;title&gt;Publish&lt;\/title&gt;\n  &lt;\/head&gt;\n  &lt;body&gt;\n    &lt;div class=\"container mt-5\"&gt;\n      &lt;button id=\"connect\" class=\"btn btn-secondary\"&gt;Connect&lt;\/button&gt;\n      &lt;button id=\"deviceinfo\" class=\"btn btn-success d-none\"&gt;\n        Device Info\n      &lt;\/button&gt;\n      &lt;button id=\"sendData\" class=\"btn btn-primary\"&gt;\n        Scan and Send BLE Data\n      &lt;\/button&gt;\n\n      &lt;h3 class=\"mt-5\"&gt;Message Sent&lt;\/h3&gt;\n      &lt;div id=\"output\"&gt;&lt;\/div&gt;\n    &lt;\/div&gt;\n  &lt;\/body&gt;\n  &lt;script src=\".\/pub.js\"&gt;&lt;\/script&gt;\n&lt;\/html&gt;<\/code><\/pre>\n\n\n\n<p>After collecting advertised data, we try to decode it and get meaningful air quality data with co2, pressure, temperature, humidity, light values. Then we publish the data to Flepsi broker using topic name HibouAirTopic<\/p>\n\n\n\n<p>The process is done in pub.js file.<\/p>\n\n\n\n<p>Here is the pub.js file<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>const clientId = 'hibouair_' + Math.random().toString(16).substr(2, 8)\nimport * as my_dongle from 'bleuio'\nimport 'regenerator-runtime\/runtime'\nconst sensorID = '0578E0'\nimport * as mqtt from \"mqtt\" \ndocument.getElementById('connect').addEventListener('click', function(){\n  my_dongle.at_connect()\n})\ndocument.getElementById('deviceinfo').addEventListener('click', function(){\n  my_dongle.ati().then((data)=&gt;console.log(data))\n})\n\nconst getTheBLEData = ( async()=&gt;{\n  return my_dongle.at_dual().then(()=&gt;{\n    return my_dongle.at_findscandata(sensorID,6).then((x)=&gt;{\n      let advData = x&#91;x.length - 1].split(\" \").pop()\n      let positionOfID= advData.indexOf(sensorID);\n      let tempHex = advData.substring(positionOfID+14, positionOfID+18)\n      let temp = parseInt('0x'+tempHex.match(\/..\/g).reverse().join(''))\/10;\n\n      let pressHex = advData.substring(positionOfID+10, positionOfID+14)\n      let press = parseInt('0x'+pressHex.match(\/..\/g).reverse().join(''))\/10;\n\n      let humHex = advData.substring(positionOfID+18, positionOfID+22)\n      let hum = parseInt('0x'+humHex.match(\/..\/g).reverse().join(''))\/10;\n\n      let lightHex = advData.substring(positionOfID+6, positionOfID+10)\n      let light = parseInt('0x'+lightHex.match(\/..\/g).reverse().join(''));\n\n      let co2Hex = advData.substring(positionOfID+38, positionOfID+42)\n      let co2 = parseInt('0x'+co2Hex);\n      \n\n      return {\n        'CO2' :co2,\n        'Temp' :temp,\n        'Pressure':press,\n        'Humidity':hum,        \n        'Light':light,        \n      }\n    })\n  })\n})\n\n\n\n\/\/pass data\ndocument.getElementById('sendData').addEventListener('click', function(){\n    const host = 'wss:\/\/mqtt.flespi.io:443'\n\n    const options = {\n      keepalive: 60,\n      clientId: clientId,\n      protocolId: 'MQTT',\n      username:'SET_YOUR_USERNAME',\n      password:'SET_YOUR_PASSWORD',\n      protocolVersion: 4,\n      clean: true,\n      reconnectPeriod: 1000,\n      connectTimeout: 30 * 1000,\n      will: {\n        topic: 'HibouAirMsg',\n        payload: 'Connection Closed abnormally..!',\n        qos: 0,\n        retain: false\n      },\n    }\n    const client  = mqtt.connect(host, options)\n    client.on('connect',()=&gt;{\n        console.log('connected mqtt client',clientId)\n\n    })\n\n    client.on('error', (err) =&gt; {\n      console.log('Connection error: ', err)\n      client.end()\n    })\n\n    client.on('reconnect', () =&gt; {\n      console.log('Reconnecting...')\n    })\n\n    var topic = 'HibouAirTopic'\n\n    \/\/ Publish\n    setInterval(() =&gt; {\n\n        getTheBLEData().then((x)=&gt;{\n          client.publish(topic, JSON.stringify(x), { qos: 0, retain: false })\n        console.log(\"Message sent!\", JSON.stringify(x));\n        document.getElementById('output').innerHTML += JSON.stringify(x)+\"&lt;br&gt;\";\n        })\n      }, 5000);\n\n    })<\/code><\/pre>\n\n\n\n<p>Make sure to set your username and password and change the Board ID of your device on pub.js file.<\/p>\n\n\n\n<p>Subscribe.html file works as a subscriber which reads sensor data from the broker and shows it on the screen.<\/p>\n\n\n\n<p>here is the subscribe.html file<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>&lt;!DOCTYPE html&gt;\n&lt;html lang=\"en\"&gt;\n  &lt;head&gt;\n    &lt;meta charset=\"UTF-8\" \/&gt;\n    &lt;meta http-equiv=\"X-UA-Compatible\" content=\"IE=edge\" \/&gt;\n    &lt;meta name=\"viewport\" content=\"width=device-width, initial-scale=1.0\" \/&gt;\n    &lt;title&gt;Subscribe&lt;\/title&gt;\n  &lt;\/head&gt;\n  &lt;body&gt;\n    &lt;h3&gt;Message Received&lt;\/h3&gt;\n    &lt;div id=\"output\"&gt;&lt;\/div&gt;\n  &lt;\/body&gt;\n  &lt;script src=\"https:\/\/unpkg.com\/mqtt\/dist\/mqtt.min.js\"&gt;&lt;\/script&gt;\n\n  &lt;script src=\"sub.js\"&gt;&lt;\/script&gt;\n&lt;\/html&gt;<\/code><\/pre>\n\n\n\n<p>Again we need a js script that fetch data from cloud and show it on html file. Here is the sub.js file<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>const clientId = 'hibouair_' + Math.random().toString(16).substr(2, 8)\n\n\/\/const host = 'ws:\/\/broker.emqx.io:8083\/mqtt'\nconst host = 'wss:\/\/mqtt.flespi.io:443'\n\nconst options = {\n  keepalive: 60,\n  clientId: clientId,\n  protocolId: 'MQTT',\n  username:'YOUR_USERNAME',\n  password:'YOUR_PASSWORD',\n  protocolVersion: 4,\n  clean: true,\n  reconnectPeriod: 1000,\n  connectTimeout: 30 * 1000,\n  will: {\n    topic: 'HibouAirMsg',\n    payload: 'Connection Closed abnormally..!',\n    qos: 0,\n    retain: false\n  },\n}\n\nconst client = mqtt.connect(host, options)\nclient.on('connect',()=&gt;{\n  console.log('connected mqtt client',clientId)\n  client.subscribe('HibouAirTopic', { qos: 0 })\n})\nclient.on('error', (err) =&gt; {\n  console.log('Connection error: ', err)\n  client.end()\n})\n\nclient.on('reconnect', () =&gt; {\n  console.log('Reconnecting...')\n})\n\n\n  \n  \/\/ Received\nclient.on('message', (topic, message, packet) =&gt; {\n  console.log(JSON.parse(message))\n  \/\/console.log('Received Message: ' + message + '\\nOn topic: ' + topic)\n  document.getElementById('output').innerHTML += message.toString()+\"&lt;br&gt;\";\n\n})\n<\/code><\/pre>\n\n\n\n<p>To run the index.html we can just type<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>parcel index.html<\/code><\/pre>\n\n\n\n<p>Parcel JS can be installed from https:\/\/parceljs.org\/<\/p>\n\n\n\n<p><strong>Project Video<\/strong><\/p>\n\n\n\n<figure class=\"wp-block-embed is-type-video is-provider-youtube wp-block-embed-youtube wp-embed-aspect-16-9 wp-has-aspect-ratio\"><div class=\"wp-block-embed__wrapper\">\n<iframe loading=\"lazy\" title=\"Sends BLE sensor data to MQTT  using Javascript\" width=\"640\" height=\"360\" src=\"https:\/\/www.youtube.com\/embed\/iXGdEljgODY?feature=oembed\" frameborder=\"0\" allow=\"accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share\" referrerpolicy=\"strict-origin-when-cross-origin\" allowfullscreen><\/iframe>\n<\/div><\/figure>\n","protected":false},"excerpt":{"rendered":"<p>We\u2019re living in the world of connected devices. The internet of things helps us live and work smarter, as well as gain complete control over our lives. One of the latest technological advancements in IoT is the MQTT gateway, which acts as a mediator between the cloud and IoT platforms. MQTT&nbsp;stands for Message Queuing Telemetry [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":190,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1,2],"tags":[],"class_list":["post-187","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-bleuio","category-bleuio-tutorial"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v27.6 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>Send BLE sensor data over MQTT using BleuIO - BleuIO - Create Bluetooth Low Energy application<\/title>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/www.bleuio.com\/blog\/send-ble-sensor-data-over-mqtt-using-bleuio\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Send BLE sensor data over MQTT using BleuIO - BleuIO - Create Bluetooth Low Energy application\" \/>\n<meta property=\"og:description\" content=\"We\u2019re living in the world of connected devices. The internet of things helps us live and work smarter, as well as gain complete control over our lives. One of the latest technological advancements in IoT is the MQTT gateway, which acts as a mediator between the cloud and IoT platforms. MQTT&nbsp;stands for Message Queuing Telemetry [&hellip;]\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.bleuio.com\/blog\/send-ble-sensor-data-over-mqtt-using-bleuio\/\" \/>\n<meta property=\"og:site_name\" content=\"BleuIO - Create Bluetooth Low Energy application\" \/>\n<meta property=\"article:published_time\" content=\"2022-02-24T10:21:20+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2022-07-01T10:26:13+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/www.bleuio.com\/blog\/wp-content\/uploads\/2022\/02\/ble-to-mqtt.jpg\" \/>\n\t<meta property=\"og:image:width\" content=\"674\" \/>\n\t<meta property=\"og:image:height\" content=\"478\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/jpeg\" \/>\n<meta name=\"author\" content=\"BleuIO\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\\\/\\\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\\\/\\\/www.bleuio.com\\\/blog\\\/send-ble-sensor-data-over-mqtt-using-bleuio\\\/#article\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/www.bleuio.com\\\/blog\\\/send-ble-sensor-data-over-mqtt-using-bleuio\\\/\"},\"author\":{\"name\":\"BleuIO\",\"@id\":\"https:\\\/\\\/www.bleuio.com\\\/blog\\\/#\\\/schema\\\/person\\\/89bc581382d5964043f96efc54b75b80\"},\"headline\":\"Send BLE sensor data over MQTT using BleuIO\",\"datePublished\":\"2022-02-24T10:21:20+00:00\",\"dateModified\":\"2022-07-01T10:26:13+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\\\/\\\/www.bleuio.com\\\/blog\\\/send-ble-sensor-data-over-mqtt-using-bleuio\\\/\"},\"wordCount\":735,\"commentCount\":0,\"image\":{\"@id\":\"https:\\\/\\\/www.bleuio.com\\\/blog\\\/send-ble-sensor-data-over-mqtt-using-bleuio\\\/#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/www.bleuio.com\\\/blog\\\/wp-content\\\/uploads\\\/2022\\\/02\\\/ble-to-mqtt.jpg\",\"articleSection\":[\"BleuIO\",\"BleuIO tutorial\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\\\/\\\/www.bleuio.com\\\/blog\\\/send-ble-sensor-data-over-mqtt-using-bleuio\\\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/www.bleuio.com\\\/blog\\\/send-ble-sensor-data-over-mqtt-using-bleuio\\\/\",\"url\":\"https:\\\/\\\/www.bleuio.com\\\/blog\\\/send-ble-sensor-data-over-mqtt-using-bleuio\\\/\",\"name\":\"Send BLE sensor data over MQTT using BleuIO - BleuIO - Create Bluetooth Low Energy application\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/www.bleuio.com\\\/blog\\\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\\\/\\\/www.bleuio.com\\\/blog\\\/send-ble-sensor-data-over-mqtt-using-bleuio\\\/#primaryimage\"},\"image\":{\"@id\":\"https:\\\/\\\/www.bleuio.com\\\/blog\\\/send-ble-sensor-data-over-mqtt-using-bleuio\\\/#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/www.bleuio.com\\\/blog\\\/wp-content\\\/uploads\\\/2022\\\/02\\\/ble-to-mqtt.jpg\",\"datePublished\":\"2022-02-24T10:21:20+00:00\",\"dateModified\":\"2022-07-01T10:26:13+00:00\",\"author\":{\"@id\":\"https:\\\/\\\/www.bleuio.com\\\/blog\\\/#\\\/schema\\\/person\\\/89bc581382d5964043f96efc54b75b80\"},\"breadcrumb\":{\"@id\":\"https:\\\/\\\/www.bleuio.com\\\/blog\\\/send-ble-sensor-data-over-mqtt-using-bleuio\\\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\\\/\\\/www.bleuio.com\\\/blog\\\/send-ble-sensor-data-over-mqtt-using-bleuio\\\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/www.bleuio.com\\\/blog\\\/send-ble-sensor-data-over-mqtt-using-bleuio\\\/#primaryimage\",\"url\":\"https:\\\/\\\/www.bleuio.com\\\/blog\\\/wp-content\\\/uploads\\\/2022\\\/02\\\/ble-to-mqtt.jpg\",\"contentUrl\":\"https:\\\/\\\/www.bleuio.com\\\/blog\\\/wp-content\\\/uploads\\\/2022\\\/02\\\/ble-to-mqtt.jpg\",\"width\":674,\"height\":478,\"caption\":\"ble to mqtt\"},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/www.bleuio.com\\\/blog\\\/send-ble-sensor-data-over-mqtt-using-bleuio\\\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\\\/\\\/www.bleuio.com\\\/blog\\\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Send BLE sensor data over MQTT using BleuIO\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\\\/\\\/www.bleuio.com\\\/blog\\\/#website\",\"url\":\"https:\\\/\\\/www.bleuio.com\\\/blog\\\/\",\"name\":\"BleuIO - Create Bluetooth Low Energy application\",\"description\":\"Learn Bluetooth Low Energy programming and build Bluetooth Low Energy Application\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\\\/\\\/www.bleuio.com\\\/blog\\\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Person\",\"@id\":\"https:\\\/\\\/www.bleuio.com\\\/blog\\\/#\\\/schema\\\/person\\\/89bc581382d5964043f96efc54b75b80\",\"name\":\"BleuIO\",\"sameAs\":[\"https:\\\/\\\/www.bleuio.com\\\/blog\"],\"url\":\"https:\\\/\\\/www.bleuio.com\\\/blog\\\/author\\\/biadmin\\\/\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Send BLE sensor data over MQTT using BleuIO - BleuIO - Create Bluetooth Low Energy application","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/www.bleuio.com\/blog\/send-ble-sensor-data-over-mqtt-using-bleuio\/","og_locale":"en_US","og_type":"article","og_title":"Send BLE sensor data over MQTT using BleuIO - BleuIO - Create Bluetooth Low Energy application","og_description":"We\u2019re living in the world of connected devices. The internet of things helps us live and work smarter, as well as gain complete control over our lives. One of the latest technological advancements in IoT is the MQTT gateway, which acts as a mediator between the cloud and IoT platforms. MQTT&nbsp;stands for Message Queuing Telemetry [&hellip;]","og_url":"https:\/\/www.bleuio.com\/blog\/send-ble-sensor-data-over-mqtt-using-bleuio\/","og_site_name":"BleuIO - Create Bluetooth Low Energy application","article_published_time":"2022-02-24T10:21:20+00:00","article_modified_time":"2022-07-01T10:26:13+00:00","og_image":[{"width":674,"height":478,"url":"https:\/\/www.bleuio.com\/blog\/wp-content\/uploads\/2022\/02\/ble-to-mqtt.jpg","type":"image\/jpeg"}],"author":"BleuIO","twitter_card":"summary_large_image","schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/www.bleuio.com\/blog\/send-ble-sensor-data-over-mqtt-using-bleuio\/#article","isPartOf":{"@id":"https:\/\/www.bleuio.com\/blog\/send-ble-sensor-data-over-mqtt-using-bleuio\/"},"author":{"name":"BleuIO","@id":"https:\/\/www.bleuio.com\/blog\/#\/schema\/person\/89bc581382d5964043f96efc54b75b80"},"headline":"Send BLE sensor data over MQTT using BleuIO","datePublished":"2022-02-24T10:21:20+00:00","dateModified":"2022-07-01T10:26:13+00:00","mainEntityOfPage":{"@id":"https:\/\/www.bleuio.com\/blog\/send-ble-sensor-data-over-mqtt-using-bleuio\/"},"wordCount":735,"commentCount":0,"image":{"@id":"https:\/\/www.bleuio.com\/blog\/send-ble-sensor-data-over-mqtt-using-bleuio\/#primaryimage"},"thumbnailUrl":"https:\/\/www.bleuio.com\/blog\/wp-content\/uploads\/2022\/02\/ble-to-mqtt.jpg","articleSection":["BleuIO","BleuIO tutorial"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/www.bleuio.com\/blog\/send-ble-sensor-data-over-mqtt-using-bleuio\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/www.bleuio.com\/blog\/send-ble-sensor-data-over-mqtt-using-bleuio\/","url":"https:\/\/www.bleuio.com\/blog\/send-ble-sensor-data-over-mqtt-using-bleuio\/","name":"Send BLE sensor data over MQTT using BleuIO - BleuIO - Create Bluetooth Low Energy application","isPartOf":{"@id":"https:\/\/www.bleuio.com\/blog\/#website"},"primaryImageOfPage":{"@id":"https:\/\/www.bleuio.com\/blog\/send-ble-sensor-data-over-mqtt-using-bleuio\/#primaryimage"},"image":{"@id":"https:\/\/www.bleuio.com\/blog\/send-ble-sensor-data-over-mqtt-using-bleuio\/#primaryimage"},"thumbnailUrl":"https:\/\/www.bleuio.com\/blog\/wp-content\/uploads\/2022\/02\/ble-to-mqtt.jpg","datePublished":"2022-02-24T10:21:20+00:00","dateModified":"2022-07-01T10:26:13+00:00","author":{"@id":"https:\/\/www.bleuio.com\/blog\/#\/schema\/person\/89bc581382d5964043f96efc54b75b80"},"breadcrumb":{"@id":"https:\/\/www.bleuio.com\/blog\/send-ble-sensor-data-over-mqtt-using-bleuio\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.bleuio.com\/blog\/send-ble-sensor-data-over-mqtt-using-bleuio\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.bleuio.com\/blog\/send-ble-sensor-data-over-mqtt-using-bleuio\/#primaryimage","url":"https:\/\/www.bleuio.com\/blog\/wp-content\/uploads\/2022\/02\/ble-to-mqtt.jpg","contentUrl":"https:\/\/www.bleuio.com\/blog\/wp-content\/uploads\/2022\/02\/ble-to-mqtt.jpg","width":674,"height":478,"caption":"ble to mqtt"},{"@type":"BreadcrumbList","@id":"https:\/\/www.bleuio.com\/blog\/send-ble-sensor-data-over-mqtt-using-bleuio\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/www.bleuio.com\/blog\/"},{"@type":"ListItem","position":2,"name":"Send BLE sensor data over MQTT using BleuIO"}]},{"@type":"WebSite","@id":"https:\/\/www.bleuio.com\/blog\/#website","url":"https:\/\/www.bleuio.com\/blog\/","name":"BleuIO - Create Bluetooth Low Energy application","description":"Learn Bluetooth Low Energy programming and build Bluetooth Low Energy Application","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.bleuio.com\/blog\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Person","@id":"https:\/\/www.bleuio.com\/blog\/#\/schema\/person\/89bc581382d5964043f96efc54b75b80","name":"BleuIO","sameAs":["https:\/\/www.bleuio.com\/blog"],"url":"https:\/\/www.bleuio.com\/blog\/author\/biadmin\/"}]}},"_links":{"self":[{"href":"https:\/\/www.bleuio.com\/blog\/wp-json\/wp\/v2\/posts\/187","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.bleuio.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.bleuio.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.bleuio.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.bleuio.com\/blog\/wp-json\/wp\/v2\/comments?post=187"}],"version-history":[{"count":4,"href":"https:\/\/www.bleuio.com\/blog\/wp-json\/wp\/v2\/posts\/187\/revisions"}],"predecessor-version":[{"id":377,"href":"https:\/\/www.bleuio.com\/blog\/wp-json\/wp\/v2\/posts\/187\/revisions\/377"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.bleuio.com\/blog\/wp-json\/wp\/v2\/media\/190"}],"wp:attachment":[{"href":"https:\/\/www.bleuio.com\/blog\/wp-json\/wp\/v2\/media?parent=187"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.bleuio.com\/blog\/wp-json\/wp\/v2\/categories?post=187"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.bleuio.com\/blog\/wp-json\/wp\/v2\/tags?post=187"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}