From 93fd0336824b7f859ec6568bfdb1f909c0faee43 Mon Sep 17 00:00:00 2001 From: Orne Brocaar Date: Thu, 30 Jun 2016 19:36:28 +0200 Subject: [PATCH] Rename lora-semtech-bridge > lora-gateway-bridge. --- .travis.yml | 4 +-- CHANGELOG.md | 6 +++++ Dockerfile | 4 +-- Makefile | 8 +++--- README.md | 15 ++++++----- cmd/lora-gateway-bridge/doc.go | 25 +++++++++++++++++++ .../doc.sh | 0 .../main.go | 10 ++++---- cmd/semtech-bridge/doc.go | 25 ------------------- docker-compose.yml | 4 +-- vendor/vendor.json | 2 +- 11 files changed, 54 insertions(+), 49 deletions(-) create mode 100644 cmd/lora-gateway-bridge/doc.go rename cmd/{semtech-bridge => lora-gateway-bridge}/doc.sh (100%) rename cmd/{semtech-bridge => lora-gateway-bridge}/main.go (89%) delete mode 100644 cmd/semtech-bridge/doc.go diff --git a/.travis.yml b/.travis.yml index eec97217..c761a4bc 100644 --- a/.travis.yml +++ b/.travis.yml @@ -15,9 +15,9 @@ deploy: skip_cleanup: true provider: releases api_key: - secure: hue09xkRBLJpF5gR7nBCn1CySTTwUwe2ZYZA4Q2RjqdQ6Tk8KXgaJp+wk3xl24oWUb4l6dv2dETy+awT/G1DsOz6z5oGzuNFvAuTIqWgk5eIpctwPYlc9t0mgUnBJCx/eDYIoN/ogBxoE2QFE4CCfYcGd5iFpYb2aPw8oP6Pc5LYsm6PYUHi1IE69tyMj9aFWgtMYX8OxjhTx4vFpDvQmipQE3LqYlu9z7DyeIeuxLBgGFnrjOBQsjlUsQcsgmyeazUBN8qSUhYTdhSwYw5OEI45Ddc/Pkj/pz6HbHygUmO6FIa64rLADVK0Cuaw8+jxYSgeFu2sdIk7wE30sWBITzZhvs9k/OLIghwg+eu9mZ0l0i0K1gfdwqMpQA//QnXDzSiu6FkbCz0dNQX95VJNHfmMCSrg8Dd3ebMx+4VceU6IdWEtyJAHwFONJ4cNieufaPawnEym5VBG2uZ/Iv7rYFoS1W53oCD2mGDRWpTMxQkfFMAgD0gIDB+oN0FVaApjWy+/4KVXRYf4+Eqh0BZ6YizTRt+QmD3X+0jh3j/h0wMYUE6lAGqOmTcJUPUpGBzzx3jT9XVBHCeBTVTWT7wZAMtVPGyFj2Izm/B601DIsrIdvCco4QEUTCUjZjKDM6A3OUz512GBSbKYZ0EVGoxhRv2CRSO4MeQM5Y7Lwpu/6mc= + secure: i9kTpzo0LVyMdMyN66SxXGBYovd98+B4DW9t/xFxx0cOzCwDKx/2p2WYF7cbT6FhVQVPZHJuIqatEFPVHgkRbiqsLIN26RL7xdCGV0gqjYoXVjJEdr6s9z1BhxUDGHY5oKhTZP7mHM+5jdHyZiwBbVFhJkeEbuZfwaOu7fho3IgGgnMASMh0LODk5niBnAJah1tMyUa5+7lW3fBAjwP2DNPICzIFm35JFjI5ViyirWcSapuTTE70BOH02PNd/wjx/4VnW5+wgCPeZXqjUQ5u94KHNLj5AxwotbzLNM1fDngJeDCmFMUPCjR+LCRnEO+4qhdMAhBdiTn0tXFoVQXlywrmfBdQtA3Kr8GSWHF1x2Oqr6/sIti0+fjyqdHRG2LdL7shEktBrG3muNUrVflpHXBzPOm9HvzQ7Hws6JudY52kermCeCRcbypcWz9PSK+XtAIbQxY0hO3cBRysNKjQ3K6IwPaUUqJzLrdowZ/LRhDur1JBXwc6cxS+4Yv885jUhIIfvFuM/lE1btK1zAtqVT1YVfXSpnMWk/FvBohHbQRy4i80Vd3an41hdM5Di/rPI8rkRaCqGRep3/FitKCVixvI1lKzgfRDFGLIBTBor0tL6tfD4T3ZuC/hRpTzI+UHx8XyO1RGZQIHNj3jIOJl+EBVYz+93KS3Z80v3uMj5ck= file_glob: true file: "dist/*.tar.gz" on: tags: true - repo: brocaar/lora-semtech-bridge + repo: brocaar/lora-gateway-bridge diff --git a/CHANGELOG.md b/CHANGELOG.md index ed8081f7..13737771 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,8 +1,14 @@ # Changelog +## 1.1.5 + +* Rename from `lora-semtech-bridge` to `lora-gateway-bridge` + (backported from 2.0.2) + ## 1.1.4 * Update `lorawan` vendor to fix a mac command related marshaling issue. + (backported from 2.0.1) ## 1.1.3 diff --git a/Dockerfile b/Dockerfile index 6de30d21..de61f60d 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,6 +1,6 @@ FROM golang:1.6.2 -ENV PROJECT_PATH=/go/src/github.com/brocaar/lora-semtech-bridge +ENV PROJECT_PATH=/go/src/github.com/brocaar/lora-gateway-bridge ENV PATH=$PATH:$PROJECT_PATH/build # install tools @@ -17,4 +17,4 @@ COPY . $PROJECT_PATH # build RUN make build -CMD ["semtech-bridge"] +CMD ["lora-gateway-bridge"] diff --git a/Makefile b/Makefile index 7b44ca44..10fbcd5d 100644 --- a/Makefile +++ b/Makefile @@ -7,7 +7,7 @@ GOARCH ?= amd64 build: @echo "Compiling source for $(GOOS) $(GOARCH)" @mkdir -p build - @GOOS=$(GOOS) GOARCH=$(GOARCH) go build -ldflags "-X main.version=$(VERSION)" -o build/semtech-bridge$(BINEXT) cmd/semtech-bridge/main.go + @GOOS=$(GOOS) GOARCH=$(GOARCH) go build -ldflags "-X main.version=$(VERSION)" -o build/lora-gateway-bridge$(BINEXT) cmd/lora-gateway-bridge/main.go clean: @echo "Cleaning up workspace" @@ -26,13 +26,13 @@ package: clean build @echo "Creating package for $(GOOS) $(GOARCH)" @mkdir -p dist/$(VERSION) @cp build/* dist/$(VERSION) - @cd dist/$(VERSION)/ && tar -pczf ../lora_semtech_bridge_$(VERSION)_$(GOOS)_$(GOARCH).tar.gz . + @cd dist/$(VERSION)/ && tar -pczf ../lora_gateway_bridge_$(VERSION)_$(GOOS)_$(GOARCH).tar.gz . @rm -rf dist/$(VERSION) # shortcuts for development serve: build - ./build/semtech-bridge + ./build/lora-gateway-bridge run-compose-test: - docker-compose run --rm semtechbridge make test + docker-compose run --rm gatewaybridge make test diff --git a/README.md b/README.md index b3115e44..6cb15c49 100644 --- a/README.md +++ b/README.md @@ -1,9 +1,8 @@ -# LoRa Semtech Bridge +# LoRa Gateway Bridge -[![Build Status](https://travis-ci.org/brocaar/lora-semtech-bridge.svg?branch=master)](https://travis-ci.org/brocaar/lora-semtech-bridge) -[![GoDoc](https://godoc.org/github.com/brocaar/lora-semtech-bridge/cmd/semtech-bridge?status.svg)](https://godoc.org/github.com/brocaar/lora-semtech-bridge/cmd/semtech-bridge) +[![Build Status](https://travis-ci.org/brocaar/lora-gateway-bridge.svg?branch=master)](https://travis-ci.org/brocaar/lora-gateway-bridge) -*LoRa Semtech Bridge* is a service to enable LoRa gateway communication over MQTT. +*LoRa Gateway Bridge* is a service to enable LoRa gateway communication over MQTT. All incoming UDP traffic (Semtech UDP protocol) is published to a MQTT broker and all messages received from the MQTT broker are sent to the gateway using UDP. @@ -24,17 +23,17 @@ Depending upon your LoRa Gateway type, you might need to install the ## Getting started -* Download and unpack a pre-compiled binary from the [releases](https://github.com/brocaar/lora-semtech-bridge/releases) +* Download and unpack a pre-compiled binary from the [releases](https://github.com/brocaar/lora-gateway-bridge/releases) page. Alternatively, build the code from source (when you have a Go development environment ``make build`` should be sufficient). -* Start the ``semtech-bridge`` service. The ``--help`` argument will show +* Start the ``lora-gateway-bridge`` service. The ``--help`` argument will show you all the available config options. When everything is setup correctly - (your gateway is configured to send data to ``semtech-bridge``), you + (your gateway is configured to send data to ``lora-gateway-bridge``), you should see ``PullData`` packets coming in. E.g. ``` bash -$ ./bin/semtech-bridge +$ ./bin/lora-gateway-bridge INFO[0000] backend/mqttpubsub: connecting to mqtt server server=tcp://127.0.0.1:1883 INFO[0000] starting gateway udp listener addr=0.0.0.0:1700 INFO[0006] incoming gateway packet addr=192.168.1.4:54993 type=PullData diff --git a/cmd/lora-gateway-bridge/doc.go b/cmd/lora-gateway-bridge/doc.go new file mode 100644 index 00000000..6162c9a1 --- /dev/null +++ b/cmd/lora-gateway-bridge/doc.go @@ -0,0 +1,25 @@ +/* +NAME: + lora-gateway-bridge - abstracts the packet_forwarder protocol into JSON over MQTT + +USAGE: + main [global options] command [command options] [arguments...] + +COMMANDS: + help, h Shows a list of commands or help for one command + +GLOBAL OPTIONS: + --udp-bind "0.0.0.0:1700" ip:port to bind the UDP listener to [$UDP_BIND] + --mqtt-server "tcp://127.0.0.1:1883" MQTT server [$MQTT_SERVER] + --mqtt-username MQTT username [$MQTT_USERNAME] + --mqtt-password MQTT password [$MQTT_PASSWORD] + --log-level "4" debug=5, info=4, warning=3, error=2, fatal=1, panic=0 [$LOG_LEVEL] + --help, -h show help + --version, -v print the version + +COPYRIGHT: + See http://github.com/brocaar/lora-gateway-bridge for copyright information + + +*/ +package main diff --git a/cmd/semtech-bridge/doc.sh b/cmd/lora-gateway-bridge/doc.sh similarity index 100% rename from cmd/semtech-bridge/doc.sh rename to cmd/lora-gateway-bridge/doc.sh diff --git a/cmd/semtech-bridge/main.go b/cmd/lora-gateway-bridge/main.go similarity index 89% rename from cmd/semtech-bridge/main.go rename to cmd/lora-gateway-bridge/main.go index 8b35be6a..ea5c2a26 100644 --- a/cmd/semtech-bridge/main.go +++ b/cmd/lora-gateway-bridge/main.go @@ -8,8 +8,8 @@ import ( "syscall" log "github.com/Sirupsen/logrus" - "github.com/brocaar/lora-semtech-bridge/backend/mqttpubsub" - "github.com/brocaar/lora-semtech-bridge/gateway" + "github.com/brocaar/lora-gateway-bridge/backend/mqttpubsub" + "github.com/brocaar/lora-gateway-bridge/gateway" "github.com/brocaar/lorawan" "github.com/codegangsta/cli" ) @@ -72,9 +72,9 @@ func run(c *cli.Context) error { func main() { app := cli.NewApp() - app.Name = "semtech-bridge" - app.Usage = "communicate with a LoRa gateway (Semtech UDP protocol) over MQTT" - app.Copyright = "See http://github.com/brocaar/lora-semtech-bridge for copyright information" + app.Name = "lora-gateway-bridge" + app.Usage = "abstracts the packet_forwarder protocol into JSON over MQTT" + app.Copyright = "See http://github.com/brocaar/lora-gateway-bridge for copyright information" app.Version = version app.Action = run app.Flags = []cli.Flag{ diff --git a/cmd/semtech-bridge/doc.go b/cmd/semtech-bridge/doc.go deleted file mode 100644 index 70de874a..00000000 --- a/cmd/semtech-bridge/doc.go +++ /dev/null @@ -1,25 +0,0 @@ -/* -NAME: - semtech-bridge - communicate with a LoRa gateway (Semtech UDP protocol) over MQTT - -USAGE: - main [global options] command [command options] [arguments...] - -COMMANDS: - help, h Shows a list of commands or help for one command - -GLOBAL OPTIONS: - --udp-bind "0.0.0.0:1700" ip:port to bind the UDP listener to [$UDP_BIND] - --mqtt-server "tcp://127.0.0.1:1883" MQTT server [$MQTT_SERVER] - --mqtt-username MQTT username [$MQTT_USERNAME] - --mqtt-password MQTT password [$MQTT_PASSWORD] - --log-level "4" debug=5, info=4, warning=3, error=2, fatal=1, panic=0 [$LOG_LEVEL] - --help, -h show help - --version, -v print the version - -COPYRIGHT: - See http://github.com/brocaar/lora-semtech-bridge for copyright information - - -*/ -package main diff --git a/docker-compose.yml b/docker-compose.yml index 617a1b47..7549dc16 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -1,10 +1,10 @@ -semtechbridge: +gatewaybridge: build: . command: make serve ports: - "1700/udp:1700/udp" volumes: - - ./:/go/src/github.com/brocaar/lora-semtech-bridge + - ./:/go/src/github.com/brocaar/lora-gateway-bridge links: - mosquitto environment: diff --git a/vendor/vendor.json b/vendor/vendor.json index 7f2383f0..89563362 100644 --- a/vendor/vendor.json +++ b/vendor/vendor.json @@ -105,5 +105,5 @@ "revisionTime": "2016-06-15T20:37:29Z" } ], - "rootPath": "github.com/brocaar/lora-semtech-bridge" + "rootPath": "github.com/brocaar/lora-gateway-bridge" }