Skip to content

Commit 23e66ac

Browse files
committed
updated readme
1 parent 528027d commit 23e66ac

File tree

1 file changed

+45
-41
lines changed

1 file changed

+45
-41
lines changed

README.md

+45-41
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ has been reached.
2121
- Multi Purpose Switch GPIO (e.g Bandswitch, Beverages, etc.)
2222
- Stackmatch GPIO (Stackmatch, Combiners, 4-Squares. etc)
2323
- Dummy Switch (for testing purposes without hardware)
24+
- EA4TX Remotebox
2425

2526
## Supported Transportation Protocols
2627

@@ -33,13 +34,8 @@ remoteSwitch is published under the permissive [MIT license](https://github.com/
3334

3435
## Download
3536

36-
You can download a tarball / zip archive with the compiled binary for MacOS
37-
(AMD64), Linux (386/AMD64/ARM/ARM64) and Windows (386/AMD64) from the
38-
[releases](https://github.com/dh1tw/remoteSwitch/releases) page.
39-
40-
remoteSwitch works particulary well on SoC boards like the Raspberry / Orange / Banana Pis.
41-
42-
remoteSwitch is just a single executable.
37+
You can download a zip archive with the compiled binary for MacOS (AMD64), Linux (386/AMD64/ARM/ARM64) and Windows (386/AMD64) from the
38+
[releases](https://github.com/dh1tw/remoteSwitch/releases) page. remoteSwitch works particularly well on SoC boards like the Raspberry / Orange / Banana Pis. The application itself is just a single executable.
4339

4440
## Dependencies
4541

@@ -77,39 +73,58 @@ So let's fire up a remoteSwitch server for a dummy 6x2 antenna/bandswitch.
7773

7874
To get a list of supported flags for the nats server, execute:
7975

80-
```
76+
``` bash
8177
$ ./remoteSwitch server nats --help
78+
79+
80+
The nats server allows you to expose an Switch on a nats.io broker. The broker
81+
can be located within your local lan or somewhere on the internet.
82+
83+
Usage:
84+
remoteSwitch server nats [flags]
85+
86+
Flags:
87+
-p, --broker-port int Broker Port (default 4222)
88+
-u, --broker-url string Broker URL (default "localhost")
89+
-h, --help help for nats
90+
-P, --password string NATS Password
91+
-U, --username string NATS Username
92+
93+
Global Flags:
94+
--config string config file (default is $HOME/.remoteSwitch.yaml)
8295
```
8396

97+
### Configuration
98+
8499
While some of the parameters can be set via pflags, the switch configuration in particular **MUST** be set in a **config file** due to its complexity.
85100

86101
As a starting point you might want to download a copy of the example configuration file
87102
[./remoteSwitch.toml](https://github.com/dh1tw/remoteSwitch/blob/master/.remoteSwitch.toml)
88-
which comes conveniently pre-configured for our dummy antenna/bandswitch.
103+
which comes conveniently pre-configured for our dummy antenna/bandswitch. The [example folder](https://github.com/dh1tw/remoteSwitch/tree/master/examples) in this repository contains additional example configurations.
104+
105+
### NATS Broker
89106

90-
[NATS](https://nats.io) is an open source, lightweight, high performance message broker which is needed for the underlying communication.
91-
You can decide where to run your NATS instance. You can run it on your local
92-
machine, in a VPN or expose it to the internet. You can download the NATS broker [here](https://nats.io/download/nats-io/gnatsd/).
107+
[NATS](https://nats.io) is an open source, lightweight, high performance message broker which is needed for the underlying communication. You can decide where to run your NATS instance. You can run it on your local machine, in a VPN or expose it to the internet. You can download the NATS broker [here](https://nats.io/download/nats-io/nats-server).
93108

94109
run the NATS broker:
95110

96-
```
97-
$ ./gnatsd
98-
```
111+
``` bash
112+
$ ./nats-server
99113

100-
```
101-
[27781] 2019/01/10 21:36:41.886770 [INF] Starting nats-server version 1.0.4
102-
[27781] 2019/01/10 21:36:41.887812 [INF] Listening for client connections on 0.0.0.0:4222
103-
[27781] 2019/01/10 21:36:41.887821 [INF] Server is ready
114+
[62418] 2020/04/11 02:46:09.413858 [INF] Starting nats-server version 2.1.6
115+
[62418] 2020/04/11 02:46:09.413959 [INF] Git commit [not set]
116+
[62418] 2020/04/11 02:46:09.414150 [INF] Listening for client connections on 0.0.0.0:4222
117+
[62418] 2020/04/11 02:46:09.414156 [INF] Server id is NDCPYYXYRSKD6PIBTS7YHZGEBWIN3CBPRH232CMHUWU3NXBQTTBBQRNF
118+
[62418] 2020/04/11 02:46:09.414158 [INF] Server is ready
104119
```
105120

121+
### Connecting to the NATS broker
122+
106123
Let's execute:
107124

108125
```bash
109126
$ ./remoteSwitch server nats --config=.remoteSwitch.toml
110-
```
111127

112-
```
113128
Using config file:
114129
/home/dh1tw/.remoteSwitch.toml
115130
2019/01/11 23:50:20 Listening on shackbus.switch.6x2_Bandswitch
@@ -118,7 +133,7 @@ Using config file:
118133

119134
## Web Interface
120135

121-
remoteSwitch comes with a built-in web server which allows to control all switches connected to the same NATS broker. All instances of remoteSwitch are automatically discovered.
136+
remoteSwitch comes with a built-in web server which allows to control all switches connected to the same NATS broker. All instances of remoteSwitch are automatically discovered. You can run several instances of the web server. This might be handy if you have to deal with lan/wan restrictions or if you need redundancy.
122137

123138
Simply launch:
124139

@@ -151,38 +166,29 @@ The GPIO switches are pretty flexible in configuration and should be able to cop
151166

152167
## Behaviour on Errors
153168

154-
If an error occures from which remoteSwitch can not recover, the application
155-
exits. It is recommended to execute remoteSwitch as a service under the supervision of a scheduler like [systemd](https://en.wikipedia.org/wiki/Systemd).
169+
If an error occurs from which remoteSwitch can not recover, the application exits. It is recommended to execute remoteSwitch as a service under the supervision of a scheduler like [systemd](https://en.wikipedia.org/wiki/Systemd).
156170

157171
## Bug reports, Questions & Pull Requests
158172

159-
Please use the Github [Issue tracker](https://github.com/dh1tw/remoteSwitch/issues)
160-
to report bugs and ask questions! If you would like to contribute to remoteSwitch,
161-
[pull requests](https://help.github.com/articles/creating-a-pull-request/) are
162-
welcome! However please consider to provide unit tests with the PR to verify
163-
the proper behaviour.
173+
Please use the Github [Issue tracker](https://github.com/dh1tw/remoteSwitch/issues) to report bugs and ask questions! If you would like to contribute to remoteSwitch, [pull requests](https://help.github.com/articles/creating-a-pull-request/) are welcome! However please consider to provide unit tests with the PR to verify the proper behavior.
164174

165175
If you file a bug report, please include always the version of remoteSwitch
166176
you are running:
167177

168178
```` bash
169179
$ remoteSwitch.exe version
170-
````
171180

172-
````
173-
copyright Tobias Wellnitz, DH1TW, 2019
174-
remoteSwitch Version: 0.1.0, darwin/amd64, BuildDate: 2019-01-09T00:58:00+02:00, Commit: 338ff13
181+
copyright Tobias Wellnitz, DH1TW, 2020
182+
remoteSwitch Version: v0.1.0, darwin/amd64, BuildDate: 2020-04-11T02:50:26+02:00, Commit: 528027d
175183
````
176184

177185
## Documentation
178186

179-
The auto generated documentation can be found at
180-
[godoc.org](https://godoc.org/github.com/dh1tw/remoteSwitch).
187+
The auto generated documentation can be found at [godoc.org](https://godoc.org/github.com/dh1tw/remoteSwitch).
181188

182189
## How to build
183190

184-
In order to compile remoteSwitch from the sources, you need to have
185-
[Go](https://golang.org) installed and configured.
191+
In order to compile remoteSwitch from the sources, you need to have [Go](https://golang.org) installed and configured.
186192

187193
This his how to checkout and compile remoteSwitch under Linux/MacOS:
188194

@@ -194,14 +200,12 @@ $ make
194200

195201
## How to execute the tests
196202

197-
All critial packages have their own set of unit tests. The tests can be
198-
executed with the following commands:
203+
All critical packages have their own set of unit tests. The tests can be executed with the following commands:
199204

200205
```bash
201206
$ cd $GOPATH/src/github.com/remoteSwitch
202207
$ go test -v -race ./...
203208

204209
```
205210

206-
The datarace detector might not be available on all platforms / operating
207-
systems.
211+
The race detector might not be available on all platforms / operating systems.

0 commit comments

Comments
 (0)