Hi,
I finally get around to dig a little bit on the why I receive multiple messages from the same uplink.
application/1/node/0044b20000000a04/rx {"applicationID":"1","applicationName":"","nodeName":"LoPy_A04","devEUI":"0044b20000000a04","rxInfo":[{"mac":"ac1dbeef00000002","time":"2017-09-07T19:18:37.299913Z","rssi":-112,"loRaSNR":-4.2,"name":"GW002","latitude":45.85282,"longitude":8.79437,"altitude":668}],"txInfo":{"frequency":868500000,"dataRate":{"modulation":"LORA","bandwidth":125,"spreadFactor":7},"adr":false,"codeRate":"4/5"},"fCnt":173,"fPort":2,"data":"nWgsQ1gAVwA="}
application/1/node/0044b20000000a04/rx {"applicationID":"1","applicationName":"","nodeName":"LoPy_A04","devEUI":"0044b20000000a04","rxInfo":[{"mac":"ac1dbeef00000003","time":"2017-09-07T19:18:37.299915Z","rssi":-85,"loRaSNR":7,"name":"GW003","latitude":45.78469,"longitude":8.77047,"altitude":349}],"txInfo":{"frequency":868500000,"dataRate":{"modulation":"LORA","bandwidth":125,"spreadFactor":7},"adr":false,"codeRate":"4/5"},"fCnt":173,"fPort":2,"data":"nWgsQ1gAVwA="}
The exact same message is arrived at two different gateway at a slightly different time (2 micro seconds I believe).
However, I do receive the message twice.
Where should I look to understand what is going on?
I had a look in the source code and I am not sure how this line: https://github.com/brocaar/loraserver/blob/master/internal/uplink/collect.go#L72 works.
It seems the same mechanism adopted here: https://github.com/brocaar/lora-app-server/blob/2dacf45ad42d023413e4bbf05084c5b86749312b/internal/handler/mqtt_handler.go#L244
However, there is an extra parenthesis.
The extra parenthesis looks weird to me, especially if we consider that this code:
package main
import (
"fmt"
"github.com/garyburd/redigo/redis"
)
func main() {
a, err := redis.String(("ciao"))
fmt.Println(err)
fmt.Println("vim-go")
}
Doesn’t compile with:
# command-line-arguments
./main.go:9: not enough arguments in call to redis.String
I believe that either I am missing something extremelly obvious or there is some kind of typo in the source code…