RadioLIb examples return CHIP_NOT_FOUND error

I am trying to run examples provided by RadioLib LoRa library as it has built-in supports the Artemis Arduino Core.

However all the examples are failing to initialize the Radio.

I am using RadioLib at version 4.4.2: https://github.com/jgromes/RadioLib

I’ve loaded the SX126x_Transmit.ino as an example.

// SX1262 has the following connections:
// NSS pin:   10
// DIO1 pin:  2
// NRST pin:  3
// BUSY pin:  9
SX1262 radio = new Module(10, 2, 3, 9);
void setup() {
  Serial.begin(9600);

  // initialize SX1262 with default settings
  Serial.print(F("[SX1262] Initializing ... "));
  int state = radio.begin();
  if (state == ERR_NONE) {
    Serial.println(F("success!"));
  } else {
    Serial.print(F("failed, code "));
    Serial.println(state);
    while (true);
  }

  // some modules have an external RF switch
  // controlled via two pins (RX enable, TX enable)
  // to enable automatic control of the switch,
  // call the following method
  // RX enable:   4
  // TX enable:   5
  /*
    radio.setRfSwitchPins(4, 5);
  */
}

The example is failing when radio.begin() is called.

08:21:28.477 -> [SX1262] Initializing ... failed, code -2
/*!
  \brief Radio chip was not found during initialization. This can be caused by specifying wrong chip type in the constructor
  (i.e. calling SX1272 constructor for SX1278 chip) or by a fault in your wiring (incorrect slave select pin).
*/
#define ERR_CHIP_NOT_FOUND                            -2

Has anyone attempted to use LoRa RadioLib to do peer-to-peer LoRa transmission?

I have also tried using the example provided in the Tutorial and I am getting the exact same issue:

https://learn.sparkfun.com/tutorials/sp … er-example

I also am having the same problem. I’ve spent many hours trying to get the explorable board to work, but, no luck.

Hi there,

It sounds like you are trying to use the built-in examples from the library. Please use the [example code files provided in the hookup guide (see boxes at the top).](https://learn.sparkfun.com/tutorials/sparkfun-explorable-hookup-guide/peer-to-peer-example)

Previously, users had to download the modified library and use our example code:

  • - I just updated the hookup guide to make it more obvious that users needed to use our example code
  • - Following the [[suggestions from the pull request](https://github.com/jgromes/RadioLib/pull/239#issuecomment-774224560), I have updated the example code and instructions in the hookup guide, so that users can use the default RadioLib library
  • [/list]

    This should be more straight forward for users, as long as they use our example code.](New platform support for SparkFun LoRa Thing Plus - expLoRaBLE by lewispg228 · Pull Request #239 · jgromes/RadioLib · GitHub)

    The example code does not compile on the LoRa Thing Plus with Apollo3 2.1.1 and RadioLib 5.0.0. This is the example file I’m referring to: https://cdn.sparkfun.com/assets/learn_t … evised.ino

    Output:

    Arduino: 1.8.13 (Linux), Board: "LoRa Thing Plus expLoRaBLE, 460800, SparkFun Variable Loader (Recommended)"
    
    
    
    
    
    
    
    
    
    
    
    WARNING: Category '' in library BurstMode is not valid. Setting to 'Uncategorized'
    WARNING: Category '' in library WDT is not valid. Setting to 'Uncategorized'
    sketch_dec06c:27:51: error: no matching function for call to 'Module::Module(PinName, PinName, PinName, PinName, arduino::MbedSPI&)'
     SX1262 radio = new Module(D36, D40, D44, D39, SPI1);
                                                       ^
    In file included from ../libraries/RadioLib/src/RadioLib.h:38,
                     from /tmp/arduino_modified_sketch_928642/sketch_dec06c.ino:20:
    ../libraries/RadioLib/src/Module.h:73:5: note: candidate: 'Module::Module(const Module&)'
         Module(const Module& mod);
         ^~~~~~
    ../libraries/RadioLib/src/Module.h:73:5: note:   candidate expects 1 argument, 5 provided
    In file included from ../libraries/RadioLib/src/RadioLib.h:38,
                     from /tmp/arduino_modified_sketch_928642/sketch_dec06c.ino:20:
    ../libraries/RadioLib/src/Module.h:49:5: note: candidate: 'Module::Module(pin_size_t, pin_size_t, pin_size_t, pin_size_t, arduino::SPIClass&, arduino::SPISettings)'
         Module(RADIOLIB_PIN_TYPE cs, RADIOLIB_PIN_TYPE irq, RADIOLIB_PIN_TYPE rst, RADIOLIB_PIN_TYPE gpio, SPIClass& spi, SPISettings spiSettings);
         ^~~~~~
    ../libraries/RadioLib/src/Module.h:49:5: note:   candidate expects 6 arguments, 5 provided
    ../libraries/RadioLib/src/Module.h:32:5: note: candidate: 'Module::Module(pin_size_t, pin_size_t, pin_size_t, pin_size_t)'
         Module(RADIOLIB_PIN_TYPE cs, RADIOLIB_PIN_TYPE irq, RADIOLIB_PIN_TYPE rst, RADIOLIB_PIN_TYPE gpio = RADIOLIB_NC);
         ^~~~~~
    ../libraries/RadioLib/src/Module.h:32:5: note:   candidate expects 4 arguments, 5 provided
    /tmp/arduino_modified_sketch_928642/sketch_dec06c.ino: In function 'void setup()':
    sketch_dec06c:40:16: error: 'ERR_NONE' was not declared in this scope
       if (state == ERR_NONE) {
                    ^~~~~~~~
    /tmp/arduino_modified_sketch_928642/sketch_dec06c.ino:40:16: note: suggested alternative: 'IRQ_NONE'
       if (state == ERR_NONE) {
                    ^~~~~~~~
                    IRQ_NONE
    /tmp/arduino_modified_sketch_928642/sketch_dec06c.ino: In function 'void loop()':
    sketch_dec06c:75:16: error: 'ERR_NONE' was not declared in this scope
       if (state == ERR_NONE) {
                    ^~~~~~~~
    /tmp/arduino_modified_sketch_928642/sketch_dec06c.ino:75:16: note: suggested alternative: 'IRQ_NONE'
       if (state == ERR_NONE) {
                    ^~~~~~~~
                    IRQ_NONE
    sketch_dec06c:84:23: error: 'ERR_PACKET_TOO_LONG' was not declared in this scope
       } else if (state == ERR_PACKET_TOO_LONG) {
                           ^~~~~~~~~~~~~~~~~~~
    /tmp/arduino_modified_sketch_928642/sketch_dec06c.ino:84:23: note: suggested alternative: 'ENAMETOOLONG'
       } else if (state == ERR_PACKET_TOO_LONG) {
                           ^~~~~~~~~~~~~~~~~~~
                           ENAMETOOLONG
    sketch_dec06c:88:23: error: 'ERR_TX_TIMEOUT' was not declared in this scope
       } else if (state == ERR_TX_TIMEOUT) {
                           ^~~~~~~~~~~~~~
    /tmp/arduino_modified_sketch_928642/sketch_dec06c.ino:88:23: note: suggested alternative: 'AP3_TIMEOUT'
       } else if (state == ERR_TX_TIMEOUT) {
                           ^~~~~~~~~~~~~~
                           AP3_TIMEOUT
    exit status 1
    no matching function for call to 'Module::Module(PinName, PinName, PinName, PinName, arduino::MbedSPI&)'
    
    
    This report would have more information with
    "Show verbose output during compilation"
    option enabled in File -> Preferences.
    

    Revert to the RadioLib library version 4.6.0

    It looks like Jan (who maintains the library) made some significant changes in the latest release (see the release notes of the GitHub repo). Unfortunately, I’m a little too busy too look into the library changes and find a work around. If you really need to use the latest library; it’d probably be best to file an issue in the GitHub repo and work with Jan to debug the issue. However, reverting to version 4.6.0 of the Arduino library is probably the simplest solution.