Skip to content

Commit 3672dda

Browse files
committed
Update README
1 parent fa20d2d commit 3672dda

File tree

1 file changed

+9
-9
lines changed

1 file changed

+9
-9
lines changed

README.md

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
## Description
22
An API for controlling Wi-Fi connections on [Balena](https://www.balena.io/os/) devices.
33

4-
It does not contain an interface, instead it provides API endpoints to send requests to interact with the device. Any interface of your choice can be built to interact with the API. If you develop an interface that is open source, please do let me know so I can provide people links.
4+
It does not contain a user interface, instead it provides API endpoints to send requests to interact with the device. Any user interface of your choice can be built to interact with the API. If you develop a user interface that is open source, please do let me know so I can provide people links.
55

66
## Get started
77
On launch, the app will detect if you already have a Wi-Fi connection. If you do, it will sleep and wait for a command. If you don’t, it will launch a hotspot and wait for a connection from you. Once connected, you can take further actions using the endpoints listed below.
@@ -22,18 +22,18 @@ PWC_AC_PASSWORD: "your-password" # Optional, the password associated with the Wi
2222
````
2323

2424
## Securing the API
25-
By default, the API is exposed so your interface can interact directly. In other words, anyone can go to `http://your-device:9090/v1/connect` to send commands to your device.
25+
By default, the API is exposed so your user interface can interact directly. In other words, anyone can go to `http://your-device:9090/v1/connect` to send commands to your device.
2626

2727
If you would prefer to only allow access from your backend, change the `PWC_HOST` environment variable to `127.0.0.1`. Then ensure your backend container is connected to the host network so it matches the API docker-compose.yml file in this repo:
2828

2929
`network_mode: "host"`
3030

31-
Users will then be unable to access the API `http://your-device:9090/v1/connect`. Your backend container on the device, however, can reach the API using `http://127.0.0.1:9090/v1/connect`. This is useful if your interface has a login process, and you only want users to be able to interact with Wi-Fi after logging in.
31+
Users will then be unable to access the API `http://your-device:9090/v1/connect`. Your backend container on the device, however, can reach the API using `http://127.0.0.1:9090/v1/connect`. This is useful if your user interface has a login process, and you only want users to be able to interact with Wi-Fi after logging in.
3232

3333
Alternatively, if you would rather have your backend use specified ports instead of the host network, you can change the `PWC_HOST` environment variable to `172.17.0.1` and access the API from `http://172.17.0.1:9090/v1/connect`.
3434

35-
## Changing the default interface
36-
By default, the first available Wi-Fi interface available will be used. For the vast majority of cases there is only one Wi-Fi interface (`wlan0`) and therefore this is no issue. Similarly, if you plug in a Wi-Fi dongle to a device without its own built-in Wi-Fi, the Wi-Fi dongle will be used by default. If however, you have a device with built in Wi-Fi and a Wi-Fi dongle, you will have a device with two interfaces (usually `wlan0` and `wlan1`). For these instances, or on other occasions where you have a complex interface setup, you can specify which interface you would like Py Wi-Fi Connect to use by setting the environment variable shown in the `docker-compose.yml` file:
35+
## Changing the default network interface
36+
By default, the first available Wi-Fi network interface available will be used. For the vast majority of cases there is only one Wi-Fi network interface (`wlan0`) and therefore this is no issue. Similarly, if you plug in a Wi-Fi dongle to a device without its own built-in Wi-Fi, the Wi-Fi dongle will be used by default. If however, you have a device with built in Wi-Fi and a Wi-Fi dongle, you will have a device with two network interfaces (usually `wlan0` and `wlan1`). For these instances, or on other occasions where you have a complex interface setup, you can specify which network interface you would like Py Wi-Fi Connect to use by setting the environment variable shown in the `docker-compose.yml` file:
3737

3838
````
3939
PWC_INTERFACE: "wlan0" // Optional.
@@ -145,7 +145,7 @@ Fetch list of nearby Wi-Fi networks for passing to the connect endpoint.
145145
// When this is false, your device may need to be restarted to refresh
146146
// the networks list. When it is True, you may be able to refresh the
147147
// links by calling the list_access_points endpoint again. Useful for
148-
// enabling or disabling a refresh button on an interface.
148+
// enabling or disabling a refresh button on a user interface.
149149
}
150150
````
151151

@@ -162,9 +162,9 @@ Requests are returned immediately and then the process is executed. Otherwise us
162162
}
163163
````
164164

165-
### http://your-device:9090/v1//set_interface
165+
### http://your-device:9090/v1/set_interface
166166

167-
By default the Wi-Fi interface is auto-detected. If you need to specify an interface, you can do so using this endpoint.
167+
By default the Wi-Fi network interface is auto-detected. If you need to specify a network interface, you can do so using this endpoint.
168168

169169
To set back to auto-detection, pass `false` as the value.
170170

@@ -173,7 +173,7 @@ Changing the setting will only last until the next restart of the container, whe
173173
#### POST
174174
````
175175
{
176-
"all_networks": "wlan0" // Optional.
176+
"interface": "wlan0" // Optional.
177177
}
178178
````
179179

0 commit comments

Comments
 (0)