[release] LoRa Server 0.22.0 & LoRa App Server 0.14.x (read carefully!)

I’ve just released LoRa Server 0.22.0 and LoRa App Server 0.14.0. This is quite a large release, as it changes many things including some breaking changes when you’re using the gRPC and / or REST api. The good news is that this forms the foundation for becoming compliant with the LoRaWAN Backend Interfaces, LoRaWAN 1.1 and future support for roaming.

These versions are not yet available in the Debian / Ubuntu repository to avoid automatic upgrades directly, but can be manually downloaded:

Before you upgrade, please make a backup of your databases. Example commands:

PostgreSQL:

$ pg_dump -h localhost -U loraserver_as -W loraserver_as > loraserver_as.sql
$ pg_dump -h localhost -U loraserver_ns -W loraserver_ns > loraserver_ns.sql

Redis (save snapshot):

$ redis-cli
> save
> exit

$ cp /var/lib/redis/dump.rdb .

Changelogs

LoRa Server

0.22.0

Note: this release brings many changes! Make sure (as always) to make a
backup of your PostgreSQL and Redis database before upgrading.

Changes:

  • Data-model refactor to implement service-profile, device-profile and
    routing-profile storage as defined in the
    LoRaWAN backend interfaces.

  • LoRa Server now uses the LoRa App Server Join-Server API as specified by the
    LoRaWAN backend interfaces specification (currently hard-configured endpoint).

  • Adaptive data-rate configuration is now globally configured by LoRa Server.
    See configuration.

  • OTAA RX configuration (RX1 delay, RX1 data-rate offset and RX2 dat-rate) is
    now globally configured by LoRa Server.
    See configuration.

API changes:

  • Service-profile CRUD methods added
  • Device-profile CRUD methods added
  • Routing-profile CRUD methods added
  • Device CRUD methods added
  • Device (de)activation methods added
  • Node-session related methods have been removed
  • EnqueueDataDownMACCommand renamed to EnqueueDownlinkMACCommand
  • PushDataDown renamed to SendDownlinkData

How to upgrade

Note: this release brings many changes! Make sure (as always) to make a
backup of your PostgreSQL and Redis database before upgrading.

Note: When LoRa App Server is running on a different server than LoRa Server,
make sure to set the --js-server / JS_SERVER (default localhost:8003).

This release depends on the latest LoRa App Server release (0.14). Upgrade
LoRa Server first, then proceed with upgrading LoRa App Server. See also the
LoRa App Server changelog.

LoRa App Server

0.14.0

Note: this release brings many changes! Make sure (as always) to make a
backup of your PostgreSQL and Redis database before upgrading.

Changes:

  • Data-model refactor to implement service-profile, device-profile and
    routing-profile storage as defined in the
    LoRaWAN backend interfaces.

  • Application users have been removed to avoid complexity in the API
    authorization. Users can still be assigned to organizations.

  • LoRa App Server can now connect to multiple LoRa Server
    instances.

  • LoRa App Server exposes a Join-Server API (as defined in the LoRaWAN backend
    interfaces document), which LoRa Server uses as a default join-server.

  • E-mail and note field added for users.

  • Adaptive-datarate configuration has been moved to LoRa Server.

  • OTAA RX configuration has been moved to LoRa Server.

API changes:

  • New API endpoints:

    • /api/device-profiles (management of device-profiles)
    • /api/service-profiles (management of service-profiles)
    • /api/network-servers (management of network-servers)
    • /api/devices (management of devices, used to be /api/nodes, settings
      have been removed and device-profile field has been added)
  • Updated API endpoints:

    • /api/applications (management of applications, most of the settings are now part of the device-profile)
    • /api/gateways (management of gateways, network-server field has been added)
  • Removed API endpoints:

    • /api/applications/{id}/users (management of application users)
    • /api/nodes (management of nodes, has been refactored into /api/devices)

Note: these changes also apply to the related gRPC API endpoints.

How to upgrade

Note: this release brings many changes! Make sure (as always) to make a
backup of your PostgreSQL and Redis database before upgrading.

Note: When LoRa App Server is running on a different server than LoRa Server,
make sure to set the --as-public-server / AS_PUBLIC_SERVER
(default localhost:8001).

This release depends on the latest LoRa Server release (0.22).
Start with updating LoRa Server first. See also the
LoRa Server changelog.

LoRa App Server will perform the data-migration when the --db-automigrate /
DB_AUTOMIGRATE config flag is set. It will:

  • Create a network-server record + routing-profile on LoRa Server (so that
    LoRa Server knows how to connect back).
  • For each organization, it will create a service-profile
  • It will create device-profiles (either per device or per application when
    the “use application settings” is checked)
3 Likes

Please share your feedback after upgrading, either when you run into any errors but please share also the good news :slight_smile: Before pushing these releases to the Ubuntu / Debian APT repository, I would love to hear some feedback on manual downloads & upgrades.

After backing up your data as described in the previous post and when on Ubuntu or Debian (AMD64), these are example upgrade commands:

wget https://dl.loraserver.io/deb/loraserver_0.22.0_amd64.deb
sudo dpkg -i loraserver_0.22.0_amd64.deb

wget https://dl.loraserver.io/deb/lora-app-server_0.14.1_amd64.deb
sudo dpkg -i lora-app-server_0.14.1_amd64.deb
2 Likes

Adaptive data-rate configuration is now globally configured by LoRa Server.

I can’t understand how I can turn on/off ADR.

1 Like

When you turn it on on your node, LoRa Server will automatically control the data-rate and tx-power. No need for additional configuration to turn adr on or off. You are still able to configure the installation margin however through the cli arguments / environment variables.

1 Like

Can you elaborate on the LoRa App Server running separately from the LoRa Server? I’m running everything in Docker (LoRa server in build image, everything else in release image) and get this message when it tries to send a confirmed ACK:

loraserver_1     | time="2017-11-03T20:49:00Z" level=info msg="grpc: addrConn.resetTransport failed to create client transport: connection error: desc = "transport: Error while dialing dial tcp 127.0.0.1:8001: getsockopt: connection refused"; Reconnecting to {localhost:8001 <nil>}" 

It seems the loraserver is trying to connect to localhost and I cannot find an option that changes this behavior to point to the appserver container. Do I need to set AS_PUBLIC_SERVER? If so, what to?

1 Like

I’ve updated the docker-compose.yml config example on the documentation page. Please note the following config changes:

  • loraserver
    • JS_SERVER=http://appserver:8003

and

  • appserver
    • AS_PUBLIC_SERVER=appserver:8001

After changing these config values and restarting the services with this new configuration, go to (in the LoRa App Server web-interface) to network-servers (top right navbar), click on the network-server and save it. Besides saving the network-server config, this will also update the routing-profile which currently contains localhost:8001).

Please let me know if this solves your issue :slight_smile:

1 Like

I have updated the Ubuntu / Debian version this morning and everything seems to be working.
I will test it better tomorrow.

Thanks :slight_smile:

1 Like

Dear Brocaar,

I simply ran the following commands and everything works perfectly. Nothing went wrong!

sudo apt-get update -y
sudo apt-get upgrade -y

wget https://dl.loraserver.io/deb/loraserver_0.22.0_amd64.deb
sudo dpkg -i loraserver_0.22.0_amd64.deb

wget https://dl.loraserver.io/deb/lora-app-server_0.14.0_amd64.deb
sudo dpkg -i lora-app-server_0.14.0_amd64.deb

I did not backup anything as I did not have anything important im my server. I use Amazon EC2 and I took a snapshot before upgrading. If something goes wrong, I simply restore from the snapshot! its super easy.

Brocaar, for your information, I paste below more information

The update did not change anything! I didnt back up anything.
Find below my terminal o/p.

 wget https://dl.loraserver.io/deb/loraserver_0.22.0_amd64.deb
--2017-11-06 10:49:01--  https://dl.loraserver.io/deb/loraserver_0.22.0_amd64.deb
Resolving dl.loraserver.io (dl.loraserver.io)... 188.166.134.65
Connecting to dl.loraserver.io (dl.loraserver.io)|188.166.134.65|:443... connected.
HTTP request sent, awaiting response... 200 OK
Length: 4924240 (4.7M) [application/octet-stream]
Saving to: ‘loraserver_0.22.0_amd64.deb’

loraserver_0.22.0_a 100%[===================>]   4.70M  3.68MB/s    in 1.3s    

2017-11-06 10:49:04 (3.68 MB/s) - ‘loraserver_0.22.0_amd64.deb’ saved [4924240/4924240]

ubuntu@ip-XXX:~$ sudo dpkg -i loraserver_0.22.0_amd64.deb
(Reading database ... 128122 files and directories currently installed.)
Preparing to unpack loraserver_0.22.0_amd64.deb ...
Unpacking loraserver (0.22.0) over (0.21.0) ...
Removed symlink /etc/systemd/system/multi-user.target.wants/loraserver.service.
Setting up loraserver (0.22.0) ...
Created symlink from /etc/systemd/system/multi-user.target.wants/loraserver.service to /lib/systemd/system/loraserver.service.
Restarting LoRa Server
ubuntu@ip-XXXXXX:~$ wget https://dl.loraserver.io/deb/lora-app-server_0.14.0_amd64.deb
--2017-11-06 10:49:29--  https://dl.loraserver.io/deb/lora-app-server_0.14.0_amd64.deb
Resolving dl.loraserver.io (dl.loraserver.io)... 188.166.134.65
Connecting to dl.loraserver.io (dl.loraserver.io)|188.166.134.65|:443... connected.
HTTP request sent, awaiting response... 200 OK
Length: 7790470 (7.4M) [application/octet-stream]
Saving to: ‘lora-app-server_0.14.0_amd64.deb’

lora-app-server_0.1 100%[===================>]   7.43M  4.77MB/s    in 1.6s    

2017-11-06 10:49:31 (4.77 MB/s) - ‘lora-app-server_0.14.0_amd64.deb’ saved [7790470/7790470]

ubuntu@ip-XX:~$ sudo dpkg -i lora-app-server_0.14.0_amd64.deb
(Reading database ... 128122 files and directories currently installed.)
Preparing to unpack lora-app-server_0.14.0_amd64.deb ...
Unpacking lora-app-server (0.14.0) over (0.13.2) ...
Removed symlink /etc/systemd/system/multi-user.target.wants/lora-app-server.service.
Setting up lora-app-server (0.14.0) ...
Created symlink from /etc/systemd/system/multi-user.target.wants/lora-app-server.service to /lib/systemd/system/lora-app-server.service.
Restarting LoRa App Server
ubuntu@ip-XXX~$ sudo reboot
Terminated
1 Like

Brocaar,

After doing as you suggested, I now receive this error in its place:

loraserver_1     | time="2017-11-07T01:16:23Z" level=error msg="processing rx packet error: publish data up to application-server error: rpc error: code = InvalidArgument desc = RxInfo must have length > 0" data_base64=gEuiRY0ABwAB9KmYQtiDZSMfyxRMYxHyFn3eDFnO
1 Like

Thanks! I think that is a bug. Could you check the Add gateway meta-data field in the service-profile for now? I did test that when this field is disabled that no gateway data is exposed. However, there is still a validation on it in LoRa App Server, raising this issue. Will fix this.

I’ve created an issue for this:

1 Like

Checking the Add gateway meta-data worked for me, thank you!

1 Like

Great! I’ll fix this issue soon so it can be disabled without any side-effects. Sorry about this :slight_smile:

1 Like

I’ve released an update with some fixes, including the issue you reported.

wget https://dl.loraserver.io/deb/lora-app-server_0.14.1_amd64.deb
sudo dpkg -i lora-app-server_0.14.1_amd64.deb

In the next couple of days, I’ll also make these new versions of LoRa (App) Server in the Debian / Ubuntu repository so you can use apt update && apt upgrade again to upgrade to the latest version :slight_smile:

1 Like

Dear Brocaar,

I successfully upgraded. Why didnt I get this error message?

1 Like

You mean the RxInfo must have... error message? This only occurred in LoRa App Server 0.14.0 and when Add gateway meta-data was disabled.

1 Like

yes Brocaar. I see! thanks! No problems from update thus far and system still is very stable.

2 Likes

Thanks for all the feedback guys! I’ve just pushed the .deb packages to the Debian and Ubuntu repositories so you can now upgrade to the latest version as usual by apt update && apt upgrade :slight_smile:

1 Like

I just updated trough .deb packages.
I expected new menu’s because of the update but found nothing of that.
Also a complet reinstall did not ake that happen.
Did I miss something?

1 Like

Ok, it seems solved now: I had to refresh the cache of my browser. :frowning:

1 Like