# Connect to TTN with a virtual gateway on my computer for testing

**URL:** <https://www.thethingsnetwork.org/forum/t/connect-to-ttn-with-a-virtual-gateway-on-my-computer-for-testing/36297>\
**Category:** Gateways\
**Created:** [April 20, 2020, 6:36am UTC](https://www.thethingsnetwork.org/forum/t/connect-to-ttn-with-a-virtual-gateway-on-my-computer-for-testing/36297 "2020-04-20T06:36:49Z")\
**Posts on this page:** 1\
**Showing post:** 4

<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:** [April 21, 2020, 7:43am UTC](https://www.thethingsnetwork.org/forum/t/connect-to-ttn-with-a-virtual-gateway-on-my-computer-for-testing/36297/4 "2020-04-21T07:43:58Z")

</div>

> [@sagar](#):
>
> Actually I am trying to simulate the whole data flow(From node → Gateway → TTN).

I’d not do that. In the end TTN will just forward the received data to some application that you will need to develop yourself, or to a third-party using an integration. Time used on trying to simulate that part would better be spent on other parts. And since you need to ask how to do it:

> [@https://github.com/Lora-net/packet\_forwarder/blob/master/PROTOCOL.TXT](https://www.thethingsnetwork.org/forum/t/https-github-com-lora-net-packet-forwarder-blob-master-protocol-txt/35934/5):
>
> When sending packets to TTN you need to keep in mind that that infrastructure is being used by thousands of people for their sensor data. Your attempts could interfere with that use.

That said, it might be good to understand how a gateway communicates with TTN. Reading [the old Semtech forwarder protocol](https://github.com/Lora-net/packet_forwarder/blob/master/PROTOCOL.TXT) might give you an idea, and so does [the more recent Basic Station protocol](https://doc.sm.tc/station/). I’d just not try to emulate the whole flow. Focus on the application, and get some hands-on experience with hardware instead.

Also: TTN Console allows for simulating uplinks in the Device Overview page. This expects an non-encrypted application payload (which, in an encrypted version, would be part of a full LoRaWAN packet as sent by the device):

 ![Simulate uplink](https://www.thethingsnetwork.org/forum/uploads/default/original/3X/9/5/9532eb6aa2ac9ce589898f93cbf4dfcd6704a379.png)

The same can be achieved [with the `ttnctl` command-line interface](https://www.thethingsnetwork.org/docs/network/cli/api.html#ttnctl-devices-simulate).

And you might be lucky anyway: [Can I use TTN without my own gateway if one is nearby?](https://www.thethingsnetwork.org/forum/t/can-i-use-ttn-without-my-own-gateway-if-one-is-nearby/35957)

---

_[View the full topic](https://www.thethingsnetwork.org/forum/t/connect-to-ttn-with-a-virtual-gateway-on-my-computer-for-testing/36297)._
