You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+9-9Lines changed: 9 additions & 9 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,7 +1,7 @@
1
1
## Description
2
2
An API for controlling Wi-Fi connections on [Balena](https://www.balena.io/os/) devices.
3
3
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.
5
5
6
6
## Get started
7
7
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
22
22
````
23
23
24
24
## 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.
26
26
27
27
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:
28
28
29
29
`network_mode: "host"`
30
30
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.
32
32
33
33
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`.
34
34
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:
37
37
38
38
````
39
39
PWC_INTERFACE: "wlan0" // Optional.
@@ -145,7 +145,7 @@ Fetch list of nearby Wi-Fi networks for passing to the connect endpoint.
145
145
// When this is false, your device may need to be restarted to refresh
146
146
// the networks list. When it is True, you may be able to refresh the
147
147
// 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.
149
149
}
150
150
````
151
151
@@ -162,9 +162,9 @@ Requests are returned immediately and then the process is executed. Otherwise us
162
162
}
163
163
````
164
164
165
-
### http://your-device:9090/v1//set_interface
165
+
### http://your-device:9090/v1/set_interface
166
166
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.
168
168
169
169
To set back to auto-detection, pass `false` as the value.
170
170
@@ -173,7 +173,7 @@ Changing the setting will only last until the next restart of the container, whe
0 commit comments