LoPy-nano-gateway-wan-public: Difference between revisions
Jump to navigation
Jump to search
(→LoPy) |
|||
(9 intermediate revisions by the same user not shown) | |||
Line 12: | Line 12: | ||
**Run LoPy Nano Gateway code | **Run LoPy Nano Gateway code | ||
== Thethingsnetwork Server == | |||
*Register Account | |||
1. Go to [https://account.thethingsnetwork.org/register TheThingsNetwork] | |||
2. Enter username, email and password | |||
3. Click "Create Account" | |||
4. Then Follow instruction to verify your email-address | |||
*Setup Gateway | |||
1. Go to [https://console.thethingsnetwork.org/ TheThingsNetwork Console] | |||
2. Click on Gateway | |||
3. Click "register gateway" | |||
4. Select "package forwarder | |||
5. Enter Gateway EUI | |||
(Note: To get Device EUI. Execute these code in LoPy. [https://www.thethingsnetwork.org/docs/devices/lopy/usage.html Reference]) | |||
from network import LoRa | |||
import binascii | |||
lora = LoRa(mode=LoRa.LORAWAN) | |||
print(binascii.hexlify(lora.mac()).upper().decode('utf-8')) | |||
6. Enter Description | |||
7. Select Frequency Plan | |||
8. Enter Location | |||
9. Select Antenna Placment | |||
10. Click Register Gateway | |||
*Change Gateway Setting | |||
1. Go to [https://console.thethingsnetwork.org/gateways Gateways Page] | |||
2. Click on the gateway that just created. | |||
3. Click "Setting" | |||
4. In "Router" Field. Enter the following: router.eu.thethings.network:1700 | |||
(Note: We want to forward our package from LoPy Nano Gateway to "router.eu.thethings.network:1700" the other router may not work) | |||
5. Click "Update Gateway" | |||
== LoPy == | == LoPy == | ||
*Update firmware to 1.6.7.b1 | |||
1. Follow the official LoPy upgrade guide [https://docs.pycom.io/pycom_esp32/pycom_esp32/getstarted.html#firmware-upgrades Firmware-Upgrade] | |||
*Download LoPy Nano Gateway Code | |||
1. Go to [https://github.com/pycom/pycom-libraries/tree/master/examples/lorawan-nano-gateway LoPy Github] | |||
2. Download the file: main.py, config.py and nanogateway.py | |||
*Change config.py configuration | |||
1. Open and edit "config.py" file | |||
2. Update GATEWAY_ID to Device EUI. | |||
WIFI_SSID to ssid of wireless access point. | |||
WIFI_PASS to password of wireless access point. | |||
3. Save the file | |||
*Upload main.py, config.py and nanogateway.py to "flash" directory of LoPy. | |||
1. Via FTP: Follow this [https://docs.pycom.io/pycom_esp32/pycom_esp32/toolsandfeatures.html?highlight=ftp#pycom-filesystem Pycom-Filesystem] | |||
*Reset the LoPy | |||
After reset the LoPy we should see the gateway status in [https://console.thethingsnetwork.org/gateways Gateways Page] to connected. Then we can create [https://console.thethingsnetwork.org/applications Application], Register Device, and test ABP or OTAA code in [https://github.com/pycom/pycom-libraries/tree/master/examples/lorawan-nano-gateway github example code] | |||
== References == | |||
These page follow example from: | |||
1. [https://forum.pycom.io/topic/810/new-firmware-release-1-6-7-b1-lorawan-nano-gateway-with-ttn-example LoPy LoRaWan Nano-Gateway Guide] | |||
2. [https://www.thethingsnetwork.org/docs/gateways/registration.html The Things Network Gateway Registration Guide] |
Latest revision as of 15:00, 15 March 2017
LoPy nano gateway and Thethingsnetwork
In this page, We are going to:
- In Thethingsnetwork Server
- Setup Gateway
- Create Application
- Register Device
- In LoPy
- Update LoPy firmware to 1.6.7.b1
- Configure LoPy code to forward message to Thethingsnetwork Server
- Run LoPy Nano Gateway code
Thethingsnetwork Server
- Register Account
1. Go to TheThingsNetwork 2. Enter username, email and password 3. Click "Create Account" 4. Then Follow instruction to verify your email-address
- Setup Gateway
1. Go to TheThingsNetwork Console 2. Click on Gateway 3. Click "register gateway" 4. Select "package forwarder 5. Enter Gateway EUI (Note: To get Device EUI. Execute these code in LoPy. Reference) from network import LoRa import binascii lora = LoRa(mode=LoRa.LORAWAN) print(binascii.hexlify(lora.mac()).upper().decode('utf-8')) 6. Enter Description 7. Select Frequency Plan 8. Enter Location 9. Select Antenna Placment 10. Click Register Gateway
- Change Gateway Setting
1. Go to Gateways Page 2. Click on the gateway that just created. 3. Click "Setting" 4. In "Router" Field. Enter the following: router.eu.thethings.network:1700 (Note: We want to forward our package from LoPy Nano Gateway to "router.eu.thethings.network:1700" the other router may not work) 5. Click "Update Gateway"
LoPy
- Update firmware to 1.6.7.b1
1. Follow the official LoPy upgrade guide Firmware-Upgrade
- Download LoPy Nano Gateway Code
1. Go to LoPy Github 2. Download the file: main.py, config.py and nanogateway.py
- Change config.py configuration
1. Open and edit "config.py" file 2. Update GATEWAY_ID to Device EUI. WIFI_SSID to ssid of wireless access point. WIFI_PASS to password of wireless access point. 3. Save the file
- Upload main.py, config.py and nanogateway.py to "flash" directory of LoPy.
1. Via FTP: Follow this Pycom-Filesystem
- Reset the LoPy
After reset the LoPy we should see the gateway status in Gateways Page to connected. Then we can create Application, Register Device, and test ABP or OTAA code in github example code
References
These page follow example from:
1. LoPy LoRaWan Nano-Gateway Guide 2. The Things Network Gateway Registration Guide