brocaar / chirpstack-network-server

ChirpStack Network Server is an open-source LoRaWAN network-server.
https://www.chirpstack.io
MIT License
1.5k stars 547 forks source link

getsockopt: connection refused"; Reconnecting to {"127.0.0.1:8001" <nil>} #97

Closed lancezhangsf closed 7 years ago

lancezhangsf commented 7 years ago

hi, brocaar, i run the loraserver, but some error happen,as f root@zhangsf-virtual-machine:/opt/loraserver/bin# ./loraserver --net-id 010203 --band CN_470_510
INFO[0000] starting LoRa Server band=CN_470_510 docs=https://docs.loraserver.io/ net_id=010203 version=0.12.3 INFO[0000] setup redis connection pool url=redis://localhost:6379 INFO[0000] backend/gateway: connecting to mqtt broker server=tcp://localhost:1883 INFO[0000] connecting to application-server ca-cert= server=127.0.0.1:8001 tls-cert= tls-key= INFO[0000] no network-controller configured
INFO[0000] starting api server bind=0.0.0.0:8000 ca-cert= tls-cert= tls-key= INFO[0000] backend/gateway: connected to mqtt server
INFO[0000] backend/gateway: subscribing to rx topic topic=gateway/+/rx INFO[0000] grpc: addrConn.resetTransport failed to create client transport: connection error: desc = "transport: dial tcp 127.0.0.1:8001: getsockopt: connection refused"; Reconnecting to {"127.0.0.1:8001" } INFO[0001] grpc: addrConn.resetTransport failed to create client tran

lg007 commented 7 years ago

Hello lancezhangsf,

Currently the loraserver runs only when lora-app-server is running as well. Have you checked the FAQ of loraserver and lora-app-server?

https://docs.loraserver.io/loraserver/frequently-asked-questions/

https://docs.loraserver.io/lora-app-server/frequently-asked-questions/

Regards,

lancezhangsf commented 7 years ago

hi brocaar: thank you very much for your answer,i can rcv the data from gw, but the loraserver show some errors , i use eu_433,but some other errors happen ,

panic: runtime error: invalid memory address or nil pointer dereference 11月 16 19:43:39 zhangsf-virtual-machine loraserver[22251]: [signal SIGSEGV: segmentation violation code=0x1 addr=0x0 pc=0x557f57] 11月 16 19:43:39 zhangsf-virtual-machine loraserver[22251]: goroutine 32 [running]: 11月 16 19:43:39 zhangsf-virtual-machine loraserver[22251]: panic(0x861820, 0xc42000c090) 11月 16 19:43:39 zhangsf-virtual-machine loraserver[22251]: /usr/local/go/src/runtime/panic.go:500 +0x1a1 11月 16 19:43:39 zhangsf-virtual-machine loraserver[22251]: github.com/brocaar/loraserver/vendor/github.com/brocaar/lorawan/band.(*Band).GetRX1Frequency(0xb35a40, 0x19d3a220, 0x0, 0x0, 0x0) 11月 16 19:43:39 zhangsf-virtual-machine loraserver[22251]: /go/src/github.com/brocaar/loraserver/vendor/github.com/brocaar/lorawan/band/band.go:133 +0x37 11月 16 19:43:39 zhangsf-virtual-machine loraserver[22251]: github.com/brocaar/loraserver/internal/downlink.getDataDownTXInfoAndDR(0xc420055380, 0xb11580, 0xc420156570, 0x30201, 0xb13660, 0xc420022620, 0xb11540, 0xb52c40, 0x2b0005d7abf, 0x2b0be7a0000, ...) 11月 16 19:43:39 zhangsf-virtual-machine loraserver[22251]: /go/src/github.com/brocaar/loraserver/internal/downlink/data.go:44 +0x3ce 11月 16 19:43:39 zhangsf-virtual-machine loraserver[22251]: github.com/brocaar/loraserver/internal/downlink.SendDataDownResponse(0xc420055380, 0xb11580, 0xc420156570, 0x30201, 0xb13660, 0xc420022620, 0xb11540, 0xb52c40, 0x2b0005d7abf, 0x2b0be7a0000, ...) 11月 16 19:43:39 zhangsf-virtual-machine loraserver[22251]: /go/src/github.com/brocaar/loraserver/internal/downlink/data.go:131 +0x17c 11月 16 19:43:39 zhangsf-virtual-machine loraserver[22251]: github.com/brocaar/loraserver/internal/uplink.handleCollectedDataUpPackets(0xc420055380, 0xb11580, 0xc420156570, 0x30201, 0xb13660, 0xc420022620, 0xb11540, 0xb52c40, 0x2, 0xb0ed40, ...) 11月 16 19:43:39 zhangsf-virtual-machine loraserver[22251]: /go/src/github.com/brocaar/loraserver/internal/uplink/data.go:191 +0xc59 11月 16 19:43:39 zhangsf-virtual-machine systemd[1]: loraserver.service: Main process exited, code=exited, status=2/INVALIDARGUMENT 11月 16 19:43:39 zhangsf-virtual-machine systemd[1]: loraserver.service: Unit entered failed state. 11月 16 19:43:39 zhangsf-virtual-machine systemd[1]: loraserver.service: Failed with result 'exit-code'. 11月 16 19:43:40 zhangsf-virtual-machine systemd[1]: loraserver.service: Service hold-off time over, scheduling restart. 11月 16 19:43:40 zhangsf-virtual-machine systemd[1]: Stopped loraserver. 11月 16 19:43:40 zhangsf-virtual-machine systemd[1]: Started loraserver. 11月 16 19:43:40 zhangsf-virtual-machine loraserver[22260]: time="2016-11-16T19:43:40+08:00" level=info msg="starting LoRa Server" band="EU_433" docs="https://docs.loraserver.io/" net_id=010203 version=0.12.4

i use this file : https://github.com/brocaar/loraserver/compare/test_eu433?expand=1

lancezhangsf commented 7 years ago

Hi,i have resolved the problem, in the branch test_eu433 :
file :band_eu433.go
not find func: getRX1FrequencyFunc.

i hope that it can be update.

brocaar commented 7 years ago

@lancezhangsf I don't see why you would need the eu433 config as it seems you're on the CN 470-510 ISM band. Therefore I recommend you to use the pre-compiled binaries. As @glederer007 mentioned, your initial error is caused by the fact that both services need to communicate with each other.

lancezhangsf commented 7 years ago

hi ,brocaar Thank you for your answer. 433Mhz Just for the project test,470 Mhz is Special frequency of electric meter in china. i need to use 433Mhz for my proj.

brocaar commented 7 years ago

Ah okay. Please note that the 433 test branch is far behind master as I wasn't able to test and merge it. If you can confirm these band settings are correctly defined, I'm more than happy to update and merge it!

On Mon, Nov 21, 2016, 02:20 zsf notifications@github.com wrote:

hi ,brocaar Thank you for your answer. 433Mhz Just for the project test,470 Mhz is Special frequency of electric meter in china. i need to use 433Mhz for my proj.

— You are receiving this because you commented.

Reply to this email directly, view it on GitHub https://github.com/brocaar/loraserver/issues/97#issuecomment-261821930, or mute the thread https://github.com/notifications/unsubscribe-auth/AAKGeUfsGwA63RyN5kCK6c3W8j0ezSOkks5rAPH0gaJpZM4KyCfn .

aminatamima commented 7 years ago

Hi Brocaar, I am a zero who wants to install the network server in my pc for a school project. I have followed all the instructions and all the three components are well set up. But when i launch loraserver before lora-app-server i have the error meaning that loraserver can not be connected to lora-app-server. In return when i start lora-app-server before loraserver i get the same error (meaning lora-app-server can not be connecter to loraserver). They retry to reconnect but i dont know how to detect if they are well reconnected. Do you please have a way to start both of them without having this errors please

Here is the example of logs meaning it can't be connected to the lora-app-server: (Thank you for your help)

déc. 15 00:30:25 aminata loraserver[11642]: time="2016-12-15T00:30:25+01:00" level=info msg="grpc: addrConn.resetTransport failed to create client transport: connection error: desc = \"transport: dial tcp 127.0.0.1:8001: getsockopt: connection refused\"; Reconnecting to {\"127.0.0.1:8001\" }" déc. 15 00:30:31 aminata loraserver[11642]: time="2016-12-15T00:30:31+01:00" level=info msg="grpc: addrConn.resetTransport failed to create client transport: connection error: desc = \"transport: dial tcp 127.0.0.1:8001: getsockopt: connection refused\"; Reconnecting to {\"127.0.0.1:8001\" }"

brocaar commented 7 years ago

There is no issue having this error temporarily, as both services know how to reconnect :)

On Thu, Dec 15, 2016, 00:48 aminatamima notifications@github.com wrote:

Hi Brocar, I am a zero who wants to install the network server in my pc for a school project. I have followed all the instructions and all the three components are well set up. But when i launch loraserver before lora-app-server i have the error meaning that loraserver can not be connected to lora-app-server. In return when i start lora-app-server before loraserver i get the same error (meaning lora-app-server can not be connecter to loraserver). They retry to reconnect but i dont know how to detect if they are well reconnected. Do you please have a way to start both of them without having this errors please:

Here is the example of logs meaning it can't be connected to the lora-app-server:

déc. 15 00:30:25 aminata loraserver[11642]: time="2016-12-15T00:30:25+01:00" level=info msg="grpc: addrConn.resetTransport failed to create client transport: connection error: desc = "transport: dial tcp 127.0.0.1:8001: getsockopt: connection refused"; Reconnecting to {"127.0.0.1:8001" }" déc. 15 00:30:31 aminata loraserver[11642]: time="2016-12-15T00:30:31+01:00" level=info msg="grpc: addrConn.resetTransport failed to create client transport: connection error: desc = "transport: dial tcp 127.0.0.1:8001: getsockopt: connection refused"; Reconnecting to {"127.0.0.1:8001" }"

— You are receiving this because you commented.

Reply to this email directly, view it on GitHub https://github.com/brocaar/loraserver/issues/97#issuecomment-267193042, or mute the thread https://github.com/notifications/unsubscribe-auth/AAKGeYFWoDSSjG0affDUJA6yHxWUmDnWks5rIIBZgaJpZM4KyCfn .

aminatamima commented 7 years ago

Ok thank you! But how do i know if the reconnection went well ?

brocaar commented 7 years ago

@aminatamima it will log the warning until it re-connected.