pycom / pycom-micropython-sigfox

A fork of MicroPython with the ESP32 port customized to run on Pycom's IoT multi-network modules.
MIT License
198 stars 167 forks source link

Bluetooth API Features #176

Open innoagg opened 6 years ago

innoagg commented 6 years ago

Pycom MicroPython 1.18.0 [v1.8.6-849-046b350] on 2018-06-01; GPy with ESP32

The Bluetooth implementation is missing some critical features that make peripheral implementations difficult. The items listed below are not all of them, but cover the most important at least from my perspective in order of importance.

Advertising

  1. No way to set advertisement flags with set_advertisement. For example, the flags ESP_BLE_ADV_FLAG_GEN_DISC | ESP_BLE_ADV_FLAG_BREDR_NOT_SPT are hard coded.
  2. Advertisement intervals are hard coded.
  3. No way to configure a scan response.

Peripheral Connections

  1. The callback for CLIENT_CONNECTED / CLIENT_DISCONNECTED events is missing any information about the client such as Mac address or some kind of connection handle. Connection management is impossible without. All callback should identify which client it is for.
  2. Method to disconnect a particular connected client. There appears to be a method disconnect_client but it is not clear which connection is terminates if there are multiple active.
  3. Bonding or encrypting the BLE connection does not appear to be supported.
iwahdan88 commented 6 years ago

Hello @innoagg ,

Currently we are working on updating Wifi and BLE modules for more configurability and new features. Thanks for pointing out these points, I have them in the Backlog. I expect these updates to be added by mid of this month.

Thanks Cheers

innoagg commented 6 years ago

Any news on timing for these BLE items. I did not see any changes in the latest release.

iwahdan88 commented 6 years ago

Hi @innoagg , BLE updates are still not released , we are working on releasing these updates as soon as possible, sorry for the Delays.

innoagg commented 6 years ago

Thanks, Eagerly awaiting as I have found couple more items I hope are addressed...

Characteristics defined on the pycom device as PROP_WRITE only can in fact be read successfully by a client. The pycom device should send back an indication that it cannot be read (normally 0x0403)

Also, perhaps I am not seeing how, but one should be able to send back a response code to a client connection in response to a characteristic write operation to indicate success or to validate values.

innoagg commented 5 years ago

Found another BLE implementation shortcoming. Hardcoded scan interval and window is a big issue for us. Can't achieve 100% scan duty cycle.

What BLE enhancements will be included with the 1.19 (soon?) release?

gretel commented 5 years ago

it's getting disappointing in terms of what is sold and actually works.