Author Topic: BLE module with serial API built in?  (Read 793 times)

0 Members and 1 Guest are viewing this topic.

Offline mark03Topic starter

  • Frequent Contributor
  • **
  • Posts: 711
  • Country: us
BLE module with serial API built in?
« on: April 02, 2024, 03:34:17 am »
Long ago I used a bluetooth module which shipped with some firmware allowing easy interfacing to a host MCU.  There was a binary API running over SPI or UART where you could send it commands to set up the GATT services and so on.  It didn't require building a separate application to run on the module processor; the pre-loaded firmware was enough.

Is there any modern BLE module that works like this?  I just need to add BLE connectivity to an existing project and I would really like to avoid getting tooled up for a whole extra MCU.  I'm planning to use connection-oriented channels (L2CAP COC) to transfer data to a PC.
 

Offline Psi

  • Super Contributor
  • ***
  • Posts: 9954
  • Country: nz
Re: BLE module with serial API built in?
« Reply #1 on: April 02, 2024, 04:04:20 am »
There are modules that support BLE functions all done over UART.
« Last Edit: April 02, 2024, 04:09:42 am by Psi »
Greek letter 'Psi' (not Pounds per Square Inch)
 

Offline shabaz

  • Regular Contributor
  • *
  • Posts: 147
Re: BLE module with serial API built in?
« Reply #2 on: April 02, 2024, 04:42:08 am »
It sounds like you're looking for something like Laird BT860, which does offer HCI over UART. Available from Mouser for about $10 in single qty.

However if you want something very lightweight for your microcontroller, then there are simpler interfaces.
For example, Silabs had quite a convenient range, called BGX that uses very simple AT commands. However it's EOS, and the replacement is Laird Lyra, e.g. part code 453-00090R ($6 in single qty, $5 in 1000 qty). I've not used Lyra, but have used BGX13P in the past, it was easy to use, and I believe Lyra can use the same identical serial AT commands.

If you really want to save costs then there is DA14531MOD, ($5 single qty, but $3 in 1000 qty) and it can have special firmware loaded into it, called CodeLess, which allows simple AT commands to be used to control it. Otherwise, by default it can be used as a normal microcontroller with BLE. I've only used it with C code as a normal microcontroller, so I don't know how good/bad the CodeLess feature is. The main downside of the DA14531MOD is that it really is extremely basic, not a lot of compute power, but that depends on your needs. The Lyra product is likely a lot more powerful, but it costs more.
 

Offline mark03Topic starter

  • Frequent Contributor
  • **
  • Posts: 711
  • Country: us
Re: BLE module with serial API built in?
« Reply #3 on: April 02, 2024, 04:55:01 pm »
I don't know that it needs to be quite as simple as AT commands.  The host processor is a STM32L4 which is doing a fair bit of signal-processing work, but ought to have enough cycles left over for this.

I finally remembered the API I used before, while looking at Silabs stuff.  It was called BGAPI and I think whichever company had it was acquired by Silabs.  It appears that their new parts still use BGAPI, and they support L2CAP COC  :-+

I haven't played around at the HCI level so couldn't say if that would be too low or not.  But isn't that a legacy Bluetooth thing?  Is there such a protocol as HCI for BLE?
 

Offline selcuk

  • Regular Contributor
  • *
  • Posts: 126
  • Country: tr
Re: BLE module with serial API built in?
« Reply #4 on: April 02, 2024, 09:39:16 pm »
You can use an ESP32 module flashed with open source esp-at firmware. esp-at has BLE, classic Bluetooth, Wi-Fi and Ethernet controlled with AT commands. It runs like a modem. But you need to build and flash the firmware.

https://docs.espressif.com/projects/esp-at/en/latest/esp32/AT_Command_Set/BLE_AT_Commands.html
 

Offline shabaz

  • Regular Contributor
  • *
  • Posts: 147
Re: BLE module with serial API built in?
« Reply #5 on: April 02, 2024, 09:52:09 pm »

Please take the attached diagram with a pinch of salt (it was just some personal notes, I may have got it wrong)
I was under the impression that HCI was used at the interface shown with the green dashed line, for BLE, but my understanding could be completely wrong there.
I've never worked with HCI, I've always just gone with the simpler AT commands that some of the BLE chipsets have offered, or alternatively just used the C SDK for BLE, i.e. just directly used as a microcontroller.
I think I may have used BGAPI, I can't recall in detail. It may be the same as what they now call Xpress command API but I'm fuzzy on it since it was so long ago.


 

Offline NaDobraNich

  • Regular Contributor
  • *
  • Posts: 53
  • Country: ca
Re: BLE module with serial API built in?
« Reply #6 on: April 02, 2024, 11:48:28 pm »
UBlox has a "Uconnect" which is AT Commands over UART with some interesting features. A transparent "data mode" and a you're in control "command mode".
 

Offline mark03Topic starter

  • Frequent Contributor
  • **
  • Posts: 711
  • Country: us
Re: BLE module with serial API built in?
« Reply #7 on: April 03, 2024, 04:59:41 pm »
I think I may have used BGAPI, I can't recall in detail. It may be the same as what they now call Xpress command API but I'm fuzzy on it since it was so long ago.

Ah, thanks for this.  Some googling for "BGX" (Bluetooth Xpress) clarified the difference between BGAPI and BGX.  It looks like BGAPI is the somewhat lower-level API which is more capable, whereas BGX is more like the AT command sets with fairly limited functionality but a very easy set up.  Different Silabs modules support one or the other.

I think I will give BGAPI a go since I used it once before.  If I were going to develop from scratch I think I would use Nordic but I really don't want to spend the time :)

Next thing to figure out is if I can do this feasibly without hardware flow control.  I left myself a header with UART TX/RX but no RTS/CTS.  Should be a conservative approach that will prevent filling the module buffer.  Hopefully.
 


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf