<?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[micropython with ble]]></title><description><![CDATA[<p dir="auto">I came across the following code for ble on dfrobot firebeetle esp32:<br />
<a href="https://www.dfrobot.com/forum/viewtopic.php?t=2985" target="_blank" rel="noopener noreferrer nofollow ugc">https://www.dfrobot.com/forum/viewtopic.php?t=2985</a></p>
<pre><code>import gc
import sys
import network as n
import gc
import time

b = n.Bluetooth()

found = {}
complete = True

def bcb(b,e,d,u):
 global complete
 global found
 if e == b.CONNECT:
   print("CONNECT")
   b.ble_settings(adv_man_name = "firebeetle-esp32", adv_dev_name="firebeetle-esp32")
   b.ble_adv_enable(True)
 elif e == b.DISCONNECT:
         print("DISCONNECT")
 else:
   print ('Unknown event', e,d)

def cb (cb, event, value, userdata):
 print('charcb ', cb, userdata, ' ', end='')
 if event == b.READ:
   print('Read')
   return 'ABCDEFG'
 elif event == b.WRITE:
   print ('Write', value)

def gatts():
 s1 = b.Service(0xaabb)
 s2 = b.Service(0xDEAD)

 c1 = s1.Char(0xccdd)
 c2 = s2.Char(0xccdd)

 c1.callback(cb, 'c1 data')
 c2.callback(cb, 'c2 data')

 s1.start()
 s2.start()

 b.ble_settings(adv_man_name = "firebeetle-esp32", adv_dev_name="firebeetle-esp32")
 b.ble_adv_enable(True)

b.callback(bcb)
gatts()
while(True):
 pass
</code></pre>
<p dir="auto">I tried it on the firebeetle and it works. When I try it on the M5 it uploads but I believe there is a difference in the network module that is keeping it from running. Is it possible for someone with micropython experience to take a look and see how this code can be ported to the m5. I'll take any suggestions I can get. thanks</p>
]]></description><link>https://community.m5stack.com/topic/291/micropython-with-ble</link><generator>RSS for Node</generator><lastBuildDate>Tue, 19 May 2026 13:48:41 GMT</lastBuildDate><atom:link href="https://community.m5stack.com/topic/291.rss" rel="self" type="application/rss+xml"/><pubDate>Sun, 19 Aug 2018 07:20:01 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to micropython with ble on Tue, 21 Aug 2018 19:36:57 GMT]]></title><description><![CDATA[<p dir="auto">Thanks for your help much appreciated.</p>
]]></description><link>https://community.m5stack.com/post/1426</link><guid isPermaLink="true">https://community.m5stack.com/post/1426</guid><dc:creator><![CDATA[jpilarski]]></dc:creator><pubDate>Tue, 21 Aug 2018 19:36:57 GMT</pubDate></item><item><title><![CDATA[Reply to micropython with ble on Tue, 21 Aug 2018 09:31:01 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/jpilarski" aria-label="Profile: jpilarski">@<bdi>jpilarski</bdi></a> 在 <a href="/post/1417">micropython with ble</a> 中说：</p>
<blockquote>
<p dir="auto">... Can you suggest how to do this or where to learn more about this...</p>
</blockquote>
<p dir="auto">You can use my MicroPython port on M5Stack without any changes.<br />
Most of the information needed can be found on the <a href="https://github.com/loboris/MicroPython_ESP32_psRAM_LoBo/wiki" target="_blank" rel="noopener noreferrer nofollow ugc">Wiki pages</a>.<br />
You can find some helper functions to use it on M5Stack <a href="https://github.com/tuupola/micropython-m5stack" target="_blank" rel="noopener noreferrer nofollow ugc">here</a>.<br />
I'll try to add some information about using this MicroPython port on M5Stack on the Wiki pages when I'll find some time.</p>
]]></description><link>https://community.m5stack.com/post/1418</link><guid isPermaLink="true">https://community.m5stack.com/post/1418</guid><dc:creator><![CDATA[loboris]]></dc:creator><pubDate>Tue, 21 Aug 2018 09:31:01 GMT</pubDate></item><item><title><![CDATA[Reply to micropython with ble on Tue, 21 Aug 2018 08:46:18 GMT]]></title><description><![CDATA[<p dir="auto">That's amazing thanks for the response and for all the hard work. I am trying to learn micropython and the one thing I am trying to understand is for the m5go there are two files the bin and the img. If the img is the filesystem can I use esptools to upload your newer firmware bin files with the existing img file to get newer features while still having access to m5go web ide. Also is it possible to include telnet in M5STACK for webrepl. I saw you suggested in a previous discussion that is a way to use wifi and connect to repl. When I try to use telnet it isn't included in network library on M5STACK. I think what I need to learn is how I can add features to micropython firmware yet still have the M5STACK api. Can you suggest how to do this or where to learn more about this. Sorry for such a long post it's just really interesting and I want to try to understand this better.</p>
]]></description><link>https://community.m5stack.com/post/1417</link><guid isPermaLink="true">https://community.m5stack.com/post/1417</guid><dc:creator><![CDATA[jpilarski]]></dc:creator><pubDate>Tue, 21 Aug 2018 08:46:18 GMT</pubDate></item><item><title><![CDATA[Reply to micropython with ble on Tue, 21 Aug 2018 08:26:16 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/jpilarski" aria-label="Profile: jpilarski">@<bdi>jpilarski</bdi></a> 在 <a href="/post/1414">micropython with ble</a> 中说：</p>
<blockquote>
<p dir="auto">Another way of asking my question is how can I use bluetooth on M5go or M5stack running micropython. It seems to me like a new firmware is needed for bluetooth to be enabled. The LOBO esp32 build now looks to have bluetooth capabilities. How does one go about adding the m5stack libraries to a newer LOBO esp32 firmware or is it possible  for the M5 micropython/M5go micropython firmware to be updated to include bluetooth.</p>
</blockquote>
<p dir="auto">No full BT support is available yet in LoBo-MicroPython. BT RFCOMM is implemented (same functionality as the UART module, the documentation should be available later this week), and I'm planning to finish the BLE support next month.</p>
]]></description><link>https://community.m5stack.com/post/1416</link><guid isPermaLink="true">https://community.m5stack.com/post/1416</guid><dc:creator><![CDATA[loboris]]></dc:creator><pubDate>Tue, 21 Aug 2018 08:26:16 GMT</pubDate></item><item><title><![CDATA[Reply to micropython with ble on Tue, 21 Aug 2018 05:33:16 GMT]]></title><description><![CDATA[<p dir="auto">Another way of asking my question is how can I use bluetooth on M5go or M5stack running micropython. It seems to me like a new firmware is needed for bluetooth to be enabled. The LOBO esp32 build now looks to have bluetooth capabilities. How does one go about adding the m5stack libraries to a newer LOBO esp32 firmware or is it possible  for the M5 micropython/M5go micropython firmware to be updated to include bluetooth.</p>
]]></description><link>https://community.m5stack.com/post/1414</link><guid isPermaLink="true">https://community.m5stack.com/post/1414</guid><dc:creator><![CDATA[jpilarski]]></dc:creator><pubDate>Tue, 21 Aug 2018 05:33:16 GMT</pubDate></item><item><title><![CDATA[Reply to micropython with ble on Sun, 19 Aug 2018 09:36:49 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/jpilarski" aria-label="Profile: jpilarski">@<bdi>jpilarski</bdi></a> Can't really help you with the problem at hand, but if you edit the message and replace <code>&lt;code&gt;</code> and <code>&lt;/code&gt;</code> with three backticks ( ``` ) it will be much easier to read.</p>
]]></description><link>https://community.m5stack.com/post/1409</link><guid isPermaLink="true">https://community.m5stack.com/post/1409</guid><dc:creator><![CDATA[Rop]]></dc:creator><pubDate>Sun, 19 Aug 2018 09:36:49 GMT</pubDate></item></channel></rss>