After Callback not received, it is no more possible to send

Hello
My problem is not that it doesn’t receive the callback but that you can’t send after that.
I have the problem that after sending out a message with:

    if (LMIC.opmode & OP_TXRXPEND)
    {
        Serial2.println(F("OP_TXRXPEND, not sending"));
    }
    else
    {
        // Prepare upstream data transmission at the next possible time.
        reciveack = false;
        LMIC_setTxData2(1, mydata, sizeof(mydata) - 1, 1);
        Serial2.println(F("Packet queued"));
    }

And sometimes no callback was received (e.g. because of too bad reception quality) I can’t send a message afterwards and it is always in the

    if (LMIC.opmode & OP_TXRXPEND)
    {
        Serial2.println(F("OP_TXRXPEND, not sending"));
    }

Remains .

Even after an

os_clearCallback(&LMIC.osjob);

where afterwards the value of :

bool timeCriticalJobs = os_queryTimeCriticalJobs(ms2osticksRound((TX_INTERVAL * 1000)));

changes from True to False, a message still cannot be sent via uplink.

ESP32 S3 devkitc 16 MB flash 8 MB ram,
mcci-catena/MCCI LoRaWAN LMIC library @ ^4.0.0
sx1276

Can you tell us exactly which LMIC & version you are using.

And exactly what the make, model, flash & RAM on the device you are using please.

ESP32 S3 devkitc 16 MB flash 8 MB ram,
mcci-catena/MCCI LoRaWAN LMIC library @ ^4.0.0
The ini file:


[env:esp32-s3-devkitc-1-n16r8v]
platform = espressif32
board = esp32-s3-devkitc-1-n16r8v
framework = arduino
upload_speed = 2000000     ;ESP32S3 USB-Serial Converter maximum 2000000bps
upload_port = COM14
monitor_speed = 115200
monitor_port = COM15
debug_tool = esp-builtin
debug_init_break = break setup
build_type = debug

[env]
lib_deps =
    mcci-catena/MCCI LoRaWAN LMIC library @ ^4.0.0
	mikalhart/TinyGPSPlus@^1.0.3
	
build_flags =
    -D ARDUINO_LMIC_PROJECT_CONFIG_H_SUPPRESS
    -D CFG_eu868=1
    -D LMIC_DEBUG_LEVEL=0
    -D CFG_sx1276_radio=1
    -D DISABLE_PING=1
    -D DISABLE_BEACONS=1
    -D hal_init=LMICHAL_init

Ok I don’t like the solution but it works:

After the
os_clearCallback(&LMIC.osjob);

You have to set

LMIC.opmode = 2304

Please don’t ask me where the number 2304 comes from, I have read the number from a valid LMIC.opmode once. I can’t find this value either as HEX or as a decimal number in the library.

If you find a solution that solves this better please post it as I suspect my solution may lead to other problems later.

Which LoRa radio board & how it’s connected.

Why not 4.1.1, latest?

I’ve not tried the hal_init option before, but that would speak to the internals not working as expected, where did you get that as a setting from - tutorial or other source?

There is no such thing as too much detail. Be expansive.