-
I seem to be having trouble getting more than one characteristic working inside of a BLE service. The below simple example is based on what is shown in the class documentation. There is not much more to help understand programming a BLE peripheral with Micropython on the wipy2/lopy boards.
As mentioned in an email to support and in another post. I will be willing to pay for prompt support and resolution of this.
Any help would be appreciated.
https://docs.pycom.io/pycom_esp32/library/network.Bluetooth.html
https://docs.pycom.io/pycom_esp32/pycom_esp32/tutorial/includes/bluetooth.html>>> from network import Bluetooth >>> ble = Bluetooth() BTDM CONTROLLER VERSION: 010101 btip start copy .data from 4000d890 to 3ffae6e0, len 00001830 set .bss 0x0 from 3ffb8000 to 3ffbff70, len 00007f70 BTDM ROM VERSION 0101 BD_ADDR: 24:0A:C4:00:6B:EC NVDS MAGIC FAILED RF Init OK with coex >>> ble.advertise(True) >>> ble.set_advertisement(name='bleep', service_uuid=b'1234567890123456', manufacturer_data=None, service_data=None) >>> serv = ble.service(uuid=b'1234567890123456', isprimary=True) >>> char1 = serv.characteristic(uuid=b'2234567890123456', value=1) >>> char2 = serv.characteristic(uuid=b'3234567890123456', value=2) -
@TravisT said in BLE multiple characteristics in a service:
serv = ble.service(uuid=b'1234567890123456', isprimary=True)
You need to use the nbr_chars parameter when you create a service.
For your example, with two characteristics, that would be:serv = ble.service(uuid=b'1234567890123456', isprimary=True,nbr_chars=2)This was added in 1.5.0.b1
-
Thanks for the prompt help. This makes sense, just wish the documentation was better at describing typical use cases, especially when there is frequent firmware updates.
-
@jmarcelino Is there a maximum to how many characteristics a service can have?
-
I know this is an old topic I started but it seems like there is even less documentation now on this topic of using the BLE device as a peripheral. It would be nice if the documentation better represented common functionality and how the functionality is intended to be used with this device.
I tried to use those links that had reference to using the BLE device as a peripheral but the link was broken.
Hello! It looks like you're interested in this conversation, but you don't have an account yet.
Getting fed up of having to scroll through the same posts each visit? When you register for an account, you'll always come back to exactly where you were before, and choose to be notified of new replies (either via email, or push notification). You'll also be able to save bookmarks and upvote posts to show your appreciation to other community members.
With your input, this post could be even better 💗
Register Login