Setting Nano IoT 33 to receive audio via Bluetooth Classic

Hello everyone, I recently started an Arduino-based project, in which I'm trying to play music on an old boombox, using Bluetooth. Due to some limitations, I decided to work with the mentioned system, as it is capable of Bluetooth Classic and hence can use A2DP for audio.
For that, I planned to receive the data from the phone to the W102 using this project, which created an A2DP library for ESP32. Then, I wanted to transfer the data directly to one of the PWM-capable pins of the Arduino board, which is then connected to an amplifier and the speakers.
However, while doing so, I encountered few problems:

  1. I tried to find how the NINA W102 board pins are mapped and connected to the main Arduino/SAMD21 pins. I did find this map:


    However, I suspect it is irrelevant to the Nano 33 IoT board, as when I tried to redirect the input to any of the ports, I could not detect any PWM signal (not by connecting to a multimeter nor by connecting to the amp). I also tried randomly assigning different pin numbers, hoping to catch something, but of course it failed.
    So, the first question is, where can I find the relevant map? Again, I am trying to find which pins of the Arduino can receive data from the NINA-W102.

  2. The second problem is that if I upload any sketch to the Arduino board, The Bluetooth connection is lost and I cannot retrieve it until I use the Passthrough sketch again:
    To enable a Bluetooth Classic connection between the phone (for example) and the Arduino board, I followed the instructions on this thread. Briefly, as far as I understand, the process is first uploading to the Arduino a sketch that makes it a passthrough to the NINA W102 board. Then, we can upload whichever relevant sketch to the NINA-W102, followed by uploading the main Arduino sketch. For that manner, I used some of the example sketches in the ESP32-A2DP GitHub mentioned above. However, while I do manage to connect to the Arduino via Bluetooth after the passthrough-W102 sketch steps, once I upload a different sketch to the Arduino Nano 33 IoT - the connection is lost and I cannot see the Bluetooth client anymore. Once I re-upload the Passthrough sketch - all gets back to normal.

I would greatly appreciate any kind of help in these two problems.

1 Like

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