Skip to content

Commit 559bfbc

Browse files
committed
Merge branch 'stage' for release v.1.3.0
2 parents 0a56ff0 + 281f2c1 commit 559bfbc

File tree

6 files changed

+990
-0
lines changed

6 files changed

+990
-0
lines changed

README.md

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -76,3 +76,36 @@ Solution:
7676
3. Change related ip of host.docker.internal and gateway.docker.internal to your new ip (found in terminal using the ipconfig command: e.g. 192.168.0.1)
7777
4. save
7878
5. restart the application.
79+
80+
## Adding an ADR Algorithm
81+
When the ADR Algorithm has been tested, and is ready for deployment, it has to be built as a Go Module.
82+
83+
The module is created running:
84+
```bash
85+
mkdir example-mod-name
86+
cd example-mod-name
87+
go mod init example-mod-name
88+
curl https://raw.githubusercontent.com/brocaar/chirpstack-network-server/master/examples/adr-plugin/main.go -o main.go
89+
```
90+
Replace the necessary parts in `main.go` with your own adr algorithm.
91+
Run:
92+
```bash
93+
$env:GOOS="linux"
94+
$env:GOARCH="amd64"
95+
go build
96+
```
97+
and install the packages as described in the output of `go build`.
98+
finally `go build` can be run again to create the plugin, which is a binary with the name of your module `example-mod-name`.
99+
100+
### Adding the Plugin to the Network Server
101+
If the default `docker-compose.yml` file is used, the folder `./configuration/chirpstack-network-server` is already copied to `/etc/chirpstack-network-server` in the docker container.
102+
Therefore a new folder can be added such as `./configuration/chirpstack-network-server/adr-plugins` in which the go module can be added.
103+
This makes the module available at `/etc/chirpstack-network-server/adr-plugins/example-mod-name` within the network server container.
104+
105+
The last step is to specify the file as being an adr-plugin within the `chirpstack-network-server.toml` config file by adding `adr_plugins=["/etc/chirpstack-network-server/adr-plugins/example-mod-name"]` under `[network_server.network_settings]`, like this:
106+
```toml
107+
[network_server.network_settings]
108+
adr_plugins=["/etc/chirpstack-network-server/adr-plugins/example-mod-name"]
109+
```
110+
111+
Your should now be able to restart the network server and the new adr algorithm should be available in the ChirpStack Application Server.
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
module sensade-adr-mod
2+
3+
go 1.13
4+
5+
require (
6+
github.com/brocaar/chirpstack-network-server/v3 v3.15.5
7+
github.com/hashicorp/go-plugin v1.4.0
8+
github.com/sirupsen/logrus v1.8.1
9+
)

0 commit comments

Comments
 (0)