ESP32 BLE config

All ESP32 boards running MicroPython.
Target audience: MicroPython users with an ESP32 board.
Post Reply
honboylc
Posts: 1
Joined: Sun Oct 04, 2020 11:59 am

ESP32 BLE config

Post by honboylc » Sun Oct 04, 2020 12:08 pm

大家好
我在使用buletooth的时候无法搜索到ESP32的信号,麻烦帮我看一下问题出在哪里,或者有简单的模板可以套用吗,谢谢
[edit by moderator: Hello everyone
When I use bluetooth, I can’t search for the ESP32 signal. Please help me to find out where the problem is, or is there a simple template to apply, thank you]

Code: Select all

from machine import Pin
import os
import ubluetooth
bt = ubluetooth.BLE()
bt.active(1)
bt.gap_advertise(100,'pythonESP32')
以下是命令行返回的消息
[edit: The following is the message returned from the command line]

download ok
exec(open('./bt.py').read(),globals())
GAP procedure initiated: advertise; disc_mode=2 adv_channel_map=7 own_addr_type=0 adv_filter_policy=0 adv_itvl_min=0 adv_itvl_max=0

User avatar
jimmo
Posts: 2754
Joined: Tue Aug 08, 2017 1:57 am
Location: Sydney, Australia
Contact:

Re: ESP32 BLE config

Post by jimmo » Tue Oct 20, 2020 7:13 am

honboylc wrote:
Sun Oct 04, 2020 12:08 pm
I can’t search for the ESP32 signal
Depending on what you're using to search for it (e.g. a phone app like nRF Connect), the advertising payload needs to be properly formatted.

Please see https://github.com/micropython/micropyt ... rtising.py for some helpers that generate payloads according to the spec.

Code: Select all

bt.gap_advertise(100, ble_advertising.advertising_payload(name='pythonESP32'))

Post Reply