# Lights on/Off TTN Node Code

**URL:** <https://www.thethingsnetwork.org/forum/t/lights-on-off-ttn-node-code/18388>\
**Category:** End Devices (Nodes)\
**Created:** [October 3, 2018, 8:24am UTC](https://www.thethingsnetwork.org/forum/t/lights-on-off-ttn-node-code/18388 "2018-10-03T08:24:17Z")\
**Posts on this page:** 1\
**Showing post:** 2

<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:** [October 4, 2018, 4:44am UTC](https://www.thethingsnetwork.org/forum/t/lights-on-off-ttn-node-code/18388/2 "2018-10-04T04:44:35Z")

</div>

> [@Barlin1](#):
>
> ```cpp
> void message(const uint8_t *payload, size_t size, port_t port) {
> 
> ```

After this line, add a line like `debugSerial.println("-- DOWNLINK");` to ensure you’re getting data.

(And note that, while a nice test, this is not a good use case for LoRaWAN. The `poll` methods sends an uplink to TTN, and sending every 10 seconds [will soon get to the maximum of 30 seconds daily air time on TTN](https://www.thethingsnetwork.org/forum/t/limitations-data-rate-packet-size-30-seconds-uplink-and-10-messages-downlink-per-day-fair-access-policy/1300). Also, please see [How do I format my forum post? [HowTo]](https://www.thethingsnetwork.org/forum/t/how-do-i-format-my-forum-post/8735) Success!)

---

_[View the full topic](https://www.thethingsnetwork.org/forum/t/lights-on-off-ttn-node-code/18388)._
