Hw do I know my device is seen by the LoRa Server?

When my end-device sends a message to the gateway I can see the message being logged in the window under:

Organizations / LoRa Server / Gateways / my gateway name / Live LoRaWAN Frame Log

but I see nothing in window:

Organizations / LoRa Server / Applications / my apple name / my device name / Live LoRaWAN Frame Log

Is this an issue? Because I am having a hard time making my application integration work and I wonder if this is an indication that something is not properly configured.

When you are in the device list, you will see the Last seen column which indicates when the device was last seen by LoRa Server :slight_smile:

When you don’t see any data coming in, please make sure the keys are setup correctly. For some libraries you have to enter them in reverse order (LSB vs MSB) so that 01020304 becomes 04030201 (in hex).

If this is setup incorrectly, you will likely see a MIC error in the LoRa Server logs. See also: https://forum.loraserver.io/search?q=invalid%20mic

I checked the other e-mail threads and that helped me try to disable the frame counter validation. Things improved a bit as now the gateway shows more MQTT messages:

gateway/30aea4ffff6efa80/rx {"rxInfo":{"mac":"30aea4ffff6efa80","timestamp":2875279320,"frequency":433174987,"channel":0,"rfChain":0,"crcStatus":1,"codeRate":"4/5","rssi":-26,"loRaSNR":9,"size":26,"dataRate":{"modulation":"LORA","spreadFactor":7,"bandwidth":125},"board":0,"antenna":0},"phyPayload":"QDVRnAaAAAABwr+V1ygbQ4bfov5tkw70CkI="}

gateway/30aea4ffff6efa80/stats {"mac":"30aea4ffff6efa80","time":"2018-05-29T10:03:32Z","latitude":-23.62389,"longitude":-46.68698,"altitude":740,"rxPacketsReceived":11,"rxPacketsReceivedOK":11,"txPacketsReceived":0,"txPacketsEmitted":0}

gateway/30aea4ffff6efa80/config {"mac":"30aea4ffff6efa80","version":"2018-05-25T22:53:30.418379Z","channels":[{"modulation":"LORA","frequency":433175000,"bandwidth":125,"spreadingFactors":[7,8,9,10,11,12]}]}

The error now seems to have migrated to somewhere else:
May 29 13:01:57 ip-172-31-37-118 loraserver[1329]: time="2018-05-29T13:01:57Z" level=error msg="processing rx packet error: get application-server client error: create application-server api client error: dial application-server api error: context deadline exceeded" data_base64="QDVRnAaAAAABwr+V1ygbQ4bfov5tkw70CkI=" May 29 13:01:57 ip-172-31-37-118 loraserver[1329]: time="2018-05-29T13:01:57Z" level=warning msg="Failed to dial localhost:8001: context canceled; please retry." May 29 13:02:11 ip-172-31-37-118 loraserver[1329]: time="2018-05-29T13:02:11Z" level=info msg="backend/gateway: rx packet received" May 29 13:02:11 ip-172-31-37-118 loraserver[1329]: time="2018-05-29T13:02:11Z" level=warning msg="creating insecure application-server client" server="localhost:8001" May 29 13:02:11 ip-172-31-37-118 loraserver[1329]: time="2018-05-29T13:02:11Z" level=warning msg="grpc: addrConn.createTransport failed to connect to {localhost:8001 0 <nil>}. Err :connection error: desc = \"transport: Error while dialing dial tcp 127.0.0.1:8001: connect: connection refused\". Reconnecting..." May 29 13:02:12 ip-172-31-37-118 loraserver[1329]: time="2018-05-29T13:02:12Z" level=error msg="processing rx packet error: get application-server client error: create application-server api client error: dial application-server api error: context deadline exceeded" data_base64="QDVRnAaAAAABwr+V1ygbQ4bfov5tkw70CkI=" May 29 13:02:12 ip-172-31-37-118 loraserver[1329]: time="2018-05-29T13:02:12Z" level=warning msg="Failed to dial localhost:8001: context canceled; please retry." May 29 13:02:20 ip-172-31-37-118 loraserver[1329]: time="2018-05-29T13:02:20Z" level=info msg="backend/gateway: rx packet received" May 29 13:02:20 ip-172-31-37-118 loraserver[1329]: time="2018-05-29T13:02:20Z" level=warning msg="creating insecure application-server client" server="localhost:8001" May 29 13:02:20 ip-172-31-37-118 loraserver[1329]: time="2018-05-29T13:02:20Z" level=warning msg="grpc: addrConn.createTransport failed to connect to {localhost:8001 0 <nil>}. Err :connection error: desc = \"transport: Error while dialing dial tcp 127.0.0.1:8001: connect: connection refused\". Reconnecting..." May 29 13:02:21 ip-172-31-37-118 loraserver[1329]: time="2018-05-29T13:02:21Z" level=error msg="processing rx packet error: get application-server client error: create application-server api client error: dial application-server api error: context deadline exceeded" data_base64="QDVRnAaAAAABwr+V1ygbQ4bfov5tkw70CkI=" May 29 13:02:21 ip-172-31-37-118 loraserver[1329]: time="2018-05-29T13:02:21Z" level=warning msg="Failed to dial localhost:8001: context canceled; please retry."

I have no clue on what this could be. Searched the forum and could not find a similar problem.
I am running all software in an AWS EC2 instance.
Thanks.

May 29 13:01:57 ip-172-31-37-118 loraserver[1329]: time=“2018-05-29T13:01:57Z” level=error msg=“processing rx packet error: get application-server client error: create application-server api client error: dial application-server api error: context deadline exceeded” data_base64=“QDVRnAaAAAABwr+V1ygbQ4bfov5tkw70CkI=”

May 29 13:01:57 ip-172-31-37-118 loraserver[1329]: time=“2018-05-29T13:01:57Z” level=warning msg=“Failed to dial localhost:8001: context canceled; please retry.”

LoRa Server tries to make an API call to LoRa App Server. However it seems it can’t connect. Please make sure LoRa App Server is up and running and is accepting connections on port 8001. In case you’ve setup TLS credentials, make sure that these are setup correctly (or try first without).

I revisited the /etc/loraserver/loraserver.toml configuration file and found that I had made a change in application_server.api.bind to "127.0.0.0:8001" (something I found in the forum discussions and tried to apply to solve my issue, but did not work and I left it there).
I edited it back to bind="0.0.0.0:8001", rebooted and now everything seems to work!
Thank you.

(for future reference: what solved my problem was to disable the frame counter validation, as I have to reboot my device several times for testing purposes).

1 Like

Hi! I have a similar issue. My lora-server and app-server are hosted on different servers addressing each other by hostnames app.local.lora and server.local.lora. In app server config I had stated that I have public host for internal API and I put this lines into config file under [application_server] section:

[application_server.api]
bind="0.0.0.0:8001"
public_host="app.local.lora:8001"

But still in logs of lora-server I see messages that it could not connect to a localhost:8001:

msg="grpc: addrConn.createTransport failed to connect to {localhost:8001 0 <nil>}. Err :connection error: desc = \"transport: Error while dialing dial tcp 127.0.0.1:8001: connect: connection refused\". Reconnecting..."

I assumed that this variable is pushed from app server into lora server (since I put this variable in the app server config - as per documentation). But I had also tried to add these variables into lora-server config (I think this is wrong but I was trying):
[application_server.api]
bind="0.0.0.0:8001"
public_host="app.local.lora:8001"

But still there were no luck. Any ideas where and how should I make lora-server to address third-party host instead of 127.0.0.1 to connect to API on 8001 on app-server (tried locally with CURL and it is working btw)?

@abreups why did you add application_server.api.bind to "127.0.0.0:8001" to /etc/loraserver/loraserver.toml? This variable should reside in lora-app-server.toml according to a documentation. How did you manage to make it work?

Ok I manage to find that this variable is stored in lora-server PGSQL db in routing_profile table. I had changed it manually but I am still interesting how can I change this via config? And which config?

1 Like

This is set upon network-server creation at the lora-app-server UI, and may be modified in that section too.

Hmm… Seems that my UI (latest as for today) is not having this field

The only option I have is to add a network server and not set up an API server.

I’m not sure what your are saying, the parameter is right there: Network-server server has to match loraserver’s networ_server.api configuration parameter. I.e., if you have this at your loraserver’s conf:

# 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"

Then you need to set localhost:8000 as the network server’s server in the UI.

Yup. But I was saying about API server which is a part of a AppServer and listens on 8001 on a AppServer node which in my case is installed on a separate server (not on a network server).

Yeah, but to to be able to connect to lora-app-server, the loraserver must know about it’s location and that’s pushed after you add the network-server at lora-app-server through the network server’s API. If you’ve already done it, then the connection problem is a different one.

1 Like

thanks I had the same thing and update the db,