First of all, I’m not sure where to post (github issue or this forum) since I’m not sure that my problem is a software bug or not, but here we are.
I followed the instruction on installing with Docker by using docker-compose to try the loraserver.
Almost everything works fine, my node can send the data via gateway and I can see the data on the LoRa App Server web.
But, I can not get anything from MQTT broker, I make sure to open the 1883 port and the connection is not refused from the network (my loraserver is hosted on Azure VM).
Also, I always get this error message:
loraserver_1 | time="2017-09-04T10:00:48Z" level=error msg="processing rx packet error: publish data up to application-server error: rpc error: code = Unavailable desc = grpc: the connection is unavailable" data_base64="DATA_IS_REMOVED_FOR_REASONS"
EDIT:
I did get the message from MQTT broker with gateway/# topic, but I didn’t get anything from application/# topic. Is this expected behavior?
This is a good place to discuss your issue It looks like the loraserver container is unable to contact the lora-app-server container, is the latter one up and running?
App server is running, here’s the output from docker-compose ps
Name Command State Ports
----------------------------------------------------------------------------------------------
loraservers_appserver_1 ./lora-app-server Up 0.0.0.0:8080->8080/tcp
Here’s the log from app server
appserver_1 | time="2017-09-04T10:11:34Z" level=info msg="starting LoRa App Server" docs="https://docs.loraserver.io/" version=d79ba29
appserver_1 | time="2017-09-04T10:11:34Z" level=info msg="connecting to postgresql"
appserver_1 | time="2017-09-04T10:11:34Z" level=info msg="setup redis connection pool"
appserver_1 | time="2017-09-04T10:11:34Z" level=info msg="handler/mqtt: connecting to mqtt broker" server="tcp://mosquitto:1883"
appserver_1 | time="2017-09-04T10:11:34Z" level=info msg="connecting to network-server api" ca-cert= server="loraserver:8000" tls-cert= tls-key=
appserver_1 | time="2017-09-04T10:11:34Z" level=info msg="applying database migrations"
appserver_1 | time="2017-09-04T10:11:34Z" level=info msg="handler/mqtt: connected to mqtt broker"
appserver_1 | time="2017-09-04T10:11:34Z" level=info msg="handler/mqtt: subscribling to tx topic" topic="application/+/node/+/tx"
appserver_1 | time="2017-09-04T10:11:34Z" level=info msg="migrations applied" count=0
appserver_1 | time="2017-09-04T10:11:34Z" level=info msg="starting application-server api" bind="0.0.0.0:8001" ca-cert= tls-cert= tls-key=
appserver_1 | time="2017-09-04T10:11:34Z" level=info msg="starting client api server" bind="0.0.0.0:8080" tls-cert="/etc/lora-app-server/certs/http.pem" tls-key="/etc/lora-app-server/certs/http-key.pem"
appserver_1 | time="2017-09-04T10:11:34Z" level=info msg="registering rest api handler and documentation endpoint" path="/api"
appserver_1 | time="2017-09-04T10:11:35Z" level=info msg="grpc: addrConn.resetTransport failed to create client transport: connection error: desc = "transport: Error while dialing dial tcp 172.18.0.3:8000: getsockopt: connection refused"; Reconnecting to {loraserver:8000 <nil>}"
appserver_1 | 2017/09/04 10:16:21 http2: server: error reading preface from client 36.84.67.248:31345: timeout waiting for client preface
appserver_1 | 2017/09/04 10:16:22 http2: server: error reading preface from client 36.84.67.248:31306: timeout waiting for client preface
appserver_1 | 2017/09/04 10:16:22 http2: server: error reading preface from client 36.84.67.248:31467: timeout waiting for client preface
appserver_1 | 2017/09/04 10:16:22 http2: server: error reading preface from client 36.84.67.248:31373: timeout waiting for client preface
appserver_1 | 2017/09/04 10:16:22 http2: server: error reading preface from client 36.84.67.248:31296: timeout waiting for client preface
appserver_1 | 2017/09/04 12:58:57 http: TLS handshake error from 52.179.173.109:47598: tls: first record does not look like a TLS handshake
appserver_1 | 2017/09/04 13:02:36 http: TLS handshake error from 115.231.218.25:2371: tls: first record does not look like a TLS handshake
I noticed that app server had similar error message
appserver_1 | time="2017-09-04T10:11:35Z" level=info msg="grpc: addrConn.resetTransport failed to create client transport: connection error: desc = "transport: Error while dialing dial tcp 172.18.0.3:8000: getsockopt: connection refused"; Reconnecting to {loraserver:8000 <nil>}"
I’ll try adding
ports:
- 8000
to loraserver service and
ports:
- 8001
to appserver service and hoping it would solve the problem.
By the way, I can not transmit any data now because the node and gateway are in my office, not until tomorrow morning (my timezone is GMT+7)
I was bit confused about what you directed me. It may be very foolishness on my part.
I tried the fix provided here but stil the issue exits. Please let me know where to provide the application-server ip and port in the loraserver.toml configfile. I think by default loraserver trying to talk to lora-app-server on localhost:8001 ( this ip:host is embedded some where in the code) and I want to override that with lora-app-server:8001 but I donot know where to do that.
Please see this section in the lora-app-server.toml configuration (note: you configure this at the LoRa App Server side).
# 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"
That must be set to the LoRa App Server hostname. Please note that when you change this config file, you also need to update the network-server object in the web interface so that LoRa App Server notifies LoRa Server that the hostname changed.