{"id":113,"date":"2021-11-26T14:27:38","date_gmt":"2021-11-26T14:27:38","guid":{"rendered":"https:\/\/www.bleuio.com\/blog\/?p=113"},"modified":"2022-07-01T10:37:18","modified_gmt":"2022-07-01T10:37:18","slug":"bluetooth-low-energy-ble-tutorial-for-beaglebone-using-bleuio","status":"publish","type":"post","link":"https:\/\/www.bleuio.com\/blog\/bluetooth-low-energy-ble-tutorial-for-beaglebone-using-bleuio\/","title":{"rendered":"Bluetooth Low Energy (BLE) Tutorial for Beaglebone using BleuIO"},"content":{"rendered":"\n<h2 class=\"wp-block-heading\">1. Introduction<\/h2>\n\n\n\n<p>This is a simple example showcasing how to control a BleuIO dongle connected to Beaglebone Black using a python script.<\/p>\n\n\n\n<p>When running the script, it will first ask for the com port where the dongle is connected (usually \u2018\/dev\/ttyACM0\u2019). After that, the BleuIO will start advertising. Every 8th second it will turn on one of the onboard Beaglebone Black LEDs whilst changing the BLE advertising name to indicate which LED is on.<\/p>\n\n\n\n<p>We are using the Linux debian image: \u2018OMAP3\/DM3730 Debian 9.5 2018-10-07 4GB SD LXQT\u2019 (<a href=\"https:\/\/beagleboard.org\/latest-images\">https:\/\/beagleboard.org\/latest-images<\/a>).<\/p>\n\n\n\n<figure class=\"wp-block-image\"><img decoding=\"async\" src=\"https:\/\/www.bleuio.com\/getting_started\/img\/beaglebone_black_example_img\/fw_img.png\" alt=\"alt text\"\/><\/figure>\n\n\n\n<h2 class=\"wp-block-heading\"><a href=\"https:\/\/www.bleuio.com\/getting_started\/docs\/beaglebone_example\/#2-about-the-code\"><\/a>2. About the Code<\/h2>\n\n\n\n<p>You can get access to the project&nbsp;<a href=\"https:\/\/github.com\/smart-sensor-devices-ab\/beaglebone_bleuio_example\"><strong>HERE<\/strong><\/a><br><a href=\"https:\/\/github.com\/smart-sensor-devices-ab\/beaglebone_bleuio_example\">https:\/\/github.com\/smart-sensor-devices-ab\/beaglebone_bleuio_example<\/a><\/p>\n\n\n\n<p>We are using the&nbsp;<strong>Adafruit_BBIO<\/strong>&nbsp;python library that comes with the Beaglebone to control the onboard LEDs. First we define the LEDs names and then set them as GPIO Outputs. Then we define the advertising messages that the BleuIO will switch between. Lets break one down:<\/p>\n\n\n\n<blockquote class=\"wp-block-quote is-layout-flow wp-block-quote-is-layout-flow\"><p><strong>\u201c10:09:42:6C:65:75:49:4F:20:4C:45:44:20:30:20:4F:4E:\u201d<\/strong><\/p><\/blockquote>\n\n\n\n<p><strong>\u201c10\u201d<\/strong>&nbsp;is the size of the advertising packet in HEX.<br><strong>\u201c09\u201d<\/strong>&nbsp;is the flag for device name (Complete Local Name).<br><strong>\u201c42:6C:65:75:49:4F:20:4C:45:44:20:30:20:4F:4E\u201d<\/strong>&nbsp;is the packet itself, translated from HEX to ASCII it says: \u201cBleuIO LED 0 ON\u201d<\/p>\n\n\n\n<p>Afterwards the user is presented with a message to input the com port the BleuIO is connected to. If you are not using a USB Hub the port should be \u2018\/dev\/ttyACM0\u2019.<\/p>\n\n\n\n<p>You can change the comport name in the Python script and fill in your COM port.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>com_input = \"\/dev\/ttyACM0\"<\/code><\/pre>\n\n\n\n<p>The script continues into the main loop, where it will first make sure all LEDs are off and then start BLE advertising.<\/p>\n\n\n\n<p>The loop iterates through all four LEDs. In every iteration it turns one LED on and advertise the LED name then continue to the next LED. This will continue until the script is aborted.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>import serial\nimport time\nimport Adafruit_BBIO.GPIO as GPIO\n\n\nLED_USR0 = \"USR0\"\nLED_USR1 = \"USR1\"\nLED_USR2 = \"USR2\"\nLED_USR3 = \"USR3\"\n\nGPIO.setup(LED_USR0, GPIO.OUT)\nGPIO.setup(LED_USR1, GPIO.OUT)\nGPIO.setup(LED_USR2, GPIO.OUT)\nGPIO.setup(LED_USR3, GPIO.OUT)\n\nLED0_ON_ADV_MSG = \"10:09:42:6C:65:75:49:4F:20:4C:45:44:20:30:20:4F:4E:\"\nLED1_ON_ADV_MSG = \"10:09:42:6C:65:75:49:4F:20:4C:45:44:20:31:20:4F:4E:\"\nLED2_ON_ADV_MSG = \"10:09:42:6C:65:75:49:4F:20:4C:45:44:20:32:20:4F:4E:\"\nLED3_ON_ADV_MSG = \"10:09:42:6C:65:75:49:4F:20:4C:45:44:20:33:20:4F:4E:\"\n\n<em># Turn off all LEDs<\/em>\nGPIO.output(LED_USR0, GPIO.LOW)\ntime.sleep(0.1)\nGPIO.output(LED_USR1, GPIO.LOW)\ntime.sleep(0.1)\nGPIO.output(LED_USR2, GPIO.LOW)\ntime.sleep(0.1)\nGPIO.output(LED_USR3, GPIO.LOW)\ntime.sleep(0.1)\n\nprint(\"\\nBlueIO BeagleBone Example!\\n\\n\")\nconnecting_to_dongle = 0\ncom_input = \"\"\n\nstart_input = 0\nvalid_input = 0\nwhile start_input == 0:\n    com_input = input(\n        \"Enter Com port of Dongle (default for BeagleBone: '\/dev\/ttyACM0'):\\n&gt;&gt;\"\n    )\n    print(\"\\nComport to use: \" + com_input)\n    input_continue = input(\n        \"If your happy with your choice just press Enter to continue the script. Else type E to exit or R to redo your choice. \\n&gt;&gt;\"\n    )\n    if input_continue.upper() == \"E\":\n        start_input = 1\n    elif input_continue.upper() == \"\":\n        start_input = 1\n    elif input_continue.upper() == \"R\":\n        valid_input = 0\n        start_input = 0\nif input_continue.upper() == \"E\":\n    print(\"Exiting script...\")\n    exit()\n\nconsole = None\n\nwhile 1:\n    try:\n        print(\"Please wait...\")\n        time.sleep(0.5)\n        console.write(str.encode(\"AT+DUAL\"))\n        console.write(\"\\r\".encode())\n        time.sleep(0.5)\n        print(\"Starting Advertising...\")\n        console.write(str.encode(\"AT+ADVSTART\"))\n        console.write(\"\\r\".encode())\n        time.sleep(0.5)\n        led_turn = 0\n        <em># Turn off all LEDs<\/em>\n        GPIO.output(LED_USR0, GPIO.LOW)\n        time.sleep(0.1)\n        GPIO.output(LED_USR1, GPIO.LOW)\n        time.sleep(0.1)\n        GPIO.output(LED_USR2, GPIO.LOW)\n        time.sleep(0.1)\n        GPIO.output(LED_USR3, GPIO.LOW)\n        time.sleep(0.1)\n        while True:\n            if led_turn == 0:\n                print(\"\\nTurning LED USR0 ON\")\n                console.write(str.encode(\"AT+ADVRESP=\"))\n                console.write(LED0_ON_ADV_MSG.encode())\n                console.write(\"\\r\".encode())\n                GPIO.output(LED_USR0, GPIO.HIGH)\n                GPIO.output(LED_USR1, GPIO.LOW)\n                GPIO.output(LED_USR2, GPIO.LOW)\n                GPIO.output(LED_USR3, GPIO.LOW)\n                led_turn = led_turn + 1\n            elif led_turn == 1:\n                print(\"\\nTurning LED USR1 ON\")\n                console.write(str.encode(\"AT+ADVRESP=\"))\n                console.write(LED1_ON_ADV_MSG.encode())\n                console.write(\"\\r\".encode())\n                GPIO.output(LED_USR0, GPIO.LOW)\n                GPIO.output(LED_USR1, GPIO.HIGH)\n                GPIO.output(LED_USR2, GPIO.LOW)\n                GPIO.output(LED_USR3, GPIO.LOW)\n                led_turn = led_turn + 1\n            elif led_turn == 2:\n                print(\"\\nTurning LED USR2 ON\")\n                console.write(str.encode(\"AT+ADVRESP=\"))\n                console.write(LED2_ON_ADV_MSG.encode())\n                console.write(\"\\r\".encode())\n                GPIO.output(LED_USR0, GPIO.LOW)\n                GPIO.output(LED_USR1, GPIO.LOW)\n                GPIO.output(LED_USR2, GPIO.HIGH)\n                GPIO.output(LED_USR3, GPIO.LOW)\n                led_turn = led_turn + 1\n            elif led_turn == 3:\n                print(\"\\nTurning LED USR3 ON\")\n                console.write(str.encode(\"AT+ADVRESP=\"))\n                console.write(LED3_ON_ADV_MSG.encode())\n                console.write(\"\\r\".encode())\n                GPIO.output(LED_USR0, GPIO.LOW)\n                GPIO.output(LED_USR1, GPIO.LOW)\n                GPIO.output(LED_USR2, GPIO.LOW)\n                GPIO.output(LED_USR3, GPIO.HIGH)\n                led_turn = 0\n\n            time.sleep(8)\n\n    except KeyboardInterrupt:\n        GPIO.output(LED_USR0, GPIO.LOW)\n        time.sleep(0.1)\n        GPIO.output(LED_USR1, GPIO.LOW)\n        time.sleep(0.1)\n        GPIO.output(LED_USR2, GPIO.LOW)\n        time.sleep(0.1)\n        GPIO.output(LED_USR3, GPIO.LOW)\n        time.sleep(0.1)\n        print(\"Exiting script...\")\n        exit()\n    except:\n        print(\"\\n\\nDongle not connected.\\n\")\n        connecting_to_dongle = 0\n        while connecting_to_dongle == 0:\n            try:\n                print(\"Trying to connect to dongle...\")\n                console = serial.Serial(\n                    port=com_input,\n                    baudrate=57600,\n                    parity=\"N\",\n                    stopbits=1,\n                    bytesize=8,\n                    timeout=0,\n                )\n                if console.is_open.__bool__():\n                    connecting_to_dongle = 1\n                    print(\"\\n\\nConnected to Dongle in port: \" + com_input + \".\\n\")\n            except:\n                print(\n                    \"Dongle not found. Retrying connection to port: \"\n                    + com_input\n                    + \"...\"\n                )\n                time.sleep(5)\n<\/code><\/pre>\n\n\n\n<h2 class=\"wp-block-heading\"><a href=\"https:\/\/www.bleuio.com\/getting_started\/docs\/beaglebone_example\/#3-using-the-example-project\"><\/a>3. Using the example project<\/h2>\n\n\n\n<h4 class=\"wp-block-heading\"><a href=\"https:\/\/www.bleuio.com\/getting_started\/docs\/beaglebone_example\/#31-what-you-will-need\"><\/a>3.1 What you will need<\/h4>\n\n\n\n<ul class=\"wp-block-list\"><li>A Computer<\/li><li>A BleuIO dongle (<a href=\"https:\/\/www.bleuio.com\/\">https:\/\/www.bleuio.com\/<\/a>)<\/li><li>A BeagleBone Black (<a href=\"https:\/\/beagleboard.org\/black\">https:\/\/beagleboard.org\/black<\/a>) with Beaglebone Firmware installed (<a href=\"https:\/\/beagleboard.org\/latest-images\">https:\/\/beagleboard.org\/latest-images<\/a>)<\/li><\/ul>\n\n\n\n<h2 class=\"wp-block-heading\"><a href=\"https:\/\/www.bleuio.com\/getting_started\/docs\/beaglebone_example\/#4-how-to-setup-project\"><\/a>4. How to setup project<\/h2>\n\n\n\n<h4 class=\"wp-block-heading\"><a href=\"https:\/\/www.bleuio.com\/getting_started\/docs\/beaglebone_example\/#41-downloading-the-project-from-github\"><\/a>4.1 Downloading the project from GitHub<\/h4>\n\n\n\n<p>Get access to the project&nbsp;<a href=\"https:\/\/github.com\/smart-sensor-devices-ab\/beaglebone_bleuio_example\">HERE<\/a><br><a href=\"https:\/\/github.com\/smart-sensor-devices-ab\/beaglebone_bleuio_example\">https:\/\/github.com\/smart-sensor-devices-ab\/beaglebone_bleuio_example<\/a><br><br>Either clone the project, or download it as a zip file and unzip it, into a folder on your BeagleBone.<\/p>\n\n\n\n<p>You can also create a new python file using the Cloud9 IDE from the BeagleBone (run by going to&nbsp;<a href=\"http:\/\/192.168.7.2:3000\/\">http:\/\/192.168.7.2:3000\/<\/a>).<br><img decoding=\"async\" src=\"https:\/\/www.bleuio.com\/getting_started\/img\/beaglebone_black_example_img\/cloud9_new_file.png\" alt=\"alt text\"><\/p>\n\n\n\n<p>Copy the code and pasting it into the newly created file.<\/p>\n\n\n\n<figure class=\"wp-block-image\"><img decoding=\"async\" src=\"https:\/\/www.bleuio.com\/getting_started\/img\/beaglebone_black_example_img\/paste_code.png\" alt=\"alt text\" title=\"Pasting Example.\"\/><\/figure>\n\n\n\n<h4 class=\"wp-block-heading\"><a href=\"https:\/\/www.bleuio.com\/getting_started\/docs\/beaglebone_example\/#42-installing-pyserial\"><\/a>4.2 Installing pyserial<\/h4>\n\n\n\n<p>To run the script you will need to install the python library pyserial.<\/p>\n\n\n\n<p>The easiest way of doing this is just connecting to the BeagleBone via shh (the default password is&nbsp;<strong>temppwd<\/strong>):<br><img decoding=\"async\" src=\"https:\/\/www.bleuio.com\/getting_started\/img\/beaglebone_black_example_img\/connect_ssh.png\" alt=\"alt text\"><\/p>\n\n\n\n<p>or using the bash tab in the Cloud9 IDE and type:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code> sudo pip3 install pyserial<\/code><\/pre>\n\n\n\n<figure class=\"wp-block-image\"><img decoding=\"async\" src=\"https:\/\/www.bleuio.com\/getting_started\/img\/beaglebone_black_example_img\/cloud9_bash.png\" alt=\"alt text\" title=\"Import...\"\/><\/figure>\n\n\n\n<h2 class=\"wp-block-heading\"><a href=\"https:\/\/www.bleuio.com\/getting_started\/docs\/beaglebone_example\/#5-running-the-example\"><\/a>5. Running the example<\/h2>\n\n\n\n<p>Go to the folder where you have the python script file and run:<br>(Pyserial needs sudo-privileges to function.)<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>sudo python3 name_of_script.py<\/code><\/pre>\n","protected":false},"excerpt":{"rendered":"<p>1. Introduction This is a simple example showcasing how to control a BleuIO dongle connected to Beaglebone Black using a python script. When running the script, it will first ask for the com port where the dongle is connected (usually \u2018\/dev\/ttyACM0\u2019). After that, the BleuIO will start advertising. Every 8th second it will turn on [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":114,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1,2],"tags":[],"class_list":["post-113","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>Bluetooth Low Energy (BLE) Tutorial for Beaglebone 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\/bluetooth-low-energy-ble-tutorial-for-beaglebone-using-bleuio\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Bluetooth Low Energy (BLE) Tutorial for Beaglebone using BleuIO - BleuIO - Create Bluetooth Low Energy application\" \/>\n<meta property=\"og:description\" content=\"1. Introduction This is a simple example showcasing how to control a BleuIO dongle connected to Beaglebone Black using a python script. When running the script, it will first ask for the com port where the dongle is connected (usually \u2018\/dev\/ttyACM0\u2019). After that, the BleuIO will start advertising. Every 8th second it will turn on [&hellip;]\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.bleuio.com\/blog\/bluetooth-low-energy-ble-tutorial-for-beaglebone-using-bleuio\/\" \/>\n<meta property=\"og:site_name\" content=\"BleuIO - Create Bluetooth Low Energy application\" \/>\n<meta property=\"article:published_time\" content=\"2021-11-26T14:27:38+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2022-07-01T10:37:18+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/www.bleuio.com\/blog\/wp-content\/uploads\/2022\/01\/beaglebone.jpg\" \/>\n\t<meta property=\"og:image:width\" content=\"900\" \/>\n\t<meta property=\"og:image:height\" content=\"578\" \/>\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\\\/bluetooth-low-energy-ble-tutorial-for-beaglebone-using-bleuio\\\/#article\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/www.bleuio.com\\\/blog\\\/bluetooth-low-energy-ble-tutorial-for-beaglebone-using-bleuio\\\/\"},\"author\":{\"name\":\"BleuIO\",\"@id\":\"https:\\\/\\\/www.bleuio.com\\\/blog\\\/#\\\/schema\\\/person\\\/89bc581382d5964043f96efc54b75b80\"},\"headline\":\"Bluetooth Low Energy (BLE) Tutorial for Beaglebone using BleuIO\",\"datePublished\":\"2021-11-26T14:27:38+00:00\",\"dateModified\":\"2022-07-01T10:37:18+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\\\/\\\/www.bleuio.com\\\/blog\\\/bluetooth-low-energy-ble-tutorial-for-beaglebone-using-bleuio\\\/\"},\"wordCount\":493,\"commentCount\":0,\"image\":{\"@id\":\"https:\\\/\\\/www.bleuio.com\\\/blog\\\/bluetooth-low-energy-ble-tutorial-for-beaglebone-using-bleuio\\\/#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/www.bleuio.com\\\/blog\\\/wp-content\\\/uploads\\\/2022\\\/01\\\/beaglebone.jpg\",\"articleSection\":[\"BleuIO\",\"BleuIO tutorial\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\\\/\\\/www.bleuio.com\\\/blog\\\/bluetooth-low-energy-ble-tutorial-for-beaglebone-using-bleuio\\\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/www.bleuio.com\\\/blog\\\/bluetooth-low-energy-ble-tutorial-for-beaglebone-using-bleuio\\\/\",\"url\":\"https:\\\/\\\/www.bleuio.com\\\/blog\\\/bluetooth-low-energy-ble-tutorial-for-beaglebone-using-bleuio\\\/\",\"name\":\"Bluetooth Low Energy (BLE) Tutorial for Beaglebone using BleuIO - BleuIO - Create Bluetooth Low Energy application\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/www.bleuio.com\\\/blog\\\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\\\/\\\/www.bleuio.com\\\/blog\\\/bluetooth-low-energy-ble-tutorial-for-beaglebone-using-bleuio\\\/#primaryimage\"},\"image\":{\"@id\":\"https:\\\/\\\/www.bleuio.com\\\/blog\\\/bluetooth-low-energy-ble-tutorial-for-beaglebone-using-bleuio\\\/#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/www.bleuio.com\\\/blog\\\/wp-content\\\/uploads\\\/2022\\\/01\\\/beaglebone.jpg\",\"datePublished\":\"2021-11-26T14:27:38+00:00\",\"dateModified\":\"2022-07-01T10:37:18+00:00\",\"author\":{\"@id\":\"https:\\\/\\\/www.bleuio.com\\\/blog\\\/#\\\/schema\\\/person\\\/89bc581382d5964043f96efc54b75b80\"},\"breadcrumb\":{\"@id\":\"https:\\\/\\\/www.bleuio.com\\\/blog\\\/bluetooth-low-energy-ble-tutorial-for-beaglebone-using-bleuio\\\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\\\/\\\/www.bleuio.com\\\/blog\\\/bluetooth-low-energy-ble-tutorial-for-beaglebone-using-bleuio\\\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/www.bleuio.com\\\/blog\\\/bluetooth-low-energy-ble-tutorial-for-beaglebone-using-bleuio\\\/#primaryimage\",\"url\":\"https:\\\/\\\/www.bleuio.com\\\/blog\\\/wp-content\\\/uploads\\\/2022\\\/01\\\/beaglebone.jpg\",\"contentUrl\":\"https:\\\/\\\/www.bleuio.com\\\/blog\\\/wp-content\\\/uploads\\\/2022\\\/01\\\/beaglebone.jpg\",\"width\":900,\"height\":578,\"caption\":\"Bluetooth Low Energy (BLE) Tutorial for Beaglebone\"},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/www.bleuio.com\\\/blog\\\/bluetooth-low-energy-ble-tutorial-for-beaglebone-using-bleuio\\\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\\\/\\\/www.bleuio.com\\\/blog\\\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Bluetooth Low Energy (BLE) Tutorial for Beaglebone 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":"Bluetooth Low Energy (BLE) Tutorial for Beaglebone 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\/bluetooth-low-energy-ble-tutorial-for-beaglebone-using-bleuio\/","og_locale":"en_US","og_type":"article","og_title":"Bluetooth Low Energy (BLE) Tutorial for Beaglebone using BleuIO - BleuIO - Create Bluetooth Low Energy application","og_description":"1. Introduction This is a simple example showcasing how to control a BleuIO dongle connected to Beaglebone Black using a python script. When running the script, it will first ask for the com port where the dongle is connected (usually \u2018\/dev\/ttyACM0\u2019). After that, the BleuIO will start advertising. Every 8th second it will turn on [&hellip;]","og_url":"https:\/\/www.bleuio.com\/blog\/bluetooth-low-energy-ble-tutorial-for-beaglebone-using-bleuio\/","og_site_name":"BleuIO - Create Bluetooth Low Energy application","article_published_time":"2021-11-26T14:27:38+00:00","article_modified_time":"2022-07-01T10:37:18+00:00","og_image":[{"width":900,"height":578,"url":"https:\/\/www.bleuio.com\/blog\/wp-content\/uploads\/2022\/01\/beaglebone.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\/bluetooth-low-energy-ble-tutorial-for-beaglebone-using-bleuio\/#article","isPartOf":{"@id":"https:\/\/www.bleuio.com\/blog\/bluetooth-low-energy-ble-tutorial-for-beaglebone-using-bleuio\/"},"author":{"name":"BleuIO","@id":"https:\/\/www.bleuio.com\/blog\/#\/schema\/person\/89bc581382d5964043f96efc54b75b80"},"headline":"Bluetooth Low Energy (BLE) Tutorial for Beaglebone using BleuIO","datePublished":"2021-11-26T14:27:38+00:00","dateModified":"2022-07-01T10:37:18+00:00","mainEntityOfPage":{"@id":"https:\/\/www.bleuio.com\/blog\/bluetooth-low-energy-ble-tutorial-for-beaglebone-using-bleuio\/"},"wordCount":493,"commentCount":0,"image":{"@id":"https:\/\/www.bleuio.com\/blog\/bluetooth-low-energy-ble-tutorial-for-beaglebone-using-bleuio\/#primaryimage"},"thumbnailUrl":"https:\/\/www.bleuio.com\/blog\/wp-content\/uploads\/2022\/01\/beaglebone.jpg","articleSection":["BleuIO","BleuIO tutorial"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/www.bleuio.com\/blog\/bluetooth-low-energy-ble-tutorial-for-beaglebone-using-bleuio\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/www.bleuio.com\/blog\/bluetooth-low-energy-ble-tutorial-for-beaglebone-using-bleuio\/","url":"https:\/\/www.bleuio.com\/blog\/bluetooth-low-energy-ble-tutorial-for-beaglebone-using-bleuio\/","name":"Bluetooth Low Energy (BLE) Tutorial for Beaglebone using BleuIO - BleuIO - Create Bluetooth Low Energy application","isPartOf":{"@id":"https:\/\/www.bleuio.com\/blog\/#website"},"primaryImageOfPage":{"@id":"https:\/\/www.bleuio.com\/blog\/bluetooth-low-energy-ble-tutorial-for-beaglebone-using-bleuio\/#primaryimage"},"image":{"@id":"https:\/\/www.bleuio.com\/blog\/bluetooth-low-energy-ble-tutorial-for-beaglebone-using-bleuio\/#primaryimage"},"thumbnailUrl":"https:\/\/www.bleuio.com\/blog\/wp-content\/uploads\/2022\/01\/beaglebone.jpg","datePublished":"2021-11-26T14:27:38+00:00","dateModified":"2022-07-01T10:37:18+00:00","author":{"@id":"https:\/\/www.bleuio.com\/blog\/#\/schema\/person\/89bc581382d5964043f96efc54b75b80"},"breadcrumb":{"@id":"https:\/\/www.bleuio.com\/blog\/bluetooth-low-energy-ble-tutorial-for-beaglebone-using-bleuio\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.bleuio.com\/blog\/bluetooth-low-energy-ble-tutorial-for-beaglebone-using-bleuio\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.bleuio.com\/blog\/bluetooth-low-energy-ble-tutorial-for-beaglebone-using-bleuio\/#primaryimage","url":"https:\/\/www.bleuio.com\/blog\/wp-content\/uploads\/2022\/01\/beaglebone.jpg","contentUrl":"https:\/\/www.bleuio.com\/blog\/wp-content\/uploads\/2022\/01\/beaglebone.jpg","width":900,"height":578,"caption":"Bluetooth Low Energy (BLE) Tutorial for Beaglebone"},{"@type":"BreadcrumbList","@id":"https:\/\/www.bleuio.com\/blog\/bluetooth-low-energy-ble-tutorial-for-beaglebone-using-bleuio\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/www.bleuio.com\/blog\/"},{"@type":"ListItem","position":2,"name":"Bluetooth Low Energy (BLE) Tutorial for Beaglebone 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\/113","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=113"}],"version-history":[{"count":1,"href":"https:\/\/www.bleuio.com\/blog\/wp-json\/wp\/v2\/posts\/113\/revisions"}],"predecessor-version":[{"id":115,"href":"https:\/\/www.bleuio.com\/blog\/wp-json\/wp\/v2\/posts\/113\/revisions\/115"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.bleuio.com\/blog\/wp-json\/wp\/v2\/media\/114"}],"wp:attachment":[{"href":"https:\/\/www.bleuio.com\/blog\/wp-json\/wp\/v2\/media?parent=113"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.bleuio.com\/blog\/wp-json\/wp\/v2\/categories?post=113"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.bleuio.com\/blog\/wp-json\/wp\/v2\/tags?post=113"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}