# MAC command DeviceTimeReq supported?

**URL:** <https://www.thethingsnetwork.org/forum/t/mac-command-devicetimereq-supported/19785>\
**Category:** v2 Backend\
**Created:** [November 14, 2018, 3:00pm UTC](https://www.thethingsnetwork.org/forum/t/mac-command-devicetimereq-supported/19785 "2018-11-14T15:00:45Z")\
**Posts on this page:** 11\
**Page:** 1

<div class="post-metadata">

**Author:** ![Verkehrsrot](https://www.thethingsnetwork.org/forum/user_avatar/www.thethingsnetwork.org/verkehrsrot/32/46588_2.png) [@Verkehrsrot](https://www.thethingsnetwork.org/forum/u/Verkehrsrot)\
**Post date:** [November 14, 2018, 3:00pm UTC](https://www.thethingsnetwork.org/forum/t/mac-command-devicetimereq-supported/19785/1 "2018-11-14T15:00:45Z")

</div>

With this [pull request](https://github.com/mcci-catena/arduino-lmic/pull/147) network time support as specified in LoRaWAN 1.0.3 was integrated in the LMIC stack maintained by MCCI.

I tried this on TTN, but was not yet successful getting a time from the network.

I’m not sure if this is a gateway issue, or a network issue. So my question is:

Has TTN the new MAC commands DeviceTimeReq / DeviceTimeAns implemented?

---

<div class="post-metadata">

**Author:** ![BoRRoZ](https://www.thethingsnetwork.org/forum/user_avatar/www.thethingsnetwork.org/borroz/32/44234_2.png) [@BoRRoZ](https://www.thethingsnetwork.org/forum/u/BoRRoZ)\
**Post date:** [November 14, 2018, 3:20pm UTC](https://www.thethingsnetwork.org/forum/t/mac-command-devicetimereq-supported/19785/2 "2018-11-14T15:20:36Z")

</div>

’ _MAC commands are processed by the back-end, not the gateway_ ’

see [https://github.com/kersing/packet\_forwarder/issues/25](https://github.com/kersing/packet_forwarder/issues/25)

---

<div class="post-metadata">

**Author:** ![Verkehrsrot](https://www.thethingsnetwork.org/forum/user_avatar/www.thethingsnetwork.org/verkehrsrot/32/46588_2.png) [@Verkehrsrot](https://www.thethingsnetwork.org/forum/u/Verkehrsrot)\
**Post date:** [November 15, 2018, 6:34am UTC](https://www.thethingsnetwork.org/forum/t/mac-command-devicetimereq-supported/19785/3 "2018-11-15T06:34:08Z")

</div>

Tested it. If i send a MAC command 0x0D (DeviceTimeReq), i don’t see an answer to it from the network. So i assume TTN does not support DeviceTimeReq (yet)?

---

<div class="post-metadata">

**Author:** ![BoRRoZ](https://www.thethingsnetwork.org/forum/user_avatar/www.thethingsnetwork.org/borroz/32/44234_2.png) [@BoRRoZ](https://www.thethingsnetwork.org/forum/u/BoRRoZ)\
**Post date:** [November 15, 2018, 7:40am UTC](https://www.thethingsnetwork.org/forum/t/mac-command-devicetimereq-supported/19785/4 "2018-11-15T07:40:10Z")

</div>

maybe @htdvisser can shed some light on this… will it be implemented in the upcoming V3 ? 🙄

---

<div class="post-metadata">

**Author:** ![htdvisser](https://www.thethingsnetwork.org/forum/user_avatar/www.thethingsnetwork.org/htdvisser/32/45312_2.png) [@htdvisser](https://www.thethingsnetwork.org/forum/u/htdvisser)\
**Post date:** [November 15, 2018, 8:54am UTC](https://www.thethingsnetwork.org/forum/t/mac-command-devicetimereq-supported/19785/5 "2018-11-15T08:54:09Z")

</div>

Yes, it will be in v3

---

<div class="post-metadata">

**Author:** ![Verkehrsrot](https://www.thethingsnetwork.org/forum/user_avatar/www.thethingsnetwork.org/verkehrsrot/32/46588_2.png) [@Verkehrsrot](https://www.thethingsnetwork.org/forum/u/Verkehrsrot)\
**Post date:** [November 15, 2018, 8:55am UTC](https://www.thethingsnetwork.org/forum/t/mac-command-devicetimereq-supported/19785/6 "2018-11-15T08:55:58Z")

</div>

So that means that it is not implemented in current V2?

---

<div class="post-metadata">

**Author:** ![htdvisser](https://www.thethingsnetwork.org/forum/user_avatar/www.thethingsnetwork.org/htdvisser/32/45312_2.png) [@htdvisser](https://www.thethingsnetwork.org/forum/u/htdvisser)\
**Post date:** [November 15, 2018, 8:59am UTC](https://www.thethingsnetwork.org/forum/t/mac-command-devicetimereq-supported/19785/7 "2018-11-15T08:59:54Z")

</div>

Correct

---

<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:** [November 15, 2018, 10:22am UTC](https://www.thethingsnetwork.org/forum/t/mac-command-devicetimereq-supported/19785/8 "2018-11-15T10:22:19Z")

</div>

As an aside: the V2 stack is open source 😉

[https://github.com/TheThingsNetwork/ttn/blob/v2.10.0/core/networkserver/uplink\_mac.go](https://github.com/TheThingsNetwork/ttn/blob/v2.10.0/core/networkserver/uplink_mac.go) shows nothing that relates to this. Of course, it could be hidden elsewhere, but as this uses [https://github.com/brocaar/lorawan/blob/master/mac\_commands.go](https://github.com/brocaar/lorawan/blob/master/mac_commands.go), one can peek into that code to reveal the name would be just as expected:

```auto
DeviceTimeReq CID = 0x0D
DeviceTimeAns CID = 0x0D

```

Hence, it’s safe to assume that a search for `DeviceTimeReq` in the `ttn` repository would return some results, if implemented.

That said, @htdvisser, the V3 stack is still closed, right?

---

<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:** [November 26, 2018, 11:38am UTC](https://www.thethingsnetwork.org/forum/t/mac-command-devicetimereq-supported/19785/9 "2018-11-26T11:38:20Z")

</div>

> [@Verkehrsrot](#):
>
> I tried this on TTN, but was not yet successful getting a time from the network.

Do you remember if the packet with the unsupported DeviceTimeReq MAC command still make it to the application’s Data page in TTN Console?

(If it did not, then that might explain [Cannot see data in device dashboard, while OTAA works and uplinks show in gateway's traffic - #11 by arjanvanb](https://www.thethingsnetwork.org/forum/t/cannot-see-data-in-device-dashboard-while-otaa-works-and-uplinks-show-in-gateways-traffic/20119/11). But given the empty `default` [in the code](https://github.com/TheThingsNetwork/ttn/blob/v2.10.0/core/networkserver/uplink_mac.go#L84) I’d assume that unsupported commands would just be ignored. It should then probably stop processing subsequent commands too though, as for unsupported MAC commands the server would not know if those provided any payload for such command; [issue #748](https://github.com/TheThingsNetwork/ttn/issues/748).)

---

<div class="post-metadata">

**Author:** ![Verkehrsrot](https://www.thethingsnetwork.org/forum/user_avatar/www.thethingsnetwork.org/verkehrsrot/32/46588_2.png) [@Verkehrsrot](https://www.thethingsnetwork.org/forum/u/Verkehrsrot)\
**Post date:** [November 26, 2018, 12:10pm UTC](https://www.thethingsnetwork.org/forum/t/mac-command-devicetimereq-supported/19785/10 "2018-11-26T12:10:07Z")

</div>

The packet was not displayed in console, what also means that a payload with embedded unsupported MAC command in FOpts field will get lost.

---

<div class="post-metadata">

**Author:** ![darkfader](https://www.thethingsnetwork.org/forum/user_avatar/www.thethingsnetwork.org/darkfader/32/27987_2.png) [@darkfader](https://www.thethingsnetwork.org/forum/u/darkfader)\
**Post date:** [May 5, 2020, 2:30pm UTC](https://www.thethingsnetwork.org/forum/t/mac-command-devicetimereq-supported/19785/11 "2020-05-05T14:30:51Z")

</div>

Any update on this? Is it in any TTN version or handler? (using SPF)
