Bluetooth working with MKR Vidor 4000

I was able to get the ArduinoBLE sketches working with a custom fork of nina-fw based on v1.5.0. If you are interested here are the links to my forks.

The compiled binary and instructions for flashing the firmware are under nina-fw.

WiFiNINA is not needed for Bluetooth, but this is a fork of v1.8.13 that includes a fix for the Vidor. It works with any of the newer unsupported NINA firmware versions including this custom one.

This solution is intended to work with the default VidorPeripherals v1.1.0 and bitstream. A limitation of this is that it uses the default UART pins between the FPGA and NINA, so serial debugging on the NINA is sacrificed during run-time. This does not negatively affect bootloader/flashing though.

This was my first challenge since getting the Vidor recently. I am not a professional software developer, so it's not pretty and I still have to wrinkles to iron out. I tested it with the EnhancedAdvertising and BatteryMonitor sketches, but I don't have it working reliably yet when the board is powered up standalone -- some sort of timing/race condition or Nina reset problem. Ideas/contributions are welcome.

I will post updates if I make any more progress on this, but I'm really hoping the Arduino team can test and make the changes in the official libraries.

Turns out the standalone boot issue was just the BatteryMonitor example sketch. In setup() it has an infinite loop of its not plugged in to a PC -- while(!Serial){}. So, the modified ArduinoBLE is in fact working, but it still needs some polishing. The NINA reset procedure in BluetoothLocalDevice.cpp is spaghetti code that I only managed to get working as written. Each attempt I've made to clean it up breaks it.

My ArduinoBLE fork has been updated with a branch that includes the ability for the Arduino to initiate pairing and bonding with certain types of peripherals. My goal was to use an old Google Daydream VR controller as an input device since I have a couple of these lying around and they are super capable motion/touch controls. The trick to making these work was that they don't send data (notify) to the subscribed central device until they have a fully bonded/encrypted connection. So, this branch might be useful to anyone else trying to implement pairing/bonding with other devices. It should be cross compatible with other Arduino boards, and backwards compatible with previous firmware versions, but I have only tested on the Vidor 4000 and MKR WiFi 1010.

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