Your First LoRaWAN Node on The Things Network

Chris just shared a new tutorial: "Your First LoRaWAN Node on The Things Network"

In the lasts article we looked at Building a LoRaWAN Nano Gateway to The Things Network. There wasn’t a lot to do there. We put together the Pycom hardware, configured The Things Network to see our Pycom device as a Gateway, then we took code supplie…

Read more

1 Like

Thank you for tutorial!

Your First LoRaWAN Node on The Things Network

For this tutorial, am i need 2 lopys (or fipy etc.) I have just one fipy and i want send data to TTN (ABP). Is it possible ?

Hi smnc,

The Fipy supports LoRa so you can send data to TTN from it no problems!

In the tutorial Chris used a second Lopy as the Gateway, but if there is a Gateway in your area there is no need to make your own to get data to TTN.

Check out if you have any coverage by going to

Node is not getting coonected to the gateway as it only showing not joined yet.

Hi Prachi,

Are you sure that you have coverage from a Gateway where you are located?

Hi, thanks for the tutorial,

I just get a brand new lopy4 and a TTN Gateway im trying to display de device EUI but i dont know why it cant, please help me

Hi Ricardo,

You can get the device EUI by running the following code in REPL:

from network import LoRa
import ubinascii

lora = LoRa()
print("DevEUI: %s" % (ubinascii.hexlify(lora.mac()).decode('ascii')))

Hi @Stephen,

thank you for your answer, actually I managed to solve the problem this way:

from network import WLAN
from network import LoRa
import ubinascii

lora = LoRa(mode=LoRa.LORA, region=LoRa.US915)
print("DevEUI: %s" % (ubinascii.hexlify(lora.mac()).decode('ascii')))

I had to pass to LoRa class the mode and region parameters, without them the error raises

Hi Ricardo,

You may have problems using US915 rather than AU915. Seems like it will be fine but perhaps you payloads will be passed through the wrong servers.

I realized I have a solution for this problem in our TTN series of tutorials:

from network import LoRa 
import binascii 
lora = LoRa(mode=LoRa.LORAWAN) 

You can find them all here:


Would just like to clarify the code you have listed for I think there are a couple of typo’s…

You still have ‘import config’

As you stated that was not included hence the LORA_FREQUENCY declaration. I had to comment it out to get it to work.

Also under ‘set the LoRaWAN data rate’ the ‘config.’ is still in front of LORA_NODE_DR

Thanks for all your efforts with these tutorials, I am loving them


Hi David,

I updated the tutorial to reflect your recommended changes. Good catch!

Hi. I find these discussion useful.
Though this discussion was closed a very very long time before now, I would like to seek help for my confusion.

I got a new Lopy4 (node) and the RAK831 Pilot gateway. I want to form a network between the two (node sending the packet and Gateway receiving it).

However, in these discussion I could feel that everywhere the TTN and registration is mentioned. Actually, my project is simple where I don’t want to use the TTN where I need not have to register my Gateway.

Do I have to use the above coding which you all have provided? Or I can have a simple coding where I don’t have to join the TTN but just send the packets to my RAK831 pilot gateway? If the coding will be different, would appreciate if you help me to share the coding please.

I am new to micropython indeed.

Thank you

Attempting to get my first TTN node up and running, TTN Gateway tutorial requires addition of authentication details (see screen grab). Dev_addr and Appkey are clear but which one of the other two keys on the TTN console screen grab is required in the code?

Seems there may have been changes since the tutorial was made?

TTN Console

1 Like

Hi Neil,

Welcome back!

PS: I’ve removed your network and security keys as they are sensitive bits of information - make sure not to share those ones!
What hardware did you have on hand? and what were you looking to do with your project?

With the update to TTNv3 single-channel gateways have been deprecated, which means a few of our guides need some touch-ups! (which includes the Nano gateway guide)

If you’re just looking to send data Peer-Peer you can use LoRaMAC, check out the Pycom documentation on how to set it up here: LoRa-MAC (Raw LoRa)

If you have any questions feel free to send them through!