8190 views|2 replies

1w

Posts

25

Resources
The OP
 

ESP32 simple Bluetooth support shared by foreign netizens [Copy link]

 import utime import bluetooth bt = bluetooth.Bluetooth() bt.active(True) bt.advertise(1000, 'MicroPython') # callback def receive(char, msg): # echo characteristics[1].notify(msg) print(msg) characteristics = [ bluetooth.Characteristic( 0xFF01, bluetooth.FLAG_WRITE | bluetooth.FLAG_READ, receive = receive ), bluetooth.Characteristic( 0xFF02, bluetooth.FLAG_NOTIFY, descriptors = [ bluetooth.Characteristic(bluetooth.UUID_CHAR_CLIENT_CONFIG, bluetooth.FLAG_WRITE | bluetooth.FLAG_READ)] print(msg) characteristics = [ bluetooth.Characteristic( 0xFF01, bluetooth.FLAG_WRITE | bluetooth.FLAG_READ)] print(msg) characteristics = [ bluetooth.Characteristic( 0xFF02, bluetooth.FLAG_NOTIFY, descriptors = [ bluetooth.Characteristic(bluetooth.UUID_CHAR_CLIENT_CONFIG, bluetooth.FLAG_WRITE | bluetooth.FLAG_READ)] print(msg) ] ) ] bt.add_service(0x00FF, characteristics) while True: characteristics[0].wait() # waiting new message, async utime.sleep_ms(100)[/code]




Latest reply

ESP32 has one antenna for Bluetooth and WiFi. It is a pain to use two antennas at the same time.  Details Published on 2019-3-26 16:36
 
 

71

Posts

0

Resources
2
 
Thanks for sharing!
Personal signatureFTP
 
 
 

1368

Posts

6

Resources
3
 
ESP32 has one antenna for Bluetooth and WiFi. It is a pain to use two antennas at the same time.
Personal signature专注智能产品的研究与开发,专注于电子电路的生产与制造……QQ:2912615383,电子爱好者群: void
 
 
 

Guess Your Favourite
Just looking around
Find a datasheet?

EEWorld Datasheet Technical Support

EEWorld
subscription
account

EEWorld
service
account

Automotive
development
circle

Copyright © 2005-2024 EEWORLD.com.cn, Inc. All rights reserved 京B2-20211791 京ICP备10001474号-1 电信业务审批[2006]字第258号函 京公网安备 11010802033920号
快速回复 返回顶部 Return list