RadioLib: E22-900M30S not working, E22-900M22S on same board does

Sketch that is causing the module fail

#include <RadioLib.h>

// SX1262 has the following connections:
// NSS pin:   33
// DIO1 pin:  27
// NRST pin:  NC
// BUSY pin:  35
SX1262 lora = new Module(33, 27, RADIOLIB_NC, 35);

// or using RadioShield
// https://github.com/jgromes/RadioShield
//SX1262 radio = RadioShield.ModuleA;

// or using CubeCell
//SX1262 radio = new Module(RADIOLIB_BUILTIN_MODULE);

void setup() {
  Serial.begin(115200);

  // initialize SX1262 with default settings
  SPI.begin(18, 19, 23, 33);
  pinMode(21, OUTPUT);
  
  int state = lora.begin(904.0, 125.0, 7, 5, 0x1424, 14, 8);
  lora.setDio2AsRfSwitch(true);
  lora.setRfSwitchPins(21, RADIOLIB_NC);
  lora.setTCXO(1.8);
  Serial.print(F("[SX1262] Initializing ... "));
  if (state == RADIOLIB_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
  /*
    lora.setRfSwitchPins(4, 5);
  */
  }
}
void loop() {
  Serial.print(F("[SX1262] Transmitting packet ... "));

  // you can transmit C-string or Arduino string up to
  // 256 characters long
  // NOTE: transmit() is a blocking method!
  //       See example SX126x_Transmit_Interrupt for details
  //       on non-blocking transmission method.
  int state = lora.transmit("Hello World!");

  // you can also transmit byte array up to 256 bytes long
  /*
    byte byteArr[] = {0x01, 0x23, 0x45, 0x56, 0x78, 0xAB, 0xCD, 0xEF};
    int state = lora.transmit(byteArr, 8);
  */

  if (state == RADIOLIB_ERR_NONE) {
    // the packet was successfully transmitted
    Serial.println(F("success!"));

    // print measured data rate
    Serial.print(F("[SX1262] Datarate:\t"));
    Serial.print(lora.getDataRate());
    Serial.println(F(" bps"));

  } else if (state == RADIOLIB_ERR_PACKET_TOO_LONG) {
    // the supplied packet was longer than 256 bytes
    Serial.println(F("too long!"));

  } else if (state == RADIOLIB_ERR_TX_TIMEOUT) {
    // timeout occured while transmitting packet
    Serial.println(F("timeout!"));

  } else {
    // some other error occurred
    Serial.print(F("failed, code "));
    Serial.println(state);

  }

  // wait for a second before transmitting again
  delay(1000);
}

Hardware setup https://github.com/sudomesh/disaster-radio/tree/master/hardware/board_esp32_v3

Debug mode output https://gist.github.com/code8buster/5eb6c5c973f2a27737e2a6f3cc47cd0e Edit: Things got a little jumbled radiolib900m30s.log shows the -20 wrong modem error only occurs under these conditions:

  1. start with board powered, flashed with sketch configured for 900m22s and working
  2. flash board, sketch configured to use 900m30s
  3. no power cycle between flashes.

the other, radiolib900m30s-powercycle.log occurs after the first power cycle or starting from an erased flash.

note the similarity to #586

Additional info (please complete):

  • MCU: ESP32-WROOM-32U
  • Link to Arduino core: arduino-esp32
  • Wireless module type SX1262 Ebyte E22-900M30S
  • Arduino IDE version = 1.8.19
  • Library version = 5.4.1 / Latest master checkout

What is odd is that this module works just fine when I compile meshtastic firmware/1.2-legacy branch. I also include a verbose debug log from that in the gists. New versions of meshtastic give the same problem as above since they now track upstream RadioLib (though not when trying to use the 900m22s)

details relating to meshtastic 1.2-legacy:

About this issue

  • Original URL
  • State: closed
  • Created 2 years ago
  • Comments: 20 (10 by maintainers)

Most upvoted comments

The thing that confuses me the most is the fact that it is working in prior version - since then there were quite a few changes, including at the level of SPI communications, which complicates the comparison.

The main issue (and what drives to the hardware conclusion) is the fact that I can’t seem to replicate this with NRST connected. I even tried with older version of ESP32 Arduino core. I’d love to take a look at the hardware (this sort of thing is really bugging me!), but unfortunately the time I get to spend on these projects has been pretty limited.

I will keep this open in case there are any more insights.