Problem with LoraServer and LoraAppServer API?

Hi,

I’ve spent a number of hours looking for a topic with a similar issue, but haven’t been able to find one.

I have installed LoraServer 3.2.1 and LoraAppServer 3.2.0 in a CentOS 7 environment. I have been able to get them up and running and talking to each other for the most part. My issue is in adding a new device. I have a test device I have added, it is communicating via MQTT which I can see, however there is an issue activating the device.
LoraServer can activate the device (which is confirmed on the device), however the gRPC call is failing to activate the device in LoraAppServer. On loading through the web page, it shows that the device is not activated. Checking the Postgresql db, I can see a device activation added in loraserver_ns/device_activation, but nothing in loraserver_as/device_activation.

Looking at the LoraServer log hints at the issue:

Sep 30 17:19:14  loraserver[3732]:  level=info msg="gateway/mqtt: uplink frame received"
Sep 30 17:19:14  loraserver[3732]:  level=info msg="packet(s) collected" dev_eui=------------1010 gw_count=1 gw_ids=------------2938 mtype=JoinRequest
Sep 30 17:19:14  loraserver[3732]:  level=info msg="finished streaming call with code OK" grpc.code=OK grpc.method=StreamFrameLogsForDevice grpc.service=ns.NetworkServerService grpc.start_time="2019-09-30T17:17:58+10:00" grpc.time_ms=75760.39 peer.address="[::1]:40040" span.kind=server system=grpc
Sep 30 17:19:14  loraserver[3732]:  level=info msg="device-queue flushed" dev_eui=------------1010
Sep 30 17:19:14  loraserver[3732]:  level=info msg="device-session saved" dev_addr=-----94b dev_eui=------------1010
Sep 30 17:19:14  loraserver[3732]:  level=info msg="device-activation created" dev_eui=------------1010 id=85
Sep 30 17:19:14  loraserver[3732]:  level=info msg="device updated" dev_eui=------------1010
Sep 30 17:19:14  loraserver[3732]:  level=info msg="gateway/mqtt: publishing gateway command" command=down gateway_id=------------2938 qos=0 topic=gateway/------------2938/command/down
Sep 30 17:19:14  loraserver[3732]:  level=info msg="downlink-frames saved" dev_eui=------------1010 token=32348
Sep 30 17:19:14  loraserver[3732]:  level=info msg="backend/gateway: downlink tx acknowledgement received" gateway_id=------------2938

Sep 30 17:19:19  loraserver[3732]:  level=info msg="gateway/mqtt: uplink frame received"
Sep 30 17:19:19  loraserver[3732]:  level=warning msg="creating insecure application-server client" server="lora_appserver:8000"
Sep 30 17:19:19  loraserver[3732]:  level=info msg="rx info sent to network-controller" dev_eui=------------1010
Sep 30 17:19:19  loraserver[3732]:  level=info msg="device gateway rx-info meta-data saved" dev_eui=------------1010
Sep 30 17:19:19  loraserver[3732]:  level=info msg="device-session saved" dev_addr=-----94b dev_eui=------------1010
Sep 30 17:19:19  loraserver[3732]:  level=error msg="finished client unary call" error="rpc error: code = Unimplemented desc = unknown service as.ApplicationServerService" grpc.code=Unimplemented grpc.method=HandleUplinkData grpc.service=as.ApplicationServerService grpc.time_ms=0.807 span.kind=client system=grpc
Sep 30 17:19:19  loraserver[3732]:  level=error msg="publish uplink data to application-server error" error="rpc error: code = Unimplemented desc = unknown service as.ApplicationServerService"
Sep 30 17:19:19  loraserver[3732]:  level=info msg="pending mac-command block set" cid=LinkADRReq commands=2 dev_eui=------------1010
Sep 30 17:19:19  loraserver[3732]:  level=info msg="gateway/mqtt: publishing gateway command" command=down gateway_id=------------2938 qos=0 topic=gateway/------------2938/command/down
Sep 30 17:19:19  loraserver[3732]:  level=info msg="device-session saved" dev_addr=-----94b dev_eui=------------1010
Sep 30 17:19:19  loraserver[3732]:  level=info msg="downlink-frames saved" dev_eui=------------1010 token=29661
Sep 30 17:19:19  loraserver[3732]:  level=info msg="backend/gateway: downlink tx acknowledgement received" gateway_id=------------2938

LoraAppServer for same time period:

Sep 30 17:19:14  lora-app-server[3753]:  level=info msg="finished streaming call with code Canceled" error="rpc error: code = Canceled desc = context canceled" grpc.code=Canceled grpc.method=StreamFrameLogs grpc.service=api.DeviceService grpc.start_time="2019-09-30T17:17:58+10:00" grpc.time_ms=75776.766 peer.address="[::1]:39152" span.kind=server system=grpc
Sep 30 17:19:14  lora-app-server[3753]:  level=info msg="js: request received" message_type=JoinReq receiver_id=0000000000010203 sender_id=000000 transaction_id=2000787563
Sep 30 17:19:14  lora-app-server[3753]:  level=info msg="device-keys updated" dev_eui=------------1010
Sep 30 17:19:14  lora-app-server[3753]:  level=info msg="js: sending response" message_type=JoinAns receiver_id=000000 result_code=Success sender_id=0000000000010203 transaction_id=2000787563

I believe the issue is here (loraserver log):

level=warning msg="creating insecure application-server client" server="lora_appserver:8000"

My LoraAppServer and LoraServer are hosted on the same machine, however the AppServer binds to 8001, with LoraServer binding to 8000. Furthermore, I do not use the address “lora_appserver” nor can I find it anywhere in the config files. This seems to be looking for a server I can’t configure for, not exists.

I did install lpwanserver, which uses docker images to load each component, which I believe the App Server mya have been named lora_appserver, but the version of LoraServer I’m using now is a fresh install, nothing to do with the lpwanserver install. There are no docker containers running, not even the docker service.

I’m at a loss why LoraServer would be looking to “lora_appserver:8000” for the AppServer. Would anyone be able to assist in troubleshooting why this might be the case?

Relevant section of config files:
LoraServer

  # Network-server API
  #
  # This is the network-server API that is used by LoRa App Server or other
  # custom components interacting with LoRa Server.
  [network_server.api]
  # ip:port to bind the api server
  bind="0.0.0.0:8000"

  # ca certificate used by the api server (optional)
  ca_cert=""

  # tls certificate used by the api server (optional)
  tls_cert=""

  # tls key used by the api server (optional)
  tls_key=""

LoraAppServer


  # Settings for the "internal api"
  #
  # This is the API used by LoRa Server to communicate with LoRa App Server
  # and should not be exposed to the end-user.
  [application_server.api]
  # ip:port to bind the api server
  bind="0.0.0.0:8001"

  # ca certificate used by the api server (optional)
  ca_cert=""

  # tls certificate used by the api server (optional)
  tls_cert=""

  # tls key used by the api server (optional)
  tls_key=""

  # Public ip:port of the application-server API.
  #
  # This is used by LoRa Server to connect to LoRa App Server. When running
  # LoRa App Server on a different host than LoRa Server, make sure to set
  # this to the host:ip on which LoRa Server can reach LoRa App Server.
  # The port must be equal to the port configured by the 'bind' flag
  # above.
  public_host="localhost:8001"

Found the issue, incorrect entry in the postgresql database - if anyone else encounters this issue.
loraserver_ns/routing_profile.

1 Like