{"id":1585,"date":"2019-06-01T17:02:02","date_gmt":"2019-06-01T09:02:02","guid":{"rendered":"https:\/\/www.techcoil.com\/blog\/?p=1585"},"modified":"2020-05-12T10:50:34","modified_gmt":"2020-05-12T02:50:34","slug":"how-to-connect-to-an-esp32-development-board-via-bluetooth-on-your-mac","status":"publish","type":"post","link":"https:\/\/www.techcoil.com\/blog\/how-to-connect-to-an-esp32-development-board-via-bluetooth-on-your-mac\/","title":{"rendered":"How to connect to an ESP32 development board via Bluetooth on your Mac"},"content":{"rendered":"<p>When you are trying to build a <a href=\"https:\/\/www.amazon.com\/HiLetgo-ESP-WROOM-32-Development-Microcontroller-Integrated\/dp\/B0718T232Z\/ref=as_li_ss_tl?ie=UTF8&linkCode=ll1&tag=clivsperswebs-20&linkId=6749fc5a2996d2ef50cdd86bbb2bbd97&language=en_US\" rel=\"noopener\" target=\"_blank\">ESP32<\/a> project that uses Bluetooth to receive from or send data to another device on Mac, you may want to use your Mac to connect to your ESP32 board to test Bluetooth connectivity. <\/p>\n<p>In this case, you will need to first connect your Mac with the ESP32 development board via Bluetooth.<\/p>\n<p>So how can you do that?<\/p>\n<p>In case you need it, this is how to connect to an ESP32 development board via Bluetooth on your Mac.<\/p>\n<h2>Setting up your ESP32 development board to accept Bluetooth connections<\/h2>\n<p>Before your Mac can discover ESP32 Bluetooth, you need to get ESP32 to turn on Bluetooth. In order to do so, upload the following Arduino Sketch to your ESP32 development board:<\/p>\n<pre class=\"brush: cpp; title: ; notranslate\" title=\"\">\r\n#include &quot;BluetoothSerial.h&quot;\r\n \r\nBluetoothSerial SerialBT;\r\n  \r\nvoid setup()\r\n{\r\n  SerialBT.begin(&quot;ESP32test&quot;);\r\n  delay(1000);\r\n}\r\n  \r\nvoid loop()\r\n{\r\n  String inputFromOtherSide;\r\n  if (SerialBT.available()) {\r\n    inputFromOtherSide = SerialBT.readString();\r\n    SerialBT.println(&quot;You had entered: &quot;);\r\n    SerialBT.println(inputFromOtherSide);\r\n  }\r\n}\r\n<\/pre>\n<p>As I had mentioned in the guide on <a href=\"https:\/\/www.techcoil.com\/blog\/how-to-get-your-esp32-development-board-to-communicate-with-another-device-over-bluetooth-serial\/\" rel=\"noopener\" target=\"_blank\">how to get your ESP32 development board to communicate with another device over Bluetooth Serial<\/a>, this Arduino Sketch will echo back whatever message that it receives from the Bluetooth connection.<\/p>\n<h2>Connecting to your ESP32 development board via Bluetooth on your Mac<\/h2>\n<p>Once the ESP32 board starts to run your Arduino sketch, you are ready to connect to it.<\/p>\n<p>First, go to <a href=\"https:\/\/support.apple.com\/kb\/PH25594?locale=en_SG&viewlocale=en_SG\" rel=\"noopener\" target=\"_blank\">System Preferences<\/a>:<\/p>\n<p><img decoding=\"async\" src=\"https:\/\/www.techcoil.com\/blog\/wp-content\/uploads\/My-Mac-system-preferences-window-as-of-20190531.png\" alt=\"My Mac system preferences window as of 20190531\" \/><\/p>\n<p>After you had clicked on <strong>Bluetooth<\/strong> and <strong>turned on Bluetooth of your Mac<\/strong>, you should find your ESP32 appearing as <strong>ESP32test<\/strong>:<\/p>\n<p><img decoding=\"async\" src=\"https:\/\/www.techcoil.com\/blog\/wp-content\/uploads\/My-Mac-Bluetooth-window-show-ESP32test-as-an-available-Bluetooth-device.jpg\" alt=\"My Mac Bluetooth window show ESP32test as an available Bluetooth device\"\/><\/p>\n<p>After you click on <strong>Connect<\/strong>, your Mac will display your ESP32 as <strong>Connected<\/strong>:<\/p>\n<p><img decoding=\"async\" src=\"https:\/\/www.techcoil.com\/blog\/wp-content\/uploads\/My-Mac-Bluetooth-window-showing-ESP32test-as-connected.jpg\" alt=\"My Mac Bluetooth window showing ESP32test as connected\" \/><\/p>\n<p>At this point in time, you will then be able to use a program on your Mac to communicate with your ESP32 device via Bluetooth.<\/p>\n<p>When no program is using that Bluetooth connection, the status will change to <strong>Not Connected<\/strong>. <\/p>\n<p><img decoding=\"async\" src=\"https:\/\/www.techcoil.com\/blog\/wp-content\/uploads\/My-Mac-Bluetooth-window-showing-ESP32test-as-not-connected.jpg\" alt=\"My Mac Bluetooth window showing ESP32test as not connected\"\/><\/p>\n<p>Once you start a program to use that Bluetooth connection, the status will change back to <strong>Connected<\/strong>. <\/p>\n\n      <ul id=\"social-sharing-buttons-list\">\n        <li class=\"facebook\">\n          <a href=\"https:\/\/www.facebook.com\/sharer\/sharer.php?u=https%3A%2F%2Fwp.me%2Fp245TQ-pz\" target=\"_blank\" role=\"button\" rel=\"nofollow\">\n            <img decoding=\"async\" src=\"\/ph\/img\/3rd-party\/social-icons\/Facebook.png\" alt=\"Facebook icon\"> Share\n          <\/a>\n        <\/li>\n        <li class=\"twitter\">\n          <a href=\"https:\/\/twitter.com\/intent\/tweet?text=&url=https%3A%2F%2Fwp.me%2Fp245TQ-pz&via=Techcoil_com\" target=\"_blank\" role=\"button\" rel=\"nofollow\">\n          <img decoding=\"async\" src=\"\/ph\/img\/3rd-party\/social-icons\/Twitter.png\" alt=\"Twitter icon\"> Tweet\n          <\/a>\n        <\/li>\n        <li class=\"linkedin\">\n          <a href=\"https:\/\/www.linkedin.com\/shareArticle?mini=1&title=&url=https%3A%2F%2Fwp.me%2Fp245TQ-pz&source=https:\/\/www.techcoil.com\" target=\"_blank\" role=\"button\" rel=\"nofollow\">\n          <img decoding=\"async\" src=\"\/ph\/img\/3rd-party\/social-icons\/linkedin.png\" alt=\"Linkedin icon\"> Share\n          <\/a>\n        <\/li>\n        <li class=\"pinterest\">\n          <a href=\"https:\/\/pinterest.com\/pin\/create\/button\/?url=https%3A%2F%2Fwww.techcoil.com%2Fblog%2Fwp-json%2Fwp%2Fv2%2Fposts%2F1585&description=\" class=\"pin-it-button\" target=\"_blank\" role=\"button\" rel=\"nofollow\" count-layout=\"horizontal\">\n          <img decoding=\"async\" src=\"\/ph\/img\/3rd-party\/social-icons\/Pinterest.png\" alt=\"Pinterest icon\"> Save\n          <\/a>\n        <\/li>\n      <\/ul>\n    ","protected":false},"excerpt":{"rendered":"<p>When you are trying to build a <a href=\"https:\/\/www.amazon.com\/HiLetgo-ESP-WROOM-32-Development-Microcontroller-Integrated\/dp\/B0718T232Z\/ref=as_li_ss_tl?ie=UTF8&#038;linkCode=ll1&#038;tag=clivsperswebs-20&#038;linkId=6749fc5a2996d2ef50cdd86bbb2bbd97&#038;language=en_US\" rel=\"noopener\" target=\"_blank\">ESP32<\/a> project that uses Bluetooth to receive from or send data to another device on Mac, you may want to use your Mac to connect to your ESP32 board to test Bluetooth connectivity. <\/p>\n<p>In this case, you will need to first connect your Mac with the ESP32 development board via Bluetooth.<\/p>\n<p>So how can you do that?<\/p>\n<p>In case you need it, this is how to connect to an ESP32 development board via Bluetooth on your Mac.<\/p>\n","protected":false},"author":1,"featured_media":1587,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"advanced_seo_description":"","jetpack_seo_html_title":"","jetpack_seo_noindex":false,"jetpack_post_was_ever_published":false,"_jetpack_newsletter_access":"","_jetpack_dont_email_post_to_subs":false,"_jetpack_newsletter_tier_id":0,"footnotes":""},"categories":[4],"tags":[648,630,649,650],"jetpack_featured_media_url":"https:\/\/www.techcoil.com\/blog\/wp-content\/uploads\/My-Mac-Bluetooth-window-show-ESP32test-as-an-available-Bluetooth-device.jpg","jetpack_shortlink":"https:\/\/wp.me\/p245TQ-pz","jetpack-related-posts":[],"jetpack_likes_enabled":true,"jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/www.techcoil.com\/blog\/wp-json\/wp\/v2\/posts\/1585"}],"collection":[{"href":"https:\/\/www.techcoil.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.techcoil.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.techcoil.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.techcoil.com\/blog\/wp-json\/wp\/v2\/comments?post=1585"}],"version-history":[{"count":0,"href":"https:\/\/www.techcoil.com\/blog\/wp-json\/wp\/v2\/posts\/1585\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.techcoil.com\/blog\/wp-json\/wp\/v2\/media\/1587"}],"wp:attachment":[{"href":"https:\/\/www.techcoil.com\/blog\/wp-json\/wp\/v2\/media?parent=1585"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.techcoil.com\/blog\/wp-json\/wp\/v2\/categories?post=1585"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.techcoil.com\/blog\/wp-json\/wp\/v2\/tags?post=1585"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}