LoPy Nano Gateway

From Things Calderdale Wiki
Revision as of 08:48, 6 June 2017 by Andrewback (talk | contribs) (The Things Network)
Jump to: navigation, search


The Pycom LoPy module can be configured as a low cost LoRaWAN "Nano-Gateway" that connects to a back-end (network core) via WiFi.

This short guide covers the key configuration points only. For the official Pycom documentation which covers Nano-Gateway configuration, and LoPy filesystem and FTP access, in greater detail, see:


Download and modify configuration files

1. Download the Pycom libraries and examples from:

2. Expand the zip file and navigate to the examples/nano-gateway directory.

3. Modify the config.py file:

  • GATEWAY_ID = “70b3d54996xxxxxx” — put the EUID on the bottom of the LoPy here, without any colons or spaces.
  • WIFI_SSID = “” — put the SSID of the WiFi network you wish the gateway to use here.
  • WIFI_PASS = “” — put the WiFi password here

Update the module firmware =

Although it may work fine without doing so, it is recommended to update the LoPy firmware:

Upload Nano-Gateway application

1. It’s best to set the LoPy into safe mode by connecting pin G28 & 3v3 to ensure the LoPy is in FTP/WiFi AP mode.

  • Pin G28 is on the corner of the expansion board near the “Pymaker” text.

2. Connect your laptop/computer to the LoPy WiFi access point.

  • The default SSID should look like “lopy-wlam-xxxx”, where xxxx is part of the EUI of the LoPy.
  • The default password is “www.pycom.io”.

3. Using the Filezilla FTP setup procedure described here connect to the LoPy.

  • Note that the number of connections must be limited and plain/no encryption must be set.
  • Once connected Filezilla should show:

Filezilla Connected.png

4. Change into the flash directory:

Filezilla flash directory.png

5. Copy the following 3 files from the example “lorawan-nano-gateway” to the /flash directory in the LoPy:

  • main.py
  • config.py
  • nanogateway.py

The other files are not required unless the gateway is to be tested using a LoPy

If prompted, select to overwrite main.py.

6. Once the transfer is complete reboot your LoPy.

Note that if you are connected via serial you should see an output similar to:

Nano-Gateway boot.png

The Things Network

Register the gateway

1. Using your browser connect to the things network.

2. Create an account (or log into your existing account).

3. Go to the Console.

4. Select Gateways > register gateways.

5. Type the gateway ID from the bottom of your LoPy (without any colons or spaces).

6. Tick I’m using the legacy packet forwarder.

TTN Console Legacy Packet Forwarder.png

7. Add a description i.e. “My micro gateway”.

8. The Frequency plan should be set to Europe.

9. Register this gateway.

10. Reboot your LoPy.

The status in The Things Network Console should now show as connected.

TTN Console Nano-Gateway connected.png