How to implement Rak4631 BLE security

Greetings, I wish to use BLE DFU example but need to ensure only authorized connections can upload new firmware. How can I implement a PIN so user must enter it before being allowed to pair with device and perform DFU?

I am not worried about encrypting the connection. I simply need to ensure device only permits pairing with authorized phones.

Device does not have display screen so it can’t display randomly generated pin. I would need to set a pin manually within the firmware.

Thanks for any pointers.

Hi Ryan,

RUI3 or open source Arduino BSP?

For RUI3, have a look into the BLE API ==> setPin. Encryption is not implemented at the moment.

For open source Arduino, there is an example how to set the pairing pin in the BSP, look for Peripheral ==> pairing_pin.ino

1 Like

Wow, that was easy! For reference I’m using Arduino BSP and it is as simple as:

Bluefruit.Security.setPIN("123456"); before calling bleuart.begin();


This topic was automatically closed 2 days after the last reply. New replies are no longer allowed.