"the index bluetooth does not exist", BGM113 on imp005


I’m using an imp005 and Silabs BGM113, I’m trying to use setscanparams() and startscan() to see how many adverts I get from nearby devices but I can’t seem to make it run.

Before that, I must open the bluetooth connection but I don’t know how to properly do that.

My bluetooth device is at uart0, and suppose the baudRate is 111111.

How can I start it if I cannot use hardware.bluetooth.open() and I don’t know the firmware?

Thanks for your time!

imp005 does not have the BLE API as it has no BLE radio. To use the BLE API you need an imp004m (with the BLE jumpers fitted, see docs), or an impC001 with a pre-release OS build and an external 43438 or 43455 chip.

If you’re using an external BLE processor like the BGM113, you need to talk to the chip using its own UART protocol.

Back before SiLabs acquired BlueGiga, there was the BLE112, which is almost compatible with the BGM113, and we did a driver library for this which talked the BGAPI to the device.

See https://github.com/electricimp/reference/tree/master/hardware/ble112

To enable BGAPI support on the BGM113 I believe you need to configure and build firmware for the chip (it’s provided by SiLabs) - after this firwmare is loaded then the driver class for the imp should talk to the BLE chip. In the examples/firmware directory there are some examples for the BLE112 but you may need to dig a bit to work out how to do this on the BGM113.

1 Like

Thanks a lot for this insight, it was very helpful.

BTW, this document helps a lot to sort out the differences between the BLE family and the BGM113: https://www.silabs.com/documents/login/application-notes/AN1036-Migration-BLE113-BGM113.pdf

Hi does anyone know how to integrate or include the library in electricimp console from github ?

I assume you mean the web IDE?

No, you can’t pull on GitHub content from there, but you can do so if you use our cli tools impt and Builder, eg. @include "github:ElectricImpSampleCode/BuilderDemo/logging.nut"

You can find details and tutorials here.