# Can I tell on which channel an RN2483 has just sent?

**URL:** <https://www.thethingsnetwork.org/forum/t/can-i-tell-on-which-channel-an-rn2483-has-just-sent/5350>\
**Category:** End Devices (Nodes)\
**Created:** [February 11, 2017, 3:52pm UTC](https://www.thethingsnetwork.org/forum/t/can-i-tell-on-which-channel-an-rn2483-has-just-sent/5350 "2017-02-11T15:52:16Z")\
**Posts on this page:** 1\
**Showing post:** 3

<div class="post-metadata">

**Author:** ![arjanvanb](https://www.thethingsnetwork.org/forum/user_avatar/www.thethingsnetwork.org/arjanvanb/32/46626_2.png) [@arjanvanb](https://www.thethingsnetwork.org/forum/u/arjanvanb)\
**Post date:** [February 19, 2017, 6:50pm UTC](https://www.thethingsnetwork.org/forum/t/can-i-tell-on-which-channel-an-rn2483-has-just-sent/5350/3 "2017-02-19T18:50:14Z")

</div>

No cigar yet, at least not without modifying libraries such as TTN’s Arduino library.

The `radio get freq` command seems to show the last frequency that was used by the built-in LoRaWAN stack. However, as LoRaWAN opens a receive window after transmitting, its response will be the frequency used during the RX1 or RX2 receive window. The first receive window RX1 uses the same frequency channel as the uplink. But most often RX2 is used last, ~~both when a downlink is received (as [TTN prefers RX2](https://www.thethingsnetwork.org/forum/t/why-is-rx-slot-1-not-used/2656)) and~~ when no downlink occurred at all.

So, after the TTN library returns from `ttn.sendBytes`, the uplink frequency has already been replaced by the RX1 or RX2 downlink frequency.

To circumvent this, one can change the library to await the first `ok` (after the `mac tx` command) and issue a `radio get freq` before the first receive window is opened. For the TTN library that seems to work just fine, also when downlinks are received. In version 2.2.2, [right after](https://github.com/TheThingsNetwork/arduino-device-lib/blob/740d606acdfd5d1fc470028950c2505ed40c6b40/src/TheThingsNetwork.cpp#L487-L494):

```
if (!sendPayload(mode, port, (uint8_t *)payload, length))
{
  debugPrintMessage(ERR_MESSAGE, ERR_SEND_COMMAND_FAILED);
  return TTN_ERROR_SEND_COMMAND_FAILED;
}

```

…add, quick & dirty but just for debugging:

```
// Debugging only:
// After transmitting the bytes, the RN2483 will open RX1 (same frequency)
// and possibly also RX2 (different frequency). Capture the last used
// frequency, before it is changed by opening RX2:
modemStream->write("radio get freq");
modemStream->write(SEND_MSG);
readLine(buffer, sizeof(buffer));
debugPrint(F("Sent uplink on freq: "));
debugPrintLn(buffer);
```

---

_[View the full topic](https://www.thethingsnetwork.org/forum/t/can-i-tell-on-which-channel-an-rn2483-has-just-sent/5350)._
