bemasher / rtlamr

An rtl-sdr receiver for Itron ERT compatible smart meters operating in the 900MHz ISM band.
GNU Affero General Public License v3.0
2.18k stars 247 forks source link

panic on startup #280

Open utdrmac opened 1 year ago

utdrmac commented 1 year ago

Made a custom docker container with rtl-sdr, rtlamr, and rtlamr-collect. When it starts up, I think there's a race condition that I'm working out where something starts before something else resulting in this panic.

00:59:39.771085 main.go:90: Error connecting to spectrum server: dial tcp 127.0.0.1:1234: connect: connection refused
rcvr.Connect
main.(*Receiver).NewReceiver
    /go/pkg/mod/github.com/bemasher/rtlamr@v0.9.3/main.go:90
main.main
    /go/pkg/mod/github.com/bemasher/rtlamr@v0.9.3/main.go:313
runtime.main
    /usr/local/go/src/runtime/proc.go:250
runtime.goexit
    /usr/local/go/src/runtime/asm_amd64.s:1598
bemasher commented 1 year ago

Yep, you'll need to be sure the spectrum server is running and reachable before rtlamr starts.

If the spectrum server is in another container, I don't think you'll be able to reach it at a localhost anyway.

utdrmac commented 1 year ago

Everything is in 1 container. I submitted this bug report as I figured you'd want to trap the panic and do some sleep-retry logic for a better user experience.

bemasher commented 1 year ago

I agree, it would be a quality of life improvement. I'll have a look at it.

Oxalin commented 9 months ago

I'm not using a container and I'm hitting the same error under Raspberry Pi OS Bookworm. Do you think it is related?

Oxalin commented 9 months ago

I'm not using a container and I'm hitting the same error under Raspberry Pi OS Bookworm. Do you think it is related?

Forget about this, my problem is unrelated. Calling 127.0.0.1 fails, but not using the "external" IP. This is a network configuration problem on my Pi.