Skip to content

Commit

Permalink
Release 2.0.4-9-g3d5c686
Browse files Browse the repository at this point in the history
  • Loading branch information
anandsingh3 committed Jun 5, 2020
1 parent c29b850 commit 817e6e1
Show file tree
Hide file tree
Showing 283 changed files with 12,438 additions and 2,574 deletions.
18 changes: 18 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
language: minimal

services: docker

env: Dimg=lorabasics; Dname=basicstation-test

before_install:
- sudo chown -R 1000:1000 $TRAVIS_BUILD_DIR
- docker build . -t $Dimg
- docker run --init -d --name $Dname -v $TRAVIS_BUILD_DIR:/home/nonprivuser/travis -w /home/nonprivuser/travis $Dimg tail -f /dev/null
- export Dcmd="docker exec -t $Dname bash -c"

install:
# nothing to install

script:
# all commands must be quoted
- $Dcmd "make -C regr-tests ci s2core.info"
22 changes: 22 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,27 @@
# Changelog

## 2.0.4 - 2020-03-17

* lgw1302: Added sx1302 hal and integrated with corecell platform
* sys_linux: Fixed decoder pointer dereferencing (#39)
* s2e: Fixed memory corruption bug in JoinEui filter parsing (#31)
* s2e: Added DR and Freq fields to dntxed message (#37)
* s2e: Added error message type for printing LNS error into Station's log (#33)
* s2e: Added fts field to updf message
* net: Added Websocket PONG (#29)
* net: Added option for TLS server name indication/verification
* rt: Added MCU clock drift compensation for UTC time offset
* ral: Fixed dntxed message for short transmissions
* ral: Added Automatic channel allocation feature
* ral: Added fine timestamping in lgw2
* ral: Added automatic AES key derivation in lgw2
* ral: Added support for smtcpico platform (experimental) (#16)
* timesync: Correct UTC offset in case PPS offset is known
* lgwsim: Added lgw2 support
* pysys: Fixed Id6 category parsing (#28)
* tests: Added regression tests
* tests: Added Dockerfile

## 2.0.3 - 2019-03-14

* sys_linux: Fixed stdout/stderr redirection for logging
Expand Down
32 changes: 32 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
FROM ubuntu:18.04

ENV container=docker TERM=xterm LC_ALL=en_US LANGUAGE=en_US LANG=en_US.UTF-8
ENV DEBIAN_FRONTEND=noninteractive

# locale
RUN apt-get update -q > /dev/null && \
apt-get install --no-install-recommends -yq apt-utils locales language-pack-en dialog \
> /dev/null && \
locale-gen $LANGUAGE $LANG

# sudo commmand
RUN apt-get -yq install sudo > /dev/null

# non-privileged user
RUN echo "nonprivuser ALL=(ALL) NOPASSWD:ALL" >> /etc/sudoers
RUN useradd --no-log-init --home-dir /home/nonprivuser --create-home --shell /bin/bash -u 1000 \
nonprivuser && adduser nonprivuser sudo
USER nonprivuser
WORKDIR /home/nonprivuser

# system packages
RUN sudo apt-get install --no-install-recommends -yq \
git psmisc build-essential lcov curl netcat-openbsd \
python3 python3-pip python3-setuptools python3-wheel \
> /dev/null && \
sudo apt-get clean -q && \
sudo ln -s /usr/bin/python3 /usr/bin/python

RUN pip3 install aiohttp websockets


17 changes: 8 additions & 9 deletions LICENSE
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
--- Revised 3-Clause BSD License ---
Copyright (C) 2016-2019, SEMTECH (International) AG.
All rights reserved.
Copyright Semtech Corporation 2020. All rights reserved.

Redistribution and use in source and binary forms, with or without modification,
are permitted provided that the following conditions are met:
Expand All @@ -10,17 +9,17 @@ are permitted provided that the following conditions are met:
* Redistributions in binary form must reproduce the above copyright notice,
this list of conditions and the following disclaimer in the documentation
and/or other materials provided with the distribution.
* Neither the name of the copyright holder nor the names of its contributors
may be used to endorse or promote products derived from this software
without specific prior written permission.
* Neither the name of the Semtech corporation nor the names of its
contributors may be used to endorse or promote products derived from this
software without specific prior written permission.

THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
DISCLAIMED. IN NO EVENT SHALL SEMTECH BE LIABLE FOR ANY DIRECT, INDIRECT,
INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
DISCLAIMED. IN NO EVENT SHALL SEMTECH CORPORATION. BE LIABLE FOR ANY DIRECT,
INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE
OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Basic Station
# LoRa Basics™ Station

[Basic Station](https://doc.sm.tc/station) is a LoRaWAN Gateway implementation, including features like

Expand Down
26 changes: 26 additions & 0 deletions ROADMAP.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
# Basic Station Feature Roadmap

## Medium-term outlook

- **Station-internal health report**
Gateway health reporting is generally not viewed as core functionality of Basic Station. Therefore, it is expected that health and status reports are generated by tools and scripts running on the Gateway base system. Basic Station provides means to submit these reports via a UNIX named pipe to the LNS. In the future, Station will provide a way to generate internal health reports reflecting core metrics of internal components of Basic Station. The reports should be able to be sent periodically, triggered by an on-gateway process and queried by the LNS.

- **Response to router_config message**
The router_config message contains all the LNS-side configuration for the gateway, in particular the channel plan. Currently, no response to this message is sent by Station. In case of failure, the connection is closed. In the future, Station should respond to the router_config message, proving details in case the configuration could not be applied.

## Long-term outlook

- **Built-in AES key derivation for V2 gateways**
On V2 gateways the fine timestamps are encrypted with a chip-specific key. Semtech is moving away from this scheme. In the future, the encryption key will be derived by Basic Station directly and only decrypted fine timestamps are used.

- **NACK messages for failed TX**
Currently, the Basic Station protocol provides acknowledgements (`dntxed` message) for transmitted downlinks, giving the network server a guarantee that scheduled downlink message was put on air. In cases where the transmission could not be guaranteed, no notification is sent to the server. In the future, the Basic Station will provide feedback for dropped frame indicating the reason.

- **Protobuf message encoding**
Currently, the Basic Station Protocol uses JSON encoding for the messages exchanged over Websockets. In situations where backhaul connection bandwidth is scarce a more efficient encoding is desirable. First tests have shown that using "Protocol Buffers" encoding can reduce the message size of the most common messages by up to 70%.

- **Low-level PHY control option**
The Basic Station Protocol operates on LoRaWAN semantics, which allows LoRaWAN network server to abstract away all PHY layer control. In some situations, LoRaWAN network servers may want to have more fine-grained control over the PHY in order to support proprietary messages for example. It needs to be explored how the Basic Station protocol can provide the choice for lower-level control transparently while not forcing deep PHY knowledge on all protocol users.

- **Forwarding of non-LoRaWAN messages to separate on-gateway process**
Currently, Basic Station drops non-LoRaWAN messages. In cases where LoRaWAN solutions are augmented with proprietary messages, it may be beneficial to allow processing these messages locally on the gateway. To facilitate on-gateway processing, Basic Station will have an option to forward non-LoRaWAN messages to a gateway-local destination.
2 changes: 1 addition & 1 deletion VERSION.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
2.0.3
2.0.4-9-g3d5c686
2 changes: 2 additions & 0 deletions deps/lgw/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
git-repo
platform-*/
30 changes: 29 additions & 1 deletion deps/lgw/makefile
Original file line number Diff line number Diff line change
@@ -1,3 +1,28 @@
# --- Revised 3-Clause BSD License ---
# Copyright Semtech Corporation 2020. All rights reserved.
#
# Redistribution and use in source and binary forms, with or without modification,
# are permitted provided that the following conditions are met:
#
# * Redistributions of source code must retain the above copyright notice,
# this list of conditions and the following disclaimer.
# * Redistributions in binary form must reproduce the above copyright notice,
# this list of conditions and the following disclaimer in the documentation
# and/or other materials provided with the distribution.
# * Neither the name of the Semtech corporation nor the names of its
# contributors may be used to endorse or promote products derived from this
# software without specific prior written permission.
#
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
# WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
# DISCLAIMED. IN NO EVENT SHALL SEMTECH CORPORATION. BE LIABLE FOR ANY DIRECT,
# INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
# BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
# LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE
# OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
# ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

TD=../..
include ${TD}/setup.gmk
Expand All @@ -6,6 +31,9 @@ PLT=platform-${platform}
LGWLIB=${TD}/${BD}/lib/liblgw.a
LGWINC=${TD}/${BD}/include/lgw

LGWVERSION.default = 5.0.1
LGWVERSION ?= $(or ${LGWVERSION.${platform}}, ${LGWVERSION.default})

HFILES = $(wildcard ${PLT}/libloragw/inc/*.h)
SRCS = $(wildcard ${PLT}/libloragw/inc/*.c)
ARTEFACTS = ${LGWLIB} ${LGWINC} $(patsubst %, ${LGWINC}/%, $(notdir ${HFILES}) config.h)
Expand All @@ -31,7 +59,7 @@ ${LGWINC}/%.h: ${PLT}/libloragw/inc/%.h | ${LGWINC}
@cp $< $@

${PLT}: prep.sh
platform=${platform} variant=${variant} ./prep.sh
platform=${platform} variant=${variant} lgwversion=${LGWVERSION} ./prep.sh
$(MAKE) --no-print-directory all platform=${platform} variant=${variant}

clean:
Expand Down
44 changes: 35 additions & 9 deletions deps/lgw/prep.sh
Original file line number Diff line number Diff line change
@@ -1,26 +1,52 @@
#!/bin/bash

# --- Revised 3-Clause BSD License ---
# Copyright Semtech Corporation 2020. All rights reserved.
#
# Redistribution and use in source and binary forms, with or without modification,
# are permitted provided that the following conditions are met:
#
# * Redistributions of source code must retain the above copyright notice,
# this list of conditions and the following disclaimer.
# * Redistributions in binary form must reproduce the above copyright notice,
# this list of conditions and the following disclaimer in the documentation
# and/or other materials provided with the distribution.
# * Neither the name of the Semtech corporation nor the names of its
# contributors may be used to endorse or promote products derived from this
# software without specific prior written permission.
#
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
# WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
# DISCLAIMED. IN NO EVENT SHALL SEMTECH CORPORATION. BE LIABLE FOR ANY DIRECT,
# INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
# BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
# LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE
# OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
# ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

set -e
cd $(dirname $0)

LGW_VERSION=v5.0.1
lgwversion="v${lgwversion:-5.0.1}"

if [[ ! -d git-repo ]]; then
git clone -b $LGW_VERSION --single-branch --depth 1 https://github.com/Lora-net/lora_gateway.git git-repo
git clone https://github.com/Lora-net/lora_gateway.git git-repo
fi

if [[ -z "$platform" ]] || [[ -z "$variant" ]]; then
if [[ -z "${platform}" ]] || [[ -z "${variant}" ]]; then
echo "Expecting env vars platform/variant to be set - comes naturally if called from a makefile"
echo "If calling manually try: variant=std platform=linux $0"
exit 1
fi

if [[ ! -d platform-$platform ]]; then
git clone git-repo platform-$platform
if [[ ! -d platform-${platform} ]]; then
git clone -b ${lgwversion} git-repo platform-${platform}

cd platform-$platform
if [ -f ../$LGW_VERSION-$platform.patch ]; then
echo "Applying $LGW_VERSION-$platform.patch ..."
git apply ../$LGW_VERSION-$platform.patch
cd platform-${platform}
if [ -f ../${lgwversion}-${platform}.patch ]; then
echo "Applying ${lgwversion}-${platform}.patch ..."
git apply ../${lgwversion}-${platform}.patch
fi
fi
2 changes: 2 additions & 0 deletions deps/lgw1302/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
git-repo
platform-*/
Loading

0 comments on commit 817e6e1

Please sign in to comment.