SRXL2 library not recognized after manual install

I am trying to load the SRXL2 library from github into IDE 2.3.4 following directions I found online. After zipping and unzipping, I physically moved the file directory (not zipped) into the libraries directory where all other libraries are found. When compiling my test sketch with #include "spm_srxl.h" or #include <spm_xrxl.h>, I get a fatal error. When I attempt to include the library, the SRXL folder does not appear in the list. Can someone please help ???

Please post a link to the library.
Please post a link to the instructions that you found.

Please provide the full error message (in code tags please as described in https://forum.arduino.cc/t/how-to-get-the-best-out-of-this-forum/679966#use-code-tags).

Link to library: GitHub - SpektrumRC/SRXL2: Library code and documentation for the Spektrum SRXL2 bi-directional serial protocol

Link to instructions: adding a library from gitHub to Arduino IDE - Video Search Results

Sample sketch:

#include "spm_srxl.h"

void setup() {
  // put your setup code here, to run once:

}

void loop() {
  // put your main code here, to run repeatedly:

}

sketch_dec5a.ino:1:10: fatal error: spm_srxl.h: No such file or directory
#include "spm_srxl.h"
^~~~~~~~~~~~
compilation terminated.
exit status 1

Compilation error: spm_srxl.h: No such file or directory

I'll provide instructions you can follow to install the library:

  1. Select File > Preferences... (or Arduino IDE > Settings... for macOS users) from the Arduino IDE menus.
    The "Preferences" dialog will open.
  2. Take note of the path shown in the "Sketchbook location" field of the dialog.
  3. Click the "CANCEL" button.
    The "Preferences" dialog will close.
  4. Click the following link to open the library's GitHub repository homepage in your web browser:
    https://github.com/SpektrumRC/SRXL2
  5. Click the "Code ▾" button you see on that page.
  6. Select Download ZIP from the menu.
    A download of the ZIP file of the library will start.
  7. Wait for the download to finish.
  8. Extract the downloaded file.
  9. Copy the file Examples/spm_srxl_config.h to the Source folder.
  10. Open the Source/spm_srxl_config.h in any text editor.
  11. Make any necessary adjustments to the configuration defined in the file's code.
  12. Copy the Source folder from the extracted folder to the libraries subfolder of the path you saw in the "Sketchbook location" preference.
    The folder structure of the installation must look like this:
    <Sketchbook location>/
    ├── libraries/
    │   ├── Source/
    │   │   ├── spm_srxl.c
    │   │   ├── spm_srxl.h
    │   │   └── spm_srxl_config.h 
    │   ...
    ...
    
    (where <Sketchbook location> is the path from the Sketchbook location" preference)
  13. Select File > Quit (or Arduino IDE > Quit Arduino IDE for macOS users) from the Arduino IDE menus.
    All Arduino IDE windows will close.
  14. Start Arduino IDE.

You should note that the library is written in the C programming language, but the .ino files of Arduino sketches are compiled as C++.

This library is not at all user friendly and was never intended to be used with Arduino projects. It is possible to use it, and to use it in Arduino projects, but only by those who significant programming experience. If you don't have such experience then I think you are in for a very painful ordeal unless you can find some nice guidance in how to do it. I like to think I have a fair amount of experience, but I did not have any luck when I made some half hearted efforts at getting the thing to compile.

One trick you can do is to follow these steps:
Unzip the folder
Move it to the required destination
Look for the subfolder where the libraries are located in.
Zip only that subfolder while leaveing the rest of the folder unzipped
Use add .zip library and select the subfolder which you just zipped

This is how I fix this problem when I do encouter it.

I tried it and there are many more other libraries it requires a library to be installed even from the examples subfolder, which then requires something else called uart.h
So I really recommend you to follow @ptillisch advice abt the code

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