<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0"><channel><title><![CDATA[M5Stack, Core2 Bluetooth Example Code???]]></title><description><![CDATA[<p dir="auto">I'm trying to get Bluetooth to work with an M5Stack, Core2 AWS to pass Serial Data.</p>
<p dir="auto">There is an M5Unified.h example for Bluetooth:<br />
M5Unified.h Bluetooth Example<br />
but it's so obfuscated, I can't make heads or tails of how to extract some simple Bluetooth commands out of it. PLUS, I can't get it to compile...</p>
<p dir="auto">I've had Bluetooth running on an ESP32 WROOM using BluetoothSerial.h (previous project), it connects and passes data. If I use the same Library on the M5Core2 (with the M5Unified.h, latest version) I can see the M5Stack Bluetooth on my Bluetooth device where I get the data (ICOM IC-705), it's discovered when I search, but it won't connect.</p>
<p dir="auto">Using this simple code:</p>
<pre><code>//ESP32 Specific:
#include "BluetoothSerial.h"

#if !defined(CONFIG_BT_ENABLED) || !defined(CONFIG_BLUEDROID_ENABLED)
#error Bluetooth is not enabled! Please run `make menuconfig` to and enable it
#endif

BluetoothSerial SerialBT;
void setup()
{
  Serial.begin(115200);
  SerialBT.begin("IC-705-ESP"); //Bluetooth device name
  Serial.println("The device started, now you can pair it with bluetooth!");
}

void loop() {
  while(1);
}
</code></pre>
<p dir="auto">I can connect with the ESP32 WROOM (using ESP32 Dev Module) but it won't work with the M5Stack, Core2.</p>
<p dir="auto">Is there something I'm missing, or can someone point me in the direction of some more simplified Bluetooth code for the M5Core2?</p>
<p dir="auto">I tried others like one that was:</p>
<pre><code>#include &lt;M5Stack.h&gt;
#include &lt;BLEDevice.h&gt;
#include &lt;BLEUtils.h&gt;
#include &lt;BLEServer.h&gt;
#include &lt;BLE2902.h&gt;
</code></pre>
<p dir="auto">but again, that didn't work...</p>
<p dir="auto">Sir Michael</p>
]]></description><link>https://community.m5stack.com/topic/7295/m5stack-core2-bluetooth-example-code</link><generator>RSS for Node</generator><lastBuildDate>Wed, 11 Mar 2026 15:48:29 GMT</lastBuildDate><atom:link href="https://community.m5stack.com/topic/7295.rss" rel="self" type="application/rss+xml"/><pubDate>Thu, 13 Feb 2025 15:09:18 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to M5Stack, Core2 Bluetooth Example Code??? on Fri, 14 Feb 2025 18:25:46 GMT]]></title><description><![CDATA[<p dir="auto">I finally figured it out, even after trying all of the examples in the <a href="https://github.com/espressif/arduino-esp32/tree/master/libraries/BluetoothSerial" target="_blank" rel="noopener noreferrer nofollow ugc">SerialBluetooth.h</a> example directory on the M5Stack Core2.</p>
<p dir="auto">I finally found that I had to Initialize the Bluetooth settings on my device, after that, the connections worked find.</p>
<p dir="auto">Sir Michael</p>
]]></description><link>https://community.m5stack.com/post/28227</link><guid isPermaLink="true">https://community.m5stack.com/post/28227</guid><dc:creator><![CDATA[SirMichael]]></dc:creator><pubDate>Fri, 14 Feb 2025 18:25:46 GMT</pubDate></item></channel></rss>