Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[SX128x] Cannot transmit after sleep() #1249

Closed
jacobeva opened this issue Oct 2, 2024 · 1 comment
Closed

[SX128x] Cannot transmit after sleep() #1249

jacobeva opened this issue Oct 2, 2024 · 1 comment
Labels
bug Something isn't working resolved Issue was resolved (e.g. bug fixed, or feature implemented)

Comments

@jacobeva
Copy link
Contributor

jacobeva commented Oct 2, 2024

Describe the bug
After putting the module into sleep mode, even if the module is woken up after by pulling SS LOW, all attempts to transmit will result in RADIOLIB_ERR_TX_TIMEOUT. In my example sketch below, the "transmitting..." line is never sent over serial if the call to sleep is not commented out.

To Reproduce

#include <Arduino.h>
#include "Adafruit_TinyUSB.h"
#include <SPI.h>
#include <variant.h>
#include <RadioLib.h>

    SX1280 radio = new Module(24, 15, 16, 25);

volatile bool packet_rx = false;
int packets = 0;

void setflag() {
    packet_rx = true;
}

void setup() {
    Serial.begin(115200);
    while(!Serial);
    uint8_t sf = 10;
      int state = radio.begin(2408, 1625, sf, 5);// 0x14 1, 30);
      radio.setRfSwitchPins(19, 20);
      radio.explicitHeader();
radio.setCRC(2);
      //radio.setSyncWord(0x14, 0x24);
  if (state == RADIOLIB_ERR_NONE) {
    Serial.println(F("success!"));
  } else {
    Serial.print(F("failed, code "));
    Serial.println(state);
    while (true) { delay(10); }
  }
  radio.sleep();
}

void loop() {
    digitalWrite(24, LOW);
    delay(1);
    digitalWrite(24, HIGH);
    delay(1);
    radio.standby();
    uint8_t data[255] = {0};
    for (int i = 0; i < 255; i++) {
        data[i] = i;
    }
    int16_t status;
    while (true) {
    status = radio.transmit(data, 255);
    //radio.transmit(data, 7);
    if (status == RADIOLIB_ERR_NONE) Serial.println("transmitting...");
    }
}

Expected behavior
Transmitting after sleep should work as expected.

Additional info (please complete):

  • Library version 7.0.0
@jgromes
Copy link
Owner

jgromes commented Oct 2, 2024

Resolved by merging #1250

@jgromes jgromes closed this as completed Oct 2, 2024
@jgromes jgromes added the resolved Issue was resolved (e.g. bug fixed, or feature implemented) label Oct 2, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working resolved Issue was resolved (e.g. bug fixed, or feature implemented)
Projects
None yet
Development

No branches or pull requests

2 participants