{"id":23,"date":"2020-10-27T12:20:23","date_gmt":"2020-10-27T12:20:23","guid":{"rendered":"https:\/\/www.bleuio.com\/blog\/?p=23"},"modified":"2022-01-24T14:54:36","modified_gmt":"2022-01-24T14:54:36","slug":"sending-and-receiving-data-between-two-bluetooth-dongle","status":"publish","type":"post","link":"https:\/\/www.bleuio.com\/blog\/sending-and-receiving-data-between-two-bluetooth-dongle\/","title":{"rendered":"Sending and receiving data between two Bluetooth dongle"},"content":{"rendered":"\n<p>In this project, we will demonstrate how two Bluetooth dongles can be paired together and share data between them. To pair two Bluetooth dongle, one of them needs to be configured as Central and other needs to be configured as Peripheral. We already wrote a Python script that sends data back and forth between dongles.<\/p>\n\n\n\n<p><strong>In short :<\/strong><\/p>\n\n\n\n<ol class=\"wp-block-list\" type=\"1\"><li>One dongle will take on the Central role and the other will take on the Peripheral role.<\/li><li>Then they will connect to each other.<\/li><li>The Central dongle will then start off sending a message; \u201cEcho\u201d.<\/li><li>The Peripheral dongle will then receive the message and send it back to the Central dongle which in turn will receive it and send it back and so forth until the script is stopped.<\/li><\/ol>\n\n\n\n<p><strong>Device Required:<\/strong><\/p>\n\n\n\n<ul class=\"wp-block-list\"><li>Laptop<\/li><li>2&nbsp;<a rel=\"noreferrer noopener\" href=\"https:\/\/www.bleuio.com\/\" target=\"_blank\">BleuIO<\/a>&nbsp;\u2013 BLE Dongle<\/li><\/ul>\n\n\n\n<p><strong>Software Tools Required :&nbsp;<\/strong><\/p>\n\n\n\n<ul class=\"wp-block-list\"><li><a href=\"https:\/\/ttssh2.osdn.jp\/index.html.en\" target=\"_blank\" rel=\"noreferrer noopener\">Tera Term<\/a><\/li><li><a href=\"https:\/\/www.python.org\/\" target=\"_blank\" rel=\"noreferrer noopener\">Python<\/a><\/li><\/ul>\n\n\n\n<p>Step 1 : Install&nbsp;<a href=\"https:\/\/www.python.org\/downloads\/\">Python<\/a>&nbsp;on both laptop and connect a USB Dongle on each of them.<\/p>\n\n\n\n<p>Step 2 : For a quick setup, copy the following script and save it on your local directory as sps_example.py . You can also get the source code from our&nbsp;<a href=\"https:\/\/github.com\/smart-sensor-devices-ab\/ssd005_example_scripts\/tree\/develop\/sps_example\" target=\"_blank\" rel=\"noreferrer noopener\">GITHUB PAGE<\/a>.<\/p>\n\n\n\n<p>Step 3: Change the COM-port in the script on both computers to match the ones your dongles is actually connected to. For the one that will be set up as the Central dongle you will also need to change the target_dongle_mac_address variable to the MAC address of your Peripheral dongle. You can get the MAC address by scanning for the other dongle while it\u2019s advertising. To learn more about how to scan check out our&nbsp;<a href=\"https:\/\/smart-sensor-devices-ab.github.io\/ssd005-manual\/docs\/scanscript\">scanning tutorial<\/a>.<\/p>\n\n\n\n<p>Step 4: Open up the command prompt, on both computers, in the directory where the script is located. Start the script by typing python sps_example.py and press Enter.<\/p>\n\n\n\n<p>Step 5: You should now be prompted to enter 1 or 2 depending on what role the dongle should have. Set one as Peripheral and the other as Central. It is advisable to setup the Peripheral first as the Central will need someone to connect to.<\/p>\n\n\n\n<p>You should now see in the terminal how the dongles send and recieve data to and from each other.<\/p>\n\n\n\n<p>The script will run until you stop it.<\/p>\n\n\n\n<p>And that is an example of how we can send data between two dongles. If you want to stop the script, you can simply press control C.<\/p>\n\n\n\n<p>Full source also available on&nbsp;<a href=\"https:\/\/github.com\/smart-sensor-devices-ab\/ssd005_example_scripts\/tree\/master\/sps_example\"><strong>GitHub<\/strong><\/a>.<\/p>\n\n\n\n<p>Project Video<\/p>\n\n\n\n<p><\/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=\"Sending and receiving data between two Bleutooth dongle\" width=\"640\" height=\"360\" src=\"https:\/\/www.youtube.com\/embed\/9jebjGuPeec?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>In this project, we will demonstrate how two Bluetooth dongles can be paired together and share data between them. To pair two Bluetooth dongle, one of them needs to be configured as Central and other needs to be configured as Peripheral. We already wrote a Python script that sends data back and forth between dongles. [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":24,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1,2],"tags":[],"class_list":["post-23","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>Sending and receiving data between two Bluetooth dongle - 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\/sending-and-receiving-data-between-two-bluetooth-dongle\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Sending and receiving data between two Bluetooth dongle - BleuIO - Create Bluetooth Low Energy application\" \/>\n<meta property=\"og:description\" content=\"In this project, we will demonstrate how two Bluetooth dongles can be paired together and share data between them. To pair two Bluetooth dongle, one of them needs to be configured as Central and other needs to be configured as Peripheral. We already wrote a Python script that sends data back and forth between dongles. [&hellip;]\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.bleuio.com\/blog\/sending-and-receiving-data-between-two-bluetooth-dongle\/\" \/>\n<meta property=\"og:site_name\" content=\"BleuIO - Create Bluetooth Low Energy application\" \/>\n<meta property=\"article:published_time\" content=\"2020-10-27T12:20:23+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2022-01-24T14:54:36+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/www.bleuio.com\/blog\/wp-content\/uploads\/2022\/01\/sps-datatransfer-1.gif\" \/>\n\t<meta property=\"og:image:width\" content=\"642\" \/>\n\t<meta property=\"og:image:height\" content=\"395\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/gif\" \/>\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\\\/sending-and-receiving-data-between-two-bluetooth-dongle\\\/#article\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/www.bleuio.com\\\/blog\\\/sending-and-receiving-data-between-two-bluetooth-dongle\\\/\"},\"author\":{\"name\":\"BleuIO\",\"@id\":\"https:\\\/\\\/www.bleuio.com\\\/blog\\\/#\\\/schema\\\/person\\\/89bc581382d5964043f96efc54b75b80\"},\"headline\":\"Sending and receiving data between two Bluetooth dongle\",\"datePublished\":\"2020-10-27T12:20:23+00:00\",\"dateModified\":\"2022-01-24T14:54:36+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\\\/\\\/www.bleuio.com\\\/blog\\\/sending-and-receiving-data-between-two-bluetooth-dongle\\\/\"},\"wordCount\":421,\"image\":{\"@id\":\"https:\\\/\\\/www.bleuio.com\\\/blog\\\/sending-and-receiving-data-between-two-bluetooth-dongle\\\/#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/www.bleuio.com\\\/blog\\\/wp-content\\\/uploads\\\/2022\\\/01\\\/sps-datatransfer-1.gif\",\"articleSection\":[\"BleuIO\",\"BleuIO tutorial\"],\"inLanguage\":\"en-US\"},{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/www.bleuio.com\\\/blog\\\/sending-and-receiving-data-between-two-bluetooth-dongle\\\/\",\"url\":\"https:\\\/\\\/www.bleuio.com\\\/blog\\\/sending-and-receiving-data-between-two-bluetooth-dongle\\\/\",\"name\":\"Sending and receiving data between two Bluetooth dongle - BleuIO - Create Bluetooth Low Energy application\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/www.bleuio.com\\\/blog\\\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\\\/\\\/www.bleuio.com\\\/blog\\\/sending-and-receiving-data-between-two-bluetooth-dongle\\\/#primaryimage\"},\"image\":{\"@id\":\"https:\\\/\\\/www.bleuio.com\\\/blog\\\/sending-and-receiving-data-between-two-bluetooth-dongle\\\/#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/www.bleuio.com\\\/blog\\\/wp-content\\\/uploads\\\/2022\\\/01\\\/sps-datatransfer-1.gif\",\"datePublished\":\"2020-10-27T12:20:23+00:00\",\"dateModified\":\"2022-01-24T14:54:36+00:00\",\"author\":{\"@id\":\"https:\\\/\\\/www.bleuio.com\\\/blog\\\/#\\\/schema\\\/person\\\/89bc581382d5964043f96efc54b75b80\"},\"breadcrumb\":{\"@id\":\"https:\\\/\\\/www.bleuio.com\\\/blog\\\/sending-and-receiving-data-between-two-bluetooth-dongle\\\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\\\/\\\/www.bleuio.com\\\/blog\\\/sending-and-receiving-data-between-two-bluetooth-dongle\\\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/www.bleuio.com\\\/blog\\\/sending-and-receiving-data-between-two-bluetooth-dongle\\\/#primaryimage\",\"url\":\"https:\\\/\\\/www.bleuio.com\\\/blog\\\/wp-content\\\/uploads\\\/2022\\\/01\\\/sps-datatransfer-1.gif\",\"contentUrl\":\"https:\\\/\\\/www.bleuio.com\\\/blog\\\/wp-content\\\/uploads\\\/2022\\\/01\\\/sps-datatransfer-1.gif\",\"width\":642,\"height\":395},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/www.bleuio.com\\\/blog\\\/sending-and-receiving-data-between-two-bluetooth-dongle\\\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\\\/\\\/www.bleuio.com\\\/blog\\\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Sending and receiving data between two Bluetooth dongle\"}]},{\"@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":"Sending and receiving data between two Bluetooth dongle - 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\/sending-and-receiving-data-between-two-bluetooth-dongle\/","og_locale":"en_US","og_type":"article","og_title":"Sending and receiving data between two Bluetooth dongle - BleuIO - Create Bluetooth Low Energy application","og_description":"In this project, we will demonstrate how two Bluetooth dongles can be paired together and share data between them. To pair two Bluetooth dongle, one of them needs to be configured as Central and other needs to be configured as Peripheral. We already wrote a Python script that sends data back and forth between dongles. [&hellip;]","og_url":"https:\/\/www.bleuio.com\/blog\/sending-and-receiving-data-between-two-bluetooth-dongle\/","og_site_name":"BleuIO - Create Bluetooth Low Energy application","article_published_time":"2020-10-27T12:20:23+00:00","article_modified_time":"2022-01-24T14:54:36+00:00","og_image":[{"width":642,"height":395,"url":"https:\/\/www.bleuio.com\/blog\/wp-content\/uploads\/2022\/01\/sps-datatransfer-1.gif","type":"image\/gif"}],"author":"BleuIO","twitter_card":"summary_large_image","schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/www.bleuio.com\/blog\/sending-and-receiving-data-between-two-bluetooth-dongle\/#article","isPartOf":{"@id":"https:\/\/www.bleuio.com\/blog\/sending-and-receiving-data-between-two-bluetooth-dongle\/"},"author":{"name":"BleuIO","@id":"https:\/\/www.bleuio.com\/blog\/#\/schema\/person\/89bc581382d5964043f96efc54b75b80"},"headline":"Sending and receiving data between two Bluetooth dongle","datePublished":"2020-10-27T12:20:23+00:00","dateModified":"2022-01-24T14:54:36+00:00","mainEntityOfPage":{"@id":"https:\/\/www.bleuio.com\/blog\/sending-and-receiving-data-between-two-bluetooth-dongle\/"},"wordCount":421,"image":{"@id":"https:\/\/www.bleuio.com\/blog\/sending-and-receiving-data-between-two-bluetooth-dongle\/#primaryimage"},"thumbnailUrl":"https:\/\/www.bleuio.com\/blog\/wp-content\/uploads\/2022\/01\/sps-datatransfer-1.gif","articleSection":["BleuIO","BleuIO tutorial"],"inLanguage":"en-US"},{"@type":"WebPage","@id":"https:\/\/www.bleuio.com\/blog\/sending-and-receiving-data-between-two-bluetooth-dongle\/","url":"https:\/\/www.bleuio.com\/blog\/sending-and-receiving-data-between-two-bluetooth-dongle\/","name":"Sending and receiving data between two Bluetooth dongle - BleuIO - Create Bluetooth Low Energy application","isPartOf":{"@id":"https:\/\/www.bleuio.com\/blog\/#website"},"primaryImageOfPage":{"@id":"https:\/\/www.bleuio.com\/blog\/sending-and-receiving-data-between-two-bluetooth-dongle\/#primaryimage"},"image":{"@id":"https:\/\/www.bleuio.com\/blog\/sending-and-receiving-data-between-two-bluetooth-dongle\/#primaryimage"},"thumbnailUrl":"https:\/\/www.bleuio.com\/blog\/wp-content\/uploads\/2022\/01\/sps-datatransfer-1.gif","datePublished":"2020-10-27T12:20:23+00:00","dateModified":"2022-01-24T14:54:36+00:00","author":{"@id":"https:\/\/www.bleuio.com\/blog\/#\/schema\/person\/89bc581382d5964043f96efc54b75b80"},"breadcrumb":{"@id":"https:\/\/www.bleuio.com\/blog\/sending-and-receiving-data-between-two-bluetooth-dongle\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.bleuio.com\/blog\/sending-and-receiving-data-between-two-bluetooth-dongle\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.bleuio.com\/blog\/sending-and-receiving-data-between-two-bluetooth-dongle\/#primaryimage","url":"https:\/\/www.bleuio.com\/blog\/wp-content\/uploads\/2022\/01\/sps-datatransfer-1.gif","contentUrl":"https:\/\/www.bleuio.com\/blog\/wp-content\/uploads\/2022\/01\/sps-datatransfer-1.gif","width":642,"height":395},{"@type":"BreadcrumbList","@id":"https:\/\/www.bleuio.com\/blog\/sending-and-receiving-data-between-two-bluetooth-dongle\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/www.bleuio.com\/blog\/"},{"@type":"ListItem","position":2,"name":"Sending and receiving data between two Bluetooth dongle"}]},{"@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\/23","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=23"}],"version-history":[{"count":1,"href":"https:\/\/www.bleuio.com\/blog\/wp-json\/wp\/v2\/posts\/23\/revisions"}],"predecessor-version":[{"id":25,"href":"https:\/\/www.bleuio.com\/blog\/wp-json\/wp\/v2\/posts\/23\/revisions\/25"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.bleuio.com\/blog\/wp-json\/wp\/v2\/media\/24"}],"wp:attachment":[{"href":"https:\/\/www.bleuio.com\/blog\/wp-json\/wp\/v2\/media?parent=23"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.bleuio.com\/blog\/wp-json\/wp\/v2\/categories?post=23"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.bleuio.com\/blog\/wp-json\/wp\/v2\/tags?post=23"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}