LoPy-nano-gateway-wan-private: Difference between revisions

From UNamur InfoSec
Jump to navigation Jump to search
Line 5: Line 5:


In this page we are going to:
In this page we are going to:
*Install open source private LoRa server (by [https://github.com/brocaar Orne Brocaar])
1.Install open source private LoRa server (by [https://github.com/brocaar Orne Brocaar])
*Setup LoPy as single channel nano gateway
2.Setup LoPy as single channel nano gateway
*Send data from LoPy node
3.Send data from LoPy node


Install private LoRa server:
----
 
1.Install private LoRa server:


We use [https://github.com/brocaar/loraserver-setup LoRa Server Setup] Ansible playbook to install all the LoRa server component:
We use [https://github.com/brocaar/loraserver-setup LoRa Server Setup] Ansible playbook to install all the LoRa server component:
Line 26: Line 28:
*We can use our machine IP address and port 1700 for our gateway to forward the package (We do this later in setup LoPy as Nano Gateway below)
*We can use our machine IP address and port 1700 for our gateway to forward the package (We do this later in setup LoPy as Nano Gateway below)


Setup LoPy as a Single channel nano gateway: (Reference [https://forum.pycom.io/topic/810/new-firmware-release-1-6-7-b1-lorawan-nano-gateway-with-ttn-example Pycom Forum] [https://github.com/pycom/pycom-libraries/tree/master/examples/lorawan-nano-gateway Github Code]
----
 
2.Setup LoPy as a Single channel nano gateway: (Reference [https://forum.pycom.io/topic/810/new-firmware-release-1-6-7-b1-lorawan-nano-gateway-with-ttn-example Pycom Forum] [https://github.com/pycom/pycom-libraries/tree/master/examples/lorawan-nano-gateway Github Code]


*Update LoPy firmware to 1.6.7.b1
*Update LoPy firmware to 1.6.7.b1
Line 49: Line 53:
  mosquitto_sub -t "gateway/#" -v
  mosquitto_sub -t "gateway/#" -v


Send data from LoPy node:
----
 
3.Send data from LoPy node:


*Register node in server
*Register node in server

Revision as of 12:09, 10 March 2017


Link title

LoPy Nano-gateway and private lora-server installation

In this page we are going to: 1.Install open source private LoRa server (by Orne Brocaar) 2.Setup LoPy as single channel nano gateway 3.Send data from LoPy node


1.Install private LoRa server:

We use LoRa Server Setup Ansible playbook to install all the LoRa server component:

For testing use vagrant to install the server to virtual machine in our local pc (We will update the guide to deploy later):

 git clone https://github.com/brocaar/loraserver-setup.git
  • Go to loraserver-setup folder (In terminal or CMD)
 cd loraserver-setup
  • Run vagrant up
 vagrant up
  • The virtual machine will boot and install all the component (This can take a while)
  • Note: we can access the server web interface at https://localhost:8080/ (As a self-signed certificate is used, your browser will prompt that the certificate can't be trusted. This is ok for testing)
  • We can use our machine IP address and port 1700 for our gateway to forward the package (We do this later in setup LoPy as Nano Gateway below)

2.Setup LoPy as a Single channel nano gateway: (Reference Pycom Forum Github Code

  • Update LoPy firmware to 1.6.7.b1
  • Download the code
  • Edit the config.py file to setup: Gateway ID, Server IP, Server Port, Wifi Access Point for LoPy to connect to the network.
 GATEWAY_ID = '11aa334455bb7788'
 SERVER = 'ip.address.here'
 PORT = 1700
 WIFI_SSID = 'my-wifi'
 WIFI_PASS = 'my-wifi-password'
    • Note: We can get gateway id by execute these code in LoPy (Referenece TTN):
 from network import LoRa
 import binascii
 lora = LoRa(mode=LoRa.LORAWAN)
 print(binascii.hexlify(lora.mac()).upper().decode('utf-8'))
  • Copy the code to the 'flash' folder of LoPy:
 Via FTP:
 Follow this reference to connect to LoPy via FTP pycom
  • Reset LoPy

We should be able to see the message from gateway from MQTT server with this topic (Reference loraserver):

mosquitto_sub -t "gateway/#" -v

3.Send data from LoPy node:

  • Register node in server
  • Send data from node (LoPy)
  • Subscribe to node data from server:

LoPy Nano-gateway and private Lora-server experiments