ArduinoR4 WiFi and VS1053

Hello,
I try to make a music player with Arduino R4 WiFi and a VS1053 board.
I can't compilate the sketch : #include "wiring_private.h" is the problem.
I search in Internet a solution and it seams that R4 is not compatible with the library Adafruit_VS1053.
Someone knows if it's right and if I have to change my R4 to an R3 ?

Thanks'

Solution : Thank you @ptillish
For who is interessted, the solution is :
Download the good library here : GitHub - motazEmad/Adafruit_VS1053_Library: This is a Arduino library for the Adafruit VS1053 Codec Breakout and Music Maker Shields
If you use SdFat to access the datas on the SDCard, edit Adafruit_VS1053.h and comment some lines like this :

//#if defined(PREFER_SDFAT_LIBRARY)
#include <SdFat.h>
extern SdFat SD;
//#else
//#include <SD.h>
//#endif

There is a pull request against the Adafruit library.

You probably want to visit the Adafruit support forum.

I saw it and visit the forum... Adafruit said that R4 is not an Adafruit product and they don't work for others companies... No comment ! :persevere:

That is true about the R4, but Adafruit created the library.

You might want to contact Limor Fried, the head of Adafruit. I believe her email is
limor@adafruit.com

I have had problems with developers who work with Adafruit in the past. I found Limor to be approachable and easy to work with. Unfortunately, some of the developers are arrogant and do not have Adafruit's best interests at heart.

I hope you can get a resolution to your issue.

1 Like

Thanks', I send a message !!!

Hello Sir,
I send you a message because I have a problem of compatibility between a vs1053 board and an Arduino R4 Wifi.
I try to find a solution in internet and forum and it seams that Uno R4 is not compatible with the Adafruit_VS1053.h library. The problem is signaled for a long time here (compatibility with Arduino UNO R4 Wifi board by motazEmad · Pull Request #95 · adafruit/Adafruit_VS1053_Library · GitHub) and nothing change.
As I develop a product, I want to know if the problem will be solved or not. If he don't, I have to search a solution without R4.
Thank you for your answer.

I will post the response here.

Hi @afigiboto. I'll provide instructions you can follow to install the beta test version of the library that has the proposed changes to add support for the UNO R4 WiFi (as mentioned by @MrY in post #2):

A. Uninstall Release Version of Library

  1. Select Sketch > Include Library > Manage Libraries... from the Arduino IDE menus to open the "Library Manager" view in the left side panel.
  2. Type Adafruit VS1053 Library in the "Filter your search..." field.
  3. Scroll down through the list of libraries until you see the "Adafruit VS1053 Library" entry.
  4. Hover the mouse pointer over the "Adafruit VS1053 Library" entry.
  5. You will see a ●●● icon appear near the top right corner of the library entry. Click on that icon.
    A context menu will open.
  6. Select "Remove" from the menu.
    An "Uninstall" dialog will open.
  7. Click the "YES" button in the "Uninstall" dialog to confirm that you want to uninstall the library.
    The dialog will close.
  8. Wait for the uninstall process to finish, as indicated by a notification at the bottom right corner of the Arduino IDE window:

    ⓘ Successfully uninstalled library ...

B. Install Beta Test Version of Library

  1. Click the following link to open the GitHub repository homepage of the contributor's staging fork of the library repository in your web browser:
    https://github.com/motazEmad/Adafruit_VS1053_Library
  2. Click the "Code ▾" button you see on that page.
  3. Select Download ZIP from the menu.
    A download of the ZIP file of the library will start.
  4. Wait for the download to finish.
  5. Select Sketch > Include library > Add .ZIP Library from the Arduino IDE menus.
    The "Select the zip file containing the library you'd like to add" dialog will open.
  6. Select the downloaded file from the dialog.
  7. Click the "Open" button.
    The dialog will close.
  8. Wait for the installation process to finish, as indicated by a notification at the bottom right corner of the Arduino IDE window:

    ⓘ Successfully installed library from ...

Hello,

Thanks' for the response.
I'm in linux and I can't uninstall as you tell. I don't have uninstall in the IDE, I have to detete the folder. I think it's all right, no ?

With the new paquage, the #include "wiring_private.h" error desappear. Cool !!!

But I have a problem with SdFat.h. It works with SD.h, but not with SdFat.

I try 2 libraries : the greiman one (GitHub - greiman/SdFat: Arduino FAT16/FAT32 exFAT Library) and the Adafruit one.
It's the same problem.

Do you know if it's possible to access the datas with SdFat ?

Thank you.

OK, this is because you are using an outdated version of Arduino IDE. You might have ended up with this version unintentionally if you installed Arduino IDE via a package manager (e.g., APT). The instructions I provided are for use with the modern Arduino IDE 2.x versions (e.g., 2.3.4). Unless you have a specific reason for using the old 1.x IDE, I recommend you update.

You can download Arduino IDE 2.x from the link on the "Software" page:

Yes, that is perfectly fine. I only chose to use the Library Manager feature in my instructions because that is easier for the average Arduino user (who often are not experienced in working directly with the filesystem).

Please provide a detailed description of what you mean by this in a reply on this forum thread, including:

  • What did you do?
  • What were the results you expected from doing that thing?
  • What were the results you observed that did not match your expectations?

Make sure to include the full and exact text of any error or warning messages you might have encountered.

I am certain it is, because the author of the library has tested it with the UNO R4 WiFi:

Note that, although that thread is about performance problems, the library was still functional when used with the UNO R4 WiFi. I believe the performance has also improved since that time.

Ok, I've a new IDE ! Nice !!! Thanks' :wink:
All the libraries are clean.

My project is, with an app, to acces to the midi files who are in the SDCard on my VS1053, select a file and play it.

I have an Arduino R4 WiFi and a VS1053. This one :

I can acces to the files list in BLE on my app. I've to use SdFat because the names of files are some times long (more than 8 caracters).

I've a great collection of errors :

In file included from /home/stef/Arduino/libraries/Adafruit_VS1053_Library-master/Adafruit_VS1053.h:28:0,
                 from /home/stef/.var/app/cc.arduino.IDE2/cache/.arduinoIDE-unsaved202516-52-td1i1v.ma5oj/sketch_feb6a/sketch_feb6a.ino:4:
/home/stef/.arduino15/libraries/SD/src/SD.h:62:7: error: 'Sd2Card' does not name a type; did you mean 'SdCard'?
       Sd2Card card;
       ^~~~~~~
       SdCard
/home/stef/.arduino15/libraries/SD/src/SD.h:63:7: error: 'SdVolume' does not name a type; did you mean 'FsVolume'?
       SdVolume volume;
       ^~~~~~~~
       FsVolume
/home/stef/.arduino15/libraries/SD/src/SD.h:71:34: error: 'SD_CHIP_SELECT_PIN' was not declared in this scope
       bool begin(uint8_t csPin = SD_CHIP_SELECT_PIN);
                                  ^~~~~~~~~~~~~~~~~~
/home/stef/.arduino15/libraries/SD/src/SD.h:71:34: note: suggested alternative: 'SD_CHIP_SELECT_MODE'
       bool begin(uint8_t csPin = SD_CHIP_SELECT_PIN);
                                  ^~~~~~~~~~~~~~~~~~
                                  SD_CHIP_SELECT_MODE
In file included from /home/stef/.var/app/cc.arduino.IDE2/cache/.arduinoIDE-unsaved202516-52-td1i1v.ma5oj/sketch_feb6a/sketch_feb6a.ino:4:0:
/home/stef/Arduino/libraries/Adafruit_VS1053_Library-master/Adafruit_VS1053.h:347:3: error: reference to 'File' is ambiguous
   File currentTrack;             //!< File that is currently playing
   ^~~~
In file included from /home/stef/.var/app/cc.arduino.IDE2/cache/.arduinoIDE-unsaved202516-52-td1i1v.ma5oj/sketch_feb6a/sketch_feb6a.ino:3:0:
/home/stef/Arduino/libraries/SdFat_-_Adafruit_Fork/src/SdFat.h:458:16: note: candidates are: typedef class File32 File
 typedef File32 File;
                ^~~~
In file included from /home/stef/Arduino/libraries/Adafruit_VS1053_Library-master/Adafruit_VS1053.h:28:0,
                 from /home/stef/.var/app/cc.arduino.IDE2/cache/.arduinoIDE-unsaved202516-52-td1i1v.ma5oj/sketch_feb6a/sketch_feb6a.ino:4:
/home/stef/.arduino15/libraries/SD/src/SD.h:28:9: note:                 class SDLib::File
   class File : public Stream {
         ^~~~
In file included from /home/stef/.var/app/cc.arduino.IDE2/cache/.arduinoIDE-unsaved202516-52-td1i1v.ma5oj/sketch_feb6a/sketch_feb6a.ino:4:0:
/home/stef/Arduino/libraries/Adafruit_VS1053_Library-master/Adafruit_VS1053.h:365:31: error: reference to 'File' is ambiguous
   unsigned long mp3_ID3Jumper(File mp3);
                               ^~~~
In file included from /home/stef/.var/app/cc.arduino.IDE2/cache/.arduinoIDE-unsaved202516-52-td1i1v.ma5oj/sketch_feb6a/sketch_feb6a.ino:3:0:
/home/stef/Arduino/libraries/SdFat_-_Adafruit_Fork/src/SdFat.h:458:16: note: candidates are: typedef class File32 File
 typedef File32 File;
                ^~~~
In file included from /home/stef/Arduino/libraries/Adafruit_VS1053_Library-master/Adafruit_VS1053.h:28:0,
                 from /home/stef/.var/app/cc.arduino.IDE2/cache/.arduinoIDE-unsaved202516-52-td1i1v.ma5oj/sketch_feb6a/sketch_feb6a.ino:4:
/home/stef/.arduino15/libraries/SD/src/SD.h:28:9: note:                 class SDLib::File
   class File : public Stream {
         ^~~~
In file included from /home/stef/.var/app/cc.arduino.IDE2/cache/.arduinoIDE-unsaved202516-52-td1i1v.ma5oj/sketch_feb6a/sketch_feb6a.ino:4:0:
/home/stef/Arduino/libraries/Adafruit_VS1053_Library-master/Adafruit_VS1053.h:365:31: error: 'File' has not been declared
   unsigned long mp3_ID3Jumper(File mp3);
                               ^~~~
/home/stef/.var/app/cc.arduino.IDE2/cache/.arduinoIDE-unsaved202516-52-td1i1v.ma5oj/sketch_feb6a/sketch_feb6a.ino: In function 'void playMidiFile(const char*)':
/home/stef/.var/app/cc.arduino.IDE2/cache/.arduinoIDE-unsaved202516-52-td1i1v.ma5oj/sketch_feb6a/sketch_feb6a.ino:127:10: error: 'class Adafruit_VS1053' has no member named 'startPlayingFile'
   player.startPlayingFile(fullPath);
          ^~~~~~~~~~~~~~~~
/home/stef/.var/app/cc.arduino.IDE2/cache/.arduinoIDE-unsaved202516-52-td1i1v.ma5oj/sketch_feb6a/sketch_feb6a.ino:128:17: error: 'class Adafruit_VS1053' has no member named 'playingMusic'
   while (player.playingMusic()) {
                 ^~~~~~~~~~~~

exit status 1

Compilation error: 'class Adafruit_VS1053' has no member named 'startPlayingFile'

I solve a part of my problem. In Adafruit_VS1053.h, I comment some lines. It's better.

//#if defined(PREFER_SDFAT_LIBRARY)
#include <SdFat.h>
extern SdFat SD;
//#else
//#include <SD.h>
//#endif

Great work on troubleshooting the cause of the errors! Are you still experiencing a compilation error? If so, please post the updated compilation output, just as you did in post #9.

Yes I have some errors, it's certainly because I code with my feet :wink:
But there are less !!! So cool !

/home/stef/Arduino/sketch_feb6a/sketch_feb6a.ino: In function 'void playMIDI(const char*)':
/home/stef/Arduino/sketch_feb6a/sketch_feb6a.ino:144:10: error: 'class Adafruit_VS1053' has no member named 'startPlayingFile'
   player.startPlayingFile(path);
          ^~~~~~~~~~~~~~~~
/home/stef/Arduino/sketch_feb6a/sketch_feb6a.ino:146:17: error: 'class Adafruit_VS1053' has no member named 'playingMusic'
   while (player.playingMusic()) {
                 ^~~~~~~~~~~~

exit status 1

Compilation error: 'class Adafruit_VS1053' has no member named 'startPlayingFile'

Done !! I effectively code with my feet !
Thanks' @ptillish for help.
Subject close for me... others problems others subjects :wink:

You are welcome. I'm glad you were able to solve all the problems. Thanks for taking the time to post an update!

Regards, Per