Coder Social home page Coder Social logo

simaticmeetslinux / iot2050-loragateway-mpcie Goto Github PK

View Code? Open in Web Editor NEW
1.0 1.0 0.0 34.87 MB

Instructions for using the IOT2050 as a LoRaWAN (Long Range Wide Area Nework) gateway with The Things Network as the network server. LoRaWAN Concentrator is realized with an mPCIe-card.

License: Other

Shell 100.00%
iot2050 lora lorawan lorawan-gateway mpcie node-red thethingsnetwork

iot2050-loragateway-mpcie's Introduction

LoRa Gateway

Overview

The application shows how a gateway can be built using the LPWAN technology Long Range (LoRa) and the IOT2050. The global, free LoRaWAN (Long Range Wide Area Network) from The Things Network or The Things Stack Community Edition is used as the network server. This manual describes the software and hardware structure of the gateway.

overview LoRa application

This application describes the setup with the WM1302 LoRaWAN Gateway Module (USB) - EU868.

Software

The following software is used for the application:

  • PuTTY V0.75 to access the IOT2050
  • optional: WINSCP V5.19.3 to copy prepared files to the IOT2050 (for autostart-function)

Hardware

The following hardware components are required for the application:

  • SIMATIC IOT2050 as the LoRaWAN-Gateway
  • WM1302 LoRaWAN Gateway Module (USB) - EU868
  • 2 dBi Dipole Antenna 863-870MHz with RP SMA (the selected antenna is based on the frequency range used in Europe from 863 to 870 MHz)
  • U.FL to reverse SMA adapter as antenna cable

Installation and commissioning of the IOT2050 LoRaWAN Gateway

The IOT2050 will be used as LoRaWAN gateway. As the IOT2050 does not include a LoRaWAN concentrator chip an additional LoRaWAN concentrator board is required. The seeed WM1302 mPCIe LoRaWAN concentrator board turned out to be perfectly suited for IOT2050. The installation and commissioning is very easy and straight forward.

Hardware installation

To access the mPCIe connector, the housing of the IOT2050 must be opened: Open the two screws on the X30-COM connector. Then the housing can be opened via the two indentations.

Hardware installation

In the next step the WM1302 board needs to be attached on the mPCIe slot of the IOT2050:

Hardware Installation

Afterwards the bulkhead cable and the antenna can be attached.

Hardware Installation

Prepare the IOT2050

Follow SIMATIC_IOT2050_Setting_up.md for the following steps:

  • Installing the SD-Card Example Image (in this example the image V1.2.1 was used)
  • First commissioning of the SIMATIC IOT2050: Remote access with Putty SSH Connection
  • Working internet connection on the IOT2050

Software installation and commissioning

Setup the The Things Network Account as LoRa server

After these steps the IOT2050 is ready for first boot. A The Things Network (TTN) account is required for the next steps. Simply go to https://www.thethingsnetwork.org/ and create a free (community) account:

Nr. Action
1. Press "Sign Up" in the upper right corner.
Registration TTN
2. Press "Get Started" under Community -> Individual.
Registration TTN
3. Select the "Europe 1"-Cluster.
Registration TTN
4. Press "Register".
Registration TTN
5. Fill in username, email address and password and click "Create Account".
Registration TTN
6. Go to your email inbox and activate the account via the email you received..
Registration TTN
7. The registration is now complete.

Create gateway application

After the initial setup has been finished and a TTN account has been created the WM1302 board can be set up. Make sure that the IOT2050 has an internet connection to allow installing required software packages and to be able to establish a connection to the TTN server. Open a ssh connection using putty and simply follow the getting started documentation from seeed starting at step 3 (get and compile sx1302 code).

NOTE: Make sure to use the global_conf.json.sx1250.EU868.USB file.

Gateway EUI: The Gateway EUI is a 64 bit extended unique identifier for your end device. You can put together the 16-digit combination of the numbers 0-9 and the letters A-F by yourself.

After following the instructions in step 3 and step 4 the gateway should appear in your TTN account:

Overview Gateway

Start the Application after Reboot

The application has no autostart function by default and must therefore be restarted manually after rebooting the IOT2050:

cd ~
cd sx1302_hal/
cd packet_forwarder/
./lora_pkt_fwd -c global_conf.json.sx1250.EU868.USB

Autostart of the LoRa-Gateway

The autostart of the gateway can be set up as follows: Use WINSCP to connect to the IOT2050. Go to the directory /root/sx1302_hal/packet_forwarder/. Copy the ready-made shell script start.sh into the directory:

Autostart - Copy start.sh

The script must then be provided with executable rights:

cd sx1302_hal/
cd packet_forwarder/
chmod 755 start.sh

Go to the directory /etc/systemd/system/. Copy the ready-made shell script iot2050-lora-gateway.service into the directory:

Autostart - Copy Service-File

The service file can now be started manually and tested with the following command:

cd /etc/systemd/system/
sudo systemctl start iot2050-lora-gateway.service

After successful start of the gateway (you can see if it's connected in The Things Network), it can be terminated with the following command:

sudo systemctl stop iot2050-lora-gateway.service

To enable the autostart of the service use the command:

sudo systemctl enable iot2050-lora-gateway.service

After the next reboot, the gateway will be started with every boot.

Contribution and Contribution License Agreement

Thank you for your interest in contributing. Anybody is free to report bugs, unclear documentation, and other problems regarding this repository in the Issues section. Additionally everybody is free to propose any changes to this repository using Pull Requests.

If you haven't previously signed the Siemens Contributor License Agreement (CLA), the system will automatically prompt you to do so when you submit your Pull Request. This can be conveniently done through the CLA Assistant's online platform. Once the CLA is signed, your Pull Request will automatically be cleared and made ready for merging if all other test stages succeed.

Licence and Legal Information

Please read the Legal information.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.